Skip to contentSkip to conversation

Replace HobNotebook with gtk.Notebook

RFC PATCH In review Joshua Lock 1 participant 5 messages Apr 13, 2012

lore
Share & tools
lore
#0 lore raw

cover Replace HobNotebook with gtk.Notebook

The important patch in this RFC is the first which replaces the fully custom HobNotebook with a simpler gtk.Notebook subclass.

It's an RFC as there's currently what looks like a rendering glitch in how the tabs are displayed. See the white boxes in the tabs of this screenshot:
https://bugzilla.yoctoproject.org/attachment.cgi?id=465

I'm researching how to remove this artifact but wanted to gather feedback on the patch as it stands as we are close to the checkin deadline.

Thanks,
Joshua

The following changes since commit 3c2808b67384e92601cbd66877c36ca40df7c7ba:

Hob: fix the missing functions (2012-04-12 15:56:42 +0100)

are available in the git repository at:
git://github.com/incandescant/bitbake josh/hob
https://github.com/incandescant/bitbake/tree/josh/hob

Joshua Lock (3):
lib/bb/ui/crumbs/: replace custom HobNotebook lib/bb/ui/crumbs/hobwidget: use light text in HobIndicator lib/bb/ui/crumbs/imageconfiguration: fix combo boxes drop-down width

 lib/bb/ui/crumbs/builddetailspage.py       |    4 +-
 lib/bb/ui/crumbs/hobwidget.py              |  468 +++++-----------------------
 lib/bb/ui/crumbs/imageconfigurationpage.py |    2 -
 lib/bb/ui/crumbs/packageselectionpage.py   |    3 +-
 lib/bb/ui/crumbs/recipeselectionpage.py    |    5 +-
 5 files changed, 82 insertions(+), 400 deletions(-)
Signature · 1 line
1.7.7.6
#1 lore raw

PATCH 1/3 lib/bb/ui/crumbs/: replace custom HobNotebook

The custom HobNotebook widget was implemented to address perceived deficiencies in the gtk.Notebook API.

Recent inspection reveals that the API is capable of all that Hob requires of it and therefore maintaining a custom class to provide similar functionality does not make sense.

Addresses [YOCTO #2276]

---
 lib/bb/ui/crumbs/builddetailspage.py     |    4 +-
 lib/bb/ui/crumbs/hobwidget.py            |  468 +++++-------------------------
 lib/bb/ui/crumbs/packageselectionpage.py |    3 +-
 lib/bb/ui/crumbs/recipeselectionpage.py  |    5 +-
 4 files changed, 82 insertions(+), 398 deletions(-)
lib/bb/ui/crumbs/builddetailspage.py +2 -2
index 23aaacd..3c164ac 100755
@@ -152,14 +152,14 @@ class BuildDetailsPage (HobPage):
         self.scrolled_view_failure = gtk.ScrolledWindow ()
         self.scrolled_view_failure.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS)
         self.scrolled_view_failure.add(self.failure_tv)
-        self.notebook.append_page(self.scrolled_view_failure, gtk.Label("Issues"))
+        self.notebook.append_page(self.scrolled_view_failure, "Issues")
 
         self.build_tv = RunningBuildTreeView(readonly=True, hob=True)
         self.build_tv.set_model(self.builder.handler.build.model)
         self.scrolled_view_build = gtk.ScrolledWindow ()
         self.scrolled_view_build.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS)
         self.scrolled_view_build.add(self.build_tv)
-        self.notebook.append_page(self.scrolled_view_build, gtk.Label("Log"))
+        self.notebook.append_page(self.scrolled_view_build, "Log")
 
         self.builder.handler.build.model.connect_after("row-changed", self.scroll_to_present_row, self.scrolled_view_build.get_vadjustment(), self.build_tv)
 
lib/bb/ui/crumbs/hobwidget.py +78 -390

500 lines not on this page · raw message

lib/bb/ui/crumbs/packageselectionpage.py +1 -2
index 104d49d..9e6f10a 100755
@@ -120,8 +120,7 @@ class PackageSelectionPage (HobPage):
             if page['name'] == "Included":
                 tab.connect("button-release-event", self.button_click_cb)
                 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
-            label = gtk.Label(page['name'])
-            self.ins.append_page(tab, label)
+            self.ins.append_page(tab, page['name'])
             self.tables.append(tab)
 
         self.ins.set_entry("Search packages:")
