After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733520 - [PATCHes] Use an AspectFrame to ensure all looks good.
[PATCHes] Use an AspectFrame to ensure all looks good.
Status: RESOLVED FIXED
Product: gnome-sudoku
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-sudoku-maint
gnome-sudoku-maint
Depends on:
Blocks:
 
 
Reported: 2014-07-21 20:53 UTC by Arnaud B.
Modified: 2014-08-16 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Correct indentation. (866 bytes, patch)
2014-07-21 20:53 UTC, Arnaud B.
committed Details | Review
Use an AspectFrame to ensure all looks good. (13.95 KB, patch)
2014-07-21 20:53 UTC, Arnaud B.
reviewed Details | Review
Use an AspectFrame to ensure all looks good. (14.01 KB, patch)
2014-07-22 16:30 UTC, Arnaud B.
none Details | Review
Use an AspectFrame to ensure all looks good. (14.03 KB, patch)
2014-07-25 10:27 UTC, Arnaud B.
none Details | Review
Screenshot showing reduced board size and spacing inconsistency (49.05 KB, text/plain)
2014-07-25 12:22 UTC, Parin Porecha
  Details
Use an AspectFrame to ensure all looks good. (16.20 KB, patch)
2014-07-25 18:51 UTC, Arnaud B.
committed Details | Review
Remember window size and state. (3.39 KB, patch)
2014-07-25 18:52 UTC, Arnaud B.
committed Details | Review
Notations. (14.27 KB, patch)
2014-07-25 19:19 UTC, Arnaud B.
committed Details | Review
Adjust default and minimum sizes. (1.63 KB, patch)
2014-08-16 13:20 UTC, Arnaud B.
none Details | Review

Description Arnaud B. 2014-07-21 20:53:29 UTC
Created attachment 281345 [details] [review]
Correct indentation.

I’ve recently corrected a bug in Iagno [1], using an AspectFrame to ensure the board and its right-column look always good. Sudoku doesn’t have this bug, but its behaviour on windows where height > width isn’t really good. Here is a patch that makes it have (exactly [2]) the same behaviour (after an indent-patch).

[1] https://bugzilla.gnome.org/show_bug.cgi?id=733502
[2] http://pix.toile-libre.org/upload/original/1405974637.png
Comment 1 Arnaud B. 2014-07-21 20:53:52 UTC
Created attachment 281346 [details] [review]
Use an AspectFrame to ensure all looks good.
Comment 2 Michael Catanzaro 2014-07-22 02:07:23 UTC
Review of attachment 281345 [details] [review]:

k
Comment 3 Michael Catanzaro 2014-07-22 02:11:14 UTC
Review of attachment 281346 [details] [review]:

So the difference is the placement of the window buttons.  I think I do like your version better.

Parin, do you agree? Please handle Arnaud's response and commit if you like it. You're more than ready to start reviewing others' patches.

::: data/gnome-sudoku.ui
@@ +4,3 @@
     <object class="GtkApplicationWindow" id="sudoku_app">
         <property name="title" translatable="yes">Sudoku</property>
+        <property name="border-width">25</property>

Maybe a little bit less would look better with smaller windows? (20?)

