Skip to contentSkip to conversation

Hob: bug-fixes

PATCH Applied Liming An 2 participants 4 messages May 30, 2012

lore
Share & tools
lore

Liming An

author
#0 lore raw

cover Hob: bug-fixes

The following changes since commit 0299499770e33e0214146132799f8779e81e581d:

ccache: Separate out into its own class (2012-05-30 12:04:49 +0100)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib limx/hob-bug-fixes-continue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=limx/hob-bug-fixes-continue

Liming An (2):
Hob: Fixed a compatible issue for indicator icon view
Hob: add the 'build new' be as the primary action for 'Image detail'
page

 bitbake/lib/bb/ui/crumbs/hobwidget.py        |   51 ++++----------------------
 bitbake/lib/bb/ui/crumbs/imagedetailspage.py |   19 ++++------
 2 files changed, 16 insertions(+), 54 deletions(-)
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 1/2 Hob: Fixed a compatible issue for indicator icon view

Because some screen not support the alpha visual channel, so the function 'screen.get_rgba_colormap()' will return None, it's a compatible issue, so change it by another way.

---
 bitbake/lib/bb/ui/crumbs/hobwidget.py |   51 +++++---------------------------
 1 files changed, 8 insertions(+), 43 deletions(-)
bitbake/lib/bb/ui/crumbs/hobwidget.py +8 -43
index f8e97ad..bd9e2e2 100644
@@ -400,50 +400,33 @@ class HobInfoButton(gtk.EventBox):
 class HobIndicator(gtk.DrawingArea):
     def __init__(self, count):
         gtk.DrawingArea.__init__(self)
-
-        # We want to composite the transparent indicator onto the parent
-        # HBox
-        screen = self.get_screen()
-        rgba = screen.get_rgba_colormap()
-        self.set_colormap(rgba)
-        self.set_app_paintable(True)
+        # Set no window for transparent background
+        self.set_has_window(False)
         self.set_size_request(38,38)
         # We need to pass through button clicks
         self.add_events(gtk.gdk.BUTTON_PRESS_MASK | gtk.gdk.BUTTON_RELEASE_MASK)
 
         self.connect('expose-event', self.expose)
-        self.connect_after('realize', self.composite)
 
         self.count = count
         self.color = HobColors.GRAY
 
-    def composite(self, widget):
-        # This property must be set after the widget has been realised
-        self.window.set_composited(True)
-
     def expose(self, widget, event):
-        # Transparent background
-        ctx = widget.window.cairo_create()
-        ctx.set_operator(cairo.OPERATOR_CLEAR)
-        region = gtk.gdk.region_rectangle(event.area)
-
-        ctx.region(region)
-        ctx.fill()
-
         if self.count and self.count > 0:
-            w = self.allocation.width
-            h = self.allocation.height
+            ctx = widget.window.cairo_create()
+
+            x, y, w, h = self.allocation
 
             ctx.set_operator(cairo.OPERATOR_OVER)
             ctx.set_source_color(gtk.gdk.color_parse(self.color))
             ctx.translate(w/2, h/2)
-            ctx.arc(1, 1, min(w,h)/2 - 2, 0, 2*math.pi)
+            ctx.arc(x, y, min(w,h)/2 - 2, 0, 2*math.pi)
             ctx.fill_preserve()
 
             layout = self.create_pango_layout(str(self.count))
             textw, texth = layout.get_pixel_size()
-            x = (w/2)-(textw/2) + 1
-            y = (h/2) - (texth/2) + 1
+            x = (w/2)-(textw/2) + x
+            y = (h/2) - (texth/2) + y
             ctx.move_to(x, y)
             self.window.draw_layout(self.style.light_gc[gtk.STATE_NORMAL], int(x), int(y), layout)
 
@@ -466,24 +449,6 @@ class HobTabLabel(gtk.HBox):
         self.lbl.set_alignment(0.0, 0.5)
         self.lbl.show()
         self.pack_end(self.lbl, True, True, 6)
-        self.connect_after('expose-event', self.expose_event)
-
-    def expose_event(self, widget, event):
-        # Composite the child indicator onto the Box
-        child = self.indicator
-        ctx = widget.window.cairo_create()
-
-        ctx.set_source_pixmap(child.window, child.allocation.x, child.allocation.y)
-
-        region = gtk.gdk.region_rectangle(child.allocation)
-        r = gtk.gdk.region_rectangle(event.area)
-        region.intersect(r)
-        ctx.region(region)
-        ctx.clip()
-
-        ctx.paint()
-
-        return False
 
     def set_count(self, count):
         self.indicator.set_count(count)
Signature · 1 line
1.7.5.4
author
#2 lore raw

PATCH 2/2 Hob: add the 'build new' be as the primary action for 'Image detail' page

As ui design, we should set at least one primary action for 'My Image' and 'Image detail' screen as the differnt selected image. if no 'run image' or no 'save as template' or no 'deploy image' we should set 'build new image'

[YOCTO #2326]

---
 bitbake/lib/bb/ui/crumbs/imagedetailspage.py |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)
bitbake/lib/bb/ui/crumbs/imagedetailspage.py +8 -11
index 9d57dc0..deb053c 100755
@@ -431,23 +431,20 @@ class ImageDetailsPage (HobPage):
             self.details_bottom_buttons.pack_end(save_button, expand=False, fill=False)
             create = True
 
-        if not packed:
-            box = gtk.HBox(False, 6)
-            box.show()
-            subbox = gtk.HBox(False, 0)
-            subbox.set_size_request(205, 49)
-            subbox.show()
-            box.add(subbox)
-            self.details_bottom_buttons.pack_end(box, False, False)
-
         name = "Build new image"
         if name in buttonlist:
             # create button "Build new image"
-            build_new_button = HobAltButton("Build new image")
+            if packed:
+                build_new_button = HobAltButton("Build new image")
+                self.details_bottom_buttons.pack_start(build_new_button, expand=False, fill=False)
+            else:
+                build_new_button = HobButton("Build new image")
+                build_new_button.set_size_request(205, 49)
+                build_new_button.set_flags(gtk.CAN_DEFAULT)
+                self.details_bottom_buttons.pack_end(build_new_button, expand=False, fill=False)
             build_new_button.set_tooltip_text("Create a new image from scratch")
             button_id = build_new_button.connect("clicked", self.build_new_button_clicked_cb)
             self.button_ids[button_id] = build_new_button
-            self.details_bottom_buttons.pack_start(build_new_button, expand=False, fill=False)
 
     def get_kernel_file_name(self, image_name):
         name_list = []
Signature · 1 line
1.7.5.4
#3 lore raw
In reply to Liming An
Quoted 4 lines · Liming An

The following changes since commit 0299499770e33e0214146132799f8779e81e581d:

ccache: Separate out into its own class (2012-05-30 12:04:49 +0100)

Quoted 8 lines

are available in the git repository at:
git://git.pokylinux.org/poky-contrib limx/hob-bug-fixes-continue
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=limx/hob-bug-fixes-continue

Liming An (2):
Hob: Fixed a compatible issue for indicator icon view
Hob: add the 'build new' be as the primary action for 'Image detail'
page

Merged to master, thanks.

Richard