lib/bb/ui/crumbs/recipeselectionpage.py +1 -4
index 6ecc796..fff8a88 100755
@@ -153,10 +153,7 @@ class RecipeSelectionPage (HobPage):
             if page['name'] == "Included":
                 tab.connect("button-release-event", self.button_click_cb)
                 tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
-            label = gtk.Label(page['name'])
-            label.set_selectable(False)
-            label.set_tooltip_text(page['tooltip'])
-            self.ins.append_page(tab, label)
+            self.ins.append_page(tab, page['name'], page['tooltip'])
             self.tables.append(tab)
 
         self.ins.set_entry("Search recipes:")
Signature · 1 line
1.7.7.6
#2 lore raw

PATCH 2/3 lib/bb/ui/crumbs/hobwidget: use light text in HobIndicator

In reply to Joshua Lock

Dark text on a dark background is difficult to read. Further the design document uses white text.

---
 lib/bb/ui/crumbs/hobwidget.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/bb/ui/crumbs/hobwidget.py +1 -1
index a3994c0..9beb4e6 100644
@@ -406,7 +406,7 @@ class HobIndicator(gtk.DrawingArea):
             x = (w/2)-(textw/2) + 1
             y = (h/2) - (texth/2) + 1
             ctx.move_to(x, y)
-            self.window.draw_layout(self.style.fg_gc[gtk.STATE_NORMAL], int(x), int(y), layout)
+            self.window.draw_layout(self.style.light_gc[gtk.STATE_NORMAL], int(x), int(y), layout)
 
     def set_count(self, count):
         self.count = count
Signature · 1 line
1.7.7.6
#3 lore raw

PATCH 3/3 lib/bb/ui/crumbs/imageconfiguration: fix combo boxes drop-down width

In reply to Joshua Lock

The width of the combo boxes drop down should match the combo box itself.

---
 lib/bb/ui/crumbs/imageconfigurationpage.py |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
lib/bb/ui/crumbs/imageconfigurationpage.py +0 -2
index 64c512d..3e38ff4 100644
@@ -147,7 +147,6 @@ class ImageConfigurationPage (HobPage):
         self.machine_title_desc.set_markup(mark)
 
         self.machine_combo = gtk.combo_box_new_text()
-        self.machine_combo.set_wrap_width(1)
         self.machine_combo.connect("changed", self.machine_combo_changed_cb)
 
         icon_file = hic.ICON_LAYERS_DISPLAY_FILE
@@ -196,7 +195,6 @@ class ImageConfigurationPage (HobPage):
         self.image_title_desc.set_markup(mark)
 
         self.image_combo = gtk.combo_box_new_text()
-        self.image_combo.set_wrap_width(1)
         self.image_combo_id = self.image_combo.connect("changed", self.image_combo_changed_cb)
 
         self.image_desc = gtk.Label()
Signature · 1 line
1.7.7.6
#4 lore raw
In reply to Joshua Lock

I've figured out how to composite things so the artefact is gone. Updated patchset shortly!

Thanks,
Joshua

Quoted 33 lines · Joshua Lock

The important patch in this RFC is the first which replaces the fully custom HobNotebook with a simpler gtk.Notebook subclass.

It's an RFC as there's currently what looks like a rendering glitch in how the tabs are displayed. See the white boxes in the tabs of this screenshot:
https://bugzilla.yoctoproject.org/attachment.cgi?id=465

I'm researching how to remove this artifact but wanted to gather feedback on the patch as it stands as we are close to the checkin deadline.

Thanks,
Joshua

The following changes since commit 3c2808b67384e92601cbd66877c36ca40df7c7ba:

Hob: fix the missing functions (2012-04-12 15:56:42 +0100)

are available in the git repository at:
git://github.com/incandescant/bitbake josh/hob
https://github.com/incandescant/bitbake/tree/josh/hob

Joshua Lock (3):
lib/bb/ui/crumbs/: replace custom HobNotebook lib/bb/ui/crumbs/hobwidget: use light text in HobIndicator lib/bb/ui/crumbs/imageconfiguration: fix combo boxes drop-down width

  lib/bb/ui/crumbs/builddetailspage.py       |    4 +-
  lib/bb/ui/crumbs/hobwidget.py              |  468 +++++-----------------------
  lib/bb/ui/crumbs/imageconfigurationpage.py |    2 -
  lib/bb/ui/crumbs/packageselectionpage.py   |    3 +-
  lib/bb/ui/crumbs/recipeselectionpage.py    |    5 +-
  5 files changed, 82 insertions(+), 400 deletions(-)
Signature · 3 lines
Joshua Lock
        Yocto Project
        Intel Open Source Technology Centre