Bug 3011

Summary: Button style in the image details screen should be taken from the host theme
Product: [Build System, Metadata & Runtime] Hob Reporter: Belen Barros Pena <belen.barros.pena>
Component: hobAssignee: Ioana Grigoropol <ioanax.grigoropol>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: Medium+ CC: alexandru.damian, cristian.iorga, poky.bs.watcher, poky.watcher, sgw, song.liu, valentin.popa
Version: unspecified   
Target Milestone: 1.3 M4   
Hardware: All   
OS: Multiple   
Whiteboard: Patch merged
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
stop-button.png
none
edit-packages-buttons.png
none
edit-recipes-buttons.png
none
image-details-buttons.png
none
right-button-proportions.png
none
Updated stop button
none
Updated edit packages
none
Updated edit recipes
none
Updated image details none

Description Belen Barros Pena 2012-08-24 10:41:38 UTC
The primary action is the one on the bottom right. All others are secondary. There should be no 'or' between the actions.
Comment 1 Ioana Grigoropol 2012-09-05 11:51:23 UTC
-Created a basic BaseHobButton class that uses gtk settings for buttons taken from host theme 
-All buttons in the interface inherit a BaseHobButton
-Removed 'or' label between actions on image details page

Is this what was intended ?

[Patch sent to bitbake-devel mailing list]
Comment 2 Belen Barros Pena 2012-09-13 11:23:18 UTC
Hi Ionana,

I am going to reopen this because there are a couple of small tweaks we need to make in the buttons. In some of them, the width and height seem to be a bit off. For example:

- During the recipe parsing, the 'stop' button is too high (see stop-button.png)
- In the 'Edit recipes' and 'Edit packages' screens, the 'Build image' button is too wide, the 'Cancel' and 'View log' buttons are too narrow (see edit-packages-buttons.png and edit-recipes-buttons.png)
- In the 'Image details' screen, the 'Edit configuration' button is too high, the 'Build new image' and 'Run image' buttons are too wide, and 'Save as template' looks too narrow in comparison

I am not sure how GTK works when it comes to formatting components, but it seems as if we need a minimum width and a maximum height for buttons, and also a minimum padding for the labels. The right button proportions are the ones in the Settings dialog (see Cancel and Save buttons in right-button-proportions.png).

Do you think we can do something about this? Thanks!
Comment 3 Belen Barros Pena 2012-09-13 11:23:45 UTC
Created attachment 792 [details]
stop-button.png
Comment 4 Belen Barros Pena 2012-09-13 11:24:12 UTC
Created attachment 793 [details]
edit-packages-buttons.png
Comment 5 Belen Barros Pena 2012-09-13 11:24:34 UTC
Created attachment 794 [details]
edit-recipes-buttons.png
Comment 6 Belen Barros Pena 2012-09-13 11:25:09 UTC
Created attachment 795 [details]
image-details-buttons.png
Comment 7 Belen Barros Pena 2012-09-13 11:25:35 UTC
Created attachment 796 [details]
right-button-proportions.png
Comment 8 Ioana Grigoropol 2012-09-18 09:49:32 UTC
I will start working on this, and keep you updated.
Comment 9 Ioana Grigoropol 2012-09-19 16:05:54 UTC
I have been investigating how to set a default minimal width and height for the buttons in the whole application.
From what I have seen, the buttons in the Settings Dialog, that we use as a reference, are created directly by the gtk, being part of a gtk.Dialog that uses the settings from the current host theme.
On the other hand, the buttons on the "Image Configuration" page, for example, are attached to an existing table with hard coded relative position to left, right, top and bottom margins of the table. 
This is the reason why the width of the progress bar that appears while parsing the recipes, and along with it, the width and height of the 'Stop' button do not comply to the host theme default dimensions.
A quick fix without modifying greatly the layout of the application, would be to determine a hard coded default width and heigth value to apply to all components, but this will not take into account the host theme dimensions.
Modifying this page to take all the corresponding sizes and paddings from the host, means determining the default gtk settings for each component and replacing all hard coded positions with relative positions that use the default components sizes and paddings from the theme.
I have not found yet a way to determine this information from gtk.settings. I will investigate this further.
Comment 10 Ioana Grigoropol 2012-09-25 09:32:24 UTC
I have sent a patch on list with the following changes:

- removed all set_size_request calls for buttons in order to:
	- force autosizing of buttons with regard to the text length
	- use host theme default height for buttons
- modified buttons on image details page to have the same height (default host one) and the width of the button with the largest text
- modified Stop button on build details page to have the default height by directly attaching it to the containing table instead of hbox

Currently the interface looks like in the attachments.
Comment 11 Ioana Grigoropol 2012-09-25 09:33:03 UTC
Created attachment 839 [details]
Updated stop button
Comment 12 Ioana Grigoropol 2012-09-25 09:33:28 UTC
Created attachment 840 [details]
Updated edit packages
Comment 13 Ioana Grigoropol 2012-09-25 09:34:01 UTC
Created attachment 841 [details]
Updated edit recipes
Comment 14 Ioana Grigoropol 2012-09-25 09:34:31 UTC
Created attachment 842 [details]
Updated image details
Comment 15 Ioana Grigoropol 2012-09-28 08:09:49 UTC
Commit : 0e1a427a2558ca09bc71b4d549c468198af7e01c
Comment 16 Belen Barros Pena 2012-09-28 11:06:07 UTC
Neat work :) Thanks!