hob: Buttons width and height are taken for host
PATCH v2 1/1 hob: Buttons width and height are taken for host
- 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
--- bitbake/lib/bb/ui/crumbs/builddetailspage.py | 10 +- bitbake/lib/bb/ui/crumbs/hig.py | 2 +- bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | 15 +-- bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 101 ++++++++++++++++---- bitbake/lib/bb/ui/crumbs/packageselectionpage.py | 2 +- bitbake/lib/bb/ui/crumbs/recipeselectionpage.py | 2 +- 6 files changed, 101 insertions(+), 31 deletions(-)
bitbake/lib/bb/ui/crumbs/builddetailspage.py +5 -5
@@ -206,7 +206,7 @@ class BuildDetailsPage (HobPage): color = HobColors.ERROR build_fail_top = gtk.EventBox() - build_fail_top.set_size_request(-1, 200) + #build_fail_top.set_size_request(-1, 200) build_fail_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) build_fail_tab = gtk.Table(14, 46, True)
@@ -229,7 +229,7 @@ class BuildDetailsPage (HobPage): # create button 'Edit packages' action_button = HobButton(primary_action) - action_button.set_size_request(-1, 40) + #action_button.set_size_request(-1, 40) action_button.set_tooltip_text("Edit the %s parameters" % actions) action_button.connect('clicked', self.failure_primary_action_button_clicked_cb, primary_action) build_fail_tab.attach(action_button, 4, 13, 9, 12)
@@ -269,7 +269,7 @@ class BuildDetailsPage (HobPage): def add_build_stop_top_bar(self, action, log_file=None): color = HobColors.LIGHT_GRAY build_stop_top = gtk.EventBox() - build_stop_top.set_size_request(-1, 200) + #build_stop_top.set_size_request(-1, 200) build_stop_top.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) build_stop_top.set_flags(gtk.CAN_DEFAULT) build_stop_top.grab_default()
@@ -288,7 +288,7 @@ class BuildDetailsPage (HobPage): build_stop_tab.attach(label, 4, 26, 0, 6) action_button = HobButton("Edit %s" % action) - action_button.set_size_request(-1, 40) + #action_button.set_size_request(-1, 40) action_button.set_tooltip_text("Edit the %s parameters" % action) action_button.connect('clicked', self.stop_primary_action_button_clicked_cb, action) build_stop_tab.attach(action_button, 4, 13, 6, 9)
@@ -302,7 +302,7 @@ class BuildDetailsPage (HobPage): attach_pos = (24 if log_file else 14) build_button = HobAltButton("Build new image") - build_button.set_size_request(-1, 40) + #build_button.set_size_request(-1, 40) build_button.set_tooltip_text("Create a new image from scratch") build_button.connect('clicked', self.new_image_button_clicked_cb) build_stop_tab.attach(build_button, attach_pos, attach_pos + 9, 6, 9)
bitbake/lib/bb/ui/crumbs/hig.py +1 -1
@@ -902,7 +902,7 @@ class DeployImageDialog (CrumbsDialog): icon.set_from_pixbuf(pix_buffer) button = gtk.Button("Select Image") button.set_image(icon) - button.set_size_request(140, 50) + #button.set_size_request(140, 50) table.attach(button, 9, 10, 1, 2, gtk.FILL, 0, 0, 0) button.connect("clicked", self.select_image_button_clicked_cb)
bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +8 -7
@@ -167,13 +167,12 @@ class ImageConfigurationPage (HobPage): markup += "dev-manual.html#understanding-and-using-layers\">reference manual</a>." self.layer_info_icon = HobInfoButton(markup, self.get_parent()) - self.progress_box = gtk.HBox(False, 6) +# self.progress_box = gtk.HBox(False, 6) self.progress_bar = HobProgressBar() - self.progress_box.pack_start(self.progress_bar, expand=True, fill=True) +# self.progress_box.pack_start(self.progress_bar, expand=True, fill=True) self.stop_button = HobAltButton("Stop") self.stop_button.connect("clicked", self.stop_button_clicked_cb) - self.progress_box.pack_end(self.stop_button, expand=False, fill=False) - +# self.progress_box.pack_end(stop_button, expand=False, fill=False) self.machine_separator = gtk.HSeparator() def set_config_machine_layout(self, show_progress_bar = False):
@@ -183,7 +182,9 @@ class ImageConfigurationPage (HobPage): self.gtable.attach(self.layer_button, 14, 36, 7, 12) self.gtable.attach(self.layer_info_icon, 36, 40, 7, 11) if show_progress_bar: - self.gtable.attach(self.progress_box, 0, 40, 15, 19) + #self.gtable.attach(self.progress_box, 0, 40, 15, 18) + self.gtable.attach(self.progress_bar, 0, 37, 15, 18) + self.gtable.attach(self.stop_button, 37, 40, 15, 18, 0, 0) self.gtable.attach(self.machine_separator, 0, 40, 13, 14) def create_config_baseimg(self):
@@ -232,14 +233,14 @@ class ImageConfigurationPage (HobPage): # create button "Build image" self.just_bake_button = HobButton("Build image") - self.just_bake_button.set_size_request(205, 49) + #self.just_bake_button.set_size_request(205, 49) self.just_bake_button.set_tooltip_text("Build target image") self.just_bake_button.connect("clicked", self.just_bake_button_clicked_cb) button_box.pack_end(self.just_bake_button, expand=False, fill=False) # create button "Edit Image" self.edit_image_button = HobAltButton("Edit image") - self.edit_image_button.set_size_request(205, 49) + #self.edit_image_button.set_size_request(205, 49) self.edit_image_button.set_tooltip_text("Edit target image") self.edit_image_button.connect("clicked", self.edit_image_button_clicked_cb) button_box.pack_end(self.edit_image_button, expand=False, fill=False)
bitbake/lib/bb/ui/crumbs/imagedetailspage.py +85 -16
163 lines not on this page · raw message
bitbake/lib/bb/ui/crumbs/packageselectionpage.py +1 -1
@@ -146,7 +146,7 @@ class PackageSelectionPage (HobPage): self.box_group_area.pack_start(self.button_box, expand=False, fill=False) self.build_image_button = HobButton('Build image') - self.build_image_button.set_size_request(205, 49) + #self.build_image_button.set_size_request(205, 49) self.build_image_button.set_tooltip_text("Build target image") self.build_image_button.set_flags(gtk.CAN_DEFAULT) self.build_image_button.grab_default()
bitbake/lib/bb/ui/crumbs/recipeselectionpage.py +1 -1
@@ -170,7 +170,7 @@ class RecipeSelectionPage (HobPage): self.box_group_area.pack_end(button_box, expand=False, fill=False) self.build_packages_button = HobButton('Build packages') - self.build_packages_button.set_size_request(205, 49) + #self.build_packages_button.set_size_request(205, 49) self.build_packages_button.set_tooltip_text("Build selected recipes into packages") self.build_packages_button.set_flags(gtk.CAN_DEFAULT) self.build_packages_button.grab_default()
Signature · 1 line
1.7.9.5
Richard Purdie
AppliedQuoted 7 lines · Ioana Grigoropol
- removed all
set_size_requestcalls 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 hboxSigned-off-by Ioana Grigoropol <[email protected]>
Quoted 8 lines
--- bitbake/lib/bb/ui/crumbs/builddetailspage.py | 10 +- bitbake/lib/bb/ui/crumbs/hig.py | 2 +- bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | 15 +-- bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 101 ++++++++++++++++---- bitbake/lib/bb/ui/crumbs/packageselectionpage.py | 2 +- bitbake/lib/bb/ui/crumbs/recipeselectionpage.py | 2 +- 6 files changed, 101 insertions(+), 31 deletions(-)
Merged to master, thanks.
Richard