GNOME Bugzilla – Bug 736174
Too little margins around the button on the welcome dialog
Last modified: 2014-09-26 21:52:45 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.
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.
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
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.
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.
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?
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.