[gnome-boxes] Break out code to helper draw_as_css_box



commit 7f4674d375074094f14bf95e8d1d961c2bf01ef1
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Jun 21 19:53:27 2012 +0200

    Break out code to helper draw_as_css_box
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678569

 src/util.vala          |   15 +++++++++++++++
 src/wizard-source.vala |   13 +------------
 2 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/src/util.vala b/src/util.vala
index 2060905..b75f970 100644
--- a/src/util.vala
+++ b/src/util.vala
@@ -544,4 +544,19 @@ namespace Boxes {
                                          rowstride,
                                          null);
     }
+
+    public void draw_as_css_box (Widget widget) {
+        widget.draw.connect ((cr) => {
+            var context = widget.get_style_context ();
+            Gtk.Allocation allocation;
+            widget.get_allocation (out allocation);
+            context.render_background (cr,
+                                       0, 0,
+                                       allocation.width, allocation.height);
+            context.render_frame (cr,
+                                  0, 0,
+                                  allocation.width, allocation.height);
+            return false;
+         });
+    }
 }
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index 01a95fb..860e399 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -263,18 +263,7 @@ private class Boxes.WizardSource: GLib.Object {
             row = button;
         } else {
             var bin = new Gtk.Alignment (0,0,1,1);
-            bin.draw.connect ((cr) => {
-                var context = bin.get_style_context ();
-                Gtk.Allocation allocation;
-                bin.get_allocation (out allocation);
-                context.render_background (cr,
-                                           0, 0,
-                                           allocation.width, allocation.height);
-                context.render_frame (cr,
-                                      0, 0,
-                                      allocation.width, allocation.height);
-                return false;
-            });
+			draw_as_css_box (bin);
             row = bin;
         }
         var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 20);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]