::: src/gnome-sudoku.vala
@@ +119,3 @@
+        {
+            /* Pixel-perfect compatibility with games that have a Button without ButtonBox. */
+            var data = """GtkButtonBox { -GtkButtonBox-child-internal-pad-x:0; }""";

* Do you really need the triple quotes? Those shouldn't be necessary since the string fits on one line, right?
Comment 4 Arnaud B. 2014-07-22 04:42:36 UTC
Before committing, please wait until we all agree on the Iagno’s tweaks’ bug [1], I’ll post an update here, so the two games will have exactly the same behaviour (except the minimum size of the window).

By the way, the lines between the cells are too small, so/and they disappear on my screen when I resize the window. Do you have the same problem (on lower resolutions) ? And of course this patch, with its complex layout, doesn’t help, so I’m looking for a solution.

I’ll try with the border-width. And I used the triple quotes for the case where the CSS will contain a quote character, but as there isn’t, it’s technically unuseful.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=733521
Comment 5 Michael Catanzaro 2014-07-22 12:55:51 UTC
(In reply to comment #4)
> By the way, the lines between the cells are too small, so/and they disappear on
> my screen when I resize the window. Do you have the same problem (on lower
> resolutions) ? And of course this patch, with its complex layout, doesn’t help,
> so I’m looking for a solution.

No, I've never seen them disappear. :/ Allan requested thin lines but this sounds like a bad problem (for a different bug report).
Comment 6 Michael Catanzaro 2014-07-22 13:04:40 UTC
(In reply to comment #5)
> No, I've never seen them disappear. :/ Allan requested thin lines but this
> sounds like a bad problem (for a different bug report).

Unless you mean that the black border (of the same width) between 3x3 regions disappears when maximized -- I am seeing this.

Also, bug #710626 is related
Comment 7 Arnaud B. 2014-07-22 16:01:10 UTC
> Unless you mean that the black border (of the same width) between 3x3 regions
> disappears when maximized -- I am seeing this.
Yes it’s that, but it’s not a maximizing-only problem here: it is caused by the approximations of the computer (calculations and have-to-fit-to-a-pixel) when drawing the board’s tiles, so it is common on big resolution with a big board, and having a complex layout (with more calculations…) probably makes the problem more important (that’s why I mentionned it here).
Comment 8 Arnaud B. 2014-07-22 16:30:01 UTC
Created attachment 281402 [details] [review]
Use an AspectFrame to ensure all looks good.

Here’s the update, to go with my second proposition (id=281401) on Iagno’s bug [1].

[1] https://bugzilla.gnome.org/show_bug.cgi?id=733521#c4
Comment 9 Parin Porecha 2014-07-23 21:19:09 UTC
(In reply to comment #8)
> Created an attachment (id=281402) [details] [review]
> Use an AspectFrame to ensure all looks good.

Hi Arnaud, can you please rebase your patch with the current master ?
Patch fails to apply in gnome-sudoku.vala -
error: patch failed: src/gnome-sudoku.vala:173
error: src/gnome-sudoku.vala: patch does not apply
Comment 10 Parin Porecha 2014-07-23 21:20:43 UTC
Comment on attachment 281345 [details] [review]
Correct indentation.

Pushed as 1c79ccd
Comment 11 Arnaud B. 2014-07-25 10:27:39 UTC
Created attachment 281682 [details] [review]
Use an AspectFrame to ensure all looks good.
Comment 12 Parin Porecha 2014-07-25 12:22:17 UTC
Created attachment 281693 [details]
Screenshot showing reduced board size and spacing inconsistency

(In reply to comment #11)
> Created an attachment (id=281682) [details] [review]
> Use an AspectFrame to ensure all looks good.

I like the changes this patch has made. Having Iagno and Sudoku follow the same behaviour on resize is good, and much desirable.

But the new UI is different than Allan's mockup (https://raw.github.com/gnome-design-team/gnome-mockups/master/games/sudoku/sudoku.png).
- Default size has inconsistent spacing. 'New Puzzle' and 'Clear Board' buttons are not centered in the right sidebar, and board has more margin on top/bottom than left/right.
Iagno does not have this problem, since the default size is such that all the spacings are consistent. 'Start Over' button is centered in the right sidebar, and the board has equal margins for all sides. Only when it is resized to sudoku, the inconsistency arises.
Allan's mockup had consistent spacing all over, and I think we should not remove that.

- Default board size has been reduced considerably.
Iagno board cells do not have to show any text, and so the small size of the board is okay.
But since we have to show value and earmarks, I think the size of the board should be larger.
Comment 13 Arnaud B. 2014-07-25 18:51:10 UTC
Created attachment 281722 [details] [review]
Use an AspectFrame to ensure all looks good.

> But the new UI is different than Allan's mockup
> - Default size has inconsistent spacing. 'New Puzzle' and 'Clear Board' buttons
> are not centered in the right sidebar, and board has more margin on top/bottom
> than left/right.
>
> Iagno does not have this problem, since the default size is such that all the
> spacings are consistent. 'Start Over' button is centered in the right sidebar,
> and the board has equal margins for all sides. Only when it is resized to
> sudoku, the inconsistency arises.
> Allan's mockup had consistent spacing all over, and I think we should not
> remove that.
Allan’s mockup(s) is (are usually) quite cool for planning the visible features of the main window, but that doesn’t mean they show all the things. Playing maximized on a 16:9 (touch)screen is really fun, but you don’t want your board to be on the left, and you don’t want your “new puzzle” button to be the quarter of the width of your screen with a ridiculous height; at the opposite, playing on a small screen / with a little window constrain a compactable layout. That’s why this AspectFrame is really important, and that’s why I prefer working first on a layout that works correctly for more than one game, than to directly implement a mockup.

This update of the patch should correct the bugs of the previous, related to the spacings and margins on a small window.

> Iagno board cells do not have to show any text, and so the small size of the
> board is okay.
> But since we have to show value and earmarks, I think the size of the board
> should be larger.
The board should be able to reduce, to ensure we could play on every screen; it’s completely readable on the actual smaller size. Not sure it’s necessary to default on a larger window, but I don’t have a strong opinion on that. More important is that the app remembers the size of the window, and that’s the goal of the next patch.
Comment 14 Arnaud B. 2014-07-25 18:52:16 UTC
Created attachment 281723 [details] [review]
Remember window size and state.
Comment 15 Arnaud B. 2014-07-25 19:19:24 UTC
Created attachment 281724 [details] [review]
Notations.

A notations patch I already submitted elsewhere, but the faster it is applied, the better I could work on top of it. ^^
Comment 16 Parin Porecha 2014-07-29 16:41:42 UTC
Review of attachment 281722 [details] [review]:

This is much better, very close to what I had in mind.
Please make the changes I've described below, and I'll commit this patch.

- The default size is very less, and it makes the earmarks almost unreadable. Please increase the size request so that the board looks bigger, and the game window occupies around 665 x 570 px - http://i.imgur.com/HPtMD3z.png , or some near round figure.

::: src/sudoku-view.vala
@@ -183,3 @@
 
-    public override void get_preferred_width (out int minimal_width, out int natural_width)
-    {

This patch is only for replacing the game box with AspectFrame, right ?
So, this function should not be removed here. Include the removal in your Notations patch.

@@ -191,3 @@
-
-    public override void get_preferred_height (out int minimal_height, out int natural_height)
-        side = width > height ? width : height;

Same with this one.
Comment 17 Parin Porecha 2014-07-29 17:01:34 UTC
Review of attachment 281724 [details] [review]:

Thanks for working on this, Arnaud !

This patch is good, and is almost fit to be merged.
Just two things -
- Please include the get_preferred_width/height functions removal in this patch.
- "Notations" doesn't sound much informative. Can you please change the commit message to reflect the corrections you've done to code style, and cleanup ?

That's all :-)
Comment 18 Parin Porecha 2014-07-29 19:40:55 UTC
Review of attachment 281723 [details] [review]:

Please change the default width/height, and this patch will be ready to be committed.
Comment 19 Parin Porecha 2014-08-11 22:46:11 UTC
Comment on attachment 281722 [details] [review]
Use an AspectFrame to ensure all looks good.

Increased size request from 350 to 480 and pushed as 72266fe
Comment 20 Parin Porecha 2014-08-11 22:47:23 UTC
Comment on attachment 281723 [details] [review]
Remember window size and state.

Changed default size from 540x500 to 730x630 and pushed as ccb67c0
Comment 21 Parin Porecha 2014-08-11 22:48:40 UTC
Comment on attachment 281724 [details] [review]
Notations.

Changed commit message to "Correct code style and clean-up unused code" and pushed as 73d58d1
Comment 22 Arnaud B. 2014-08-16 13:20:05 UTC
Created attachment 283591 [details] [review]
Adjust default and minimum sizes.

Sorry for being late, I had a problem of stolen computer so I spent the end of my holidays in real life instead of on Internet. ^^

I strongly suggest changing at least the default size of the window, to fit naturally in 800~960 × 600 screens (with a panel), like some netbooks’ one… and really don’t see why setting a (big) minimum size, as it’s definitively readable when the board requests 350 × 350, and as long as it remains a user’s choice. See the patch.

Thanks for the pushs and the other things. =)
Comment 23 Michael Catanzaro 2014-08-16 14:18:35 UTC
Why 707 and not 700?
Comment 24 Arnaud B. 2014-08-16 14:31:41 UTC
> Why 707 and not 700?
To avoid extra top and bottom margins around the board. I choosed the 580 height as explained, and selected the minimal width for the window that permits that the board has no extra margin.