Replace HobNotebook with gtk.Notebook
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
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
@@ -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
@@ -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
@@ -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
PATCH 2/3 lib/bb/ui/crumbs/hobwidget: use light text in HobIndicator
In reply to Joshua LockDark 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
@@ -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
PATCH 3/3 lib/bb/ui/crumbs/imageconfiguration: fix combo boxes drop-down width
In reply to Joshua LockThe 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
@@ -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
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=465I'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,
JoshuaThe 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/bitbakejosh/hob
https://github.com/incandescant/bitbake/tree/josh/hobJoshua Lock (3):
lib/bb/ui/crumbs/: replace custom HobNotebooklib/bb/ui/crumbs/hobwidget: use light text in HobIndicatorlib/bb/ui/crumbs/imageconfiguration: fix combo boxes drop-down widthlib/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