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 736174 - Too little margins around the button on the welcome dialog
Too little margins around the button on the welcome dialog
Status: RESOLVED FIXED
Product: gnome-software
Classification: Applications
Component: General
3.13.x
Other Linux
: Normal minor
: ---
Assigned To: GNOME Software maintainer(s)
GNOME Software maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-09-06 01:16 UTC by Rafal Luzynski
Modified: 2014-09-26 21:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The first run dialog box with LANG=pt_BR, lt_LT, en_US and pl_PL (200.53 KB, image/png)
2014-09-06 01:16 UTC, Rafal Luzynski
  Details
Possible solution to fix the problem (2.50 KB, patch)
2014-09-06 23:48 UTC, Rafal Luzynski
none Details | Review
Another solution to the problem, hopefully correct (2.14 KB, patch)
2014-09-25 23:47 UTC, Rafal Luzynski
committed Details | Review

Description Rafal Luzynski 2014-09-06 01:16:35 UTC
Created attachment 285545 [details]
The first run dialog box with LANG=pt_BR, lt_LT, en_US and pl_PL

The issue depends on the language. In most languages including English the dialog looks correct: there is a nice margin above and below the "Let's Go shopping" button. But in some languages there is almost no margin and IMHO it looks bad. The button needs predictable margins.

So far I have discovered that this is related to the width of the localized "Welcome to Software" label which determines the minimum width of the dialog box which in turn determines the required height of the wrapped description label. If the "Welcome to Software" label is small then the description label reserves more vertical space but does not use it and grants it to the button. If the "Welcome to Software" label is larger then the description label does not reserve extra vertical space and the button gets nothing.

The problem is not trivial: increasing the button margins makes the button look fine where the margin was too small but also causes the margin to be too large where it was correct.
Comment 1 Rafal Luzynski 2014-09-06 23:48:57 UTC
Created attachment 285599 [details] [review]
Possible solution to fix the problem

This patch increases the top and bottom margin of the button by 21 each because this was the extra amount they received in English and many other locales. Now the margins are constant and will be the same for all languages and for all dialog window sizes. Any extra space of the window will be assigned to the icon image which already has a large area around and more space should not be harmful.

If you are going to test this patch please note that you will have to edit the value of the key /org/gnome/software/first-run, for example:

    $ dconf write /org/gnome/software/first-run true

or otherwise the dialog box will not appear. Then run the gnome-software. You can use the LANG environment variable to see it in different languages.
Comment 2 Kalev Lember 2014-09-16 08:57:49 UTC
Hi Rafal,

Thanks for investigating this and for the patch! I am not sure the extra 42 pixels around the icon look good though. Is there any way to fix this without changing the margins around the icon?

before: https://kalev.fedorapeople.org/gnome-software-first-run-1.png
after: https://kalev.fedorapeople.org/gnome-software-first-run-2.png
Comment 3 Rafal Luzynski 2014-09-16 23:30:05 UTC
Hi Kalev. Yes, there are multiple ways to solve the problem. The main reason why the problem appears is that we don't control the minimum width of the window correctly. At the moment it is determined by the width of the "Welcome to Software" label (id="label1"). For most languages this causes the long description label (id="label2") to reserve extra vertical space. However, in some languages the extra vertical space is not reserved because it would never be used and this causes little vertical space around the button.

To control the minimum width of the window you can do one of:
- set the width_chars of id="label1" to the amount larger than the length of the string in any language,
- set the width_chars of id="label2" to make sure it is always wider than "label1",
- by the way please note that max_width_chars does almost nothing for wrapping labels because they use all of the available width anyway,
- explicitly set the width_request of any of the containers or of the dialog window (but can we determine the minimum width which will be appropriate for a wide range of devices?)
- make the dialog window non-resizeable so it would not expect to be narrowed by the user and would not reserve extra space for the label. (Actually I have not tried this.)

But if you do anything of the above you will have to increase the margins of the button or you will see the original problem in all languages.
Comment 4 Rafal Luzynski 2014-09-25 23:47:55 UTC
Created attachment 287119 [details] [review]
Another solution to the problem, hopefully correct

After talking to aday I have prepared this patch which sets the dialog box as nonresizable. This makes the things easier because there is no "extra space reserved for resize" problem. Button margins increased as previously. Now the dialog box looks the same for probably all languages.
Comment 5 Kalev Lember 2014-09-26 11:08:20 UTC
Review of attachment 287119 [details] [review]:

Looks good to me, thanks! Do you have git push access or want me to push it for you?
Comment 6 Rafal Luzynski 2014-09-26 20:47:38 UTC
Thanks, Kalev. I don't have git push access and I don't need it at the moment so please push it on my behalf.