Skip to content
This repository

[Code cleanup] Don't use Gtk.VBox/HBox #1226

Closed
wants to merge 1 commit into from

2 participants

dalcde glebihan
dalcde
Collaborator

Gtk.VBox and Gtk.HBox are deprecated

glebihan
Collaborator

Could you, in order to make the code easier to read, pass the Gtk.Orientation.HORIZONTAL parameter to Gtk.Box as you do for Gtk.Orientation.VERTICAL ?

dalcde dalcde closed this December 05, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 22, 2012
dalcde Don't use Gtk.VBox/HBox f6c14e7
This page is out of date. Refresh to see the latest.
47  files/usr/lib/cinnamon-settings/cinnamon-settings.py
@@ -271,7 +271,7 @@ def build(self):
271 271
             self.content_box.pack_start(widget, False, False, 2)            
272 272
         self.content_box.show_all()
273 273
 
274  
-class GConfComboBox(Gtk.HBox):    
  274
+class GConfComboBox(Gtk.Box):    
275 275
     def __init__(self, label, key, options, init_value = ""):  
276 276
         self.key = key
277 277
         super(GConfComboBox, self).__init__()
@@ -482,9 +482,9 @@ def _do_load(self):
482 482
         self._loading = False
483 483
         self._loading_lock.release()                 
484 484
 
485  
-class BackgroundWallpaperPane (Gtk.VBox):
  485
+class BackgroundWallpaperPane (Gtk.Box):
486 486
     def __init__(self, sidepage, gnome_background_schema):
487  
-        Gtk.VBox.__init__(self)
  487
+        Gtk.Box.__init__(self, Gtk.Orientation.VERTICAL)
488 488
         self.set_spacing(5)
489 489
         
490 490
         self._gnome_background_schema = gnome_background_schema
@@ -727,7 +727,7 @@ def build(self):
727 727
         for widget in widgets:
728 728
             self.content_box.remove(widget)
729 729
         
730  
-        topbox = Gtk.HBox()
  730
+        topbox = Gtk.Box()
731 731
         self.content_box.pack_start(topbox, False, False, 0)
732 732
         topbox.set_spacing(5)
733 733
         
@@ -774,7 +774,7 @@ def build(self):
774 774
         scrolled_window.add_with_viewport(expander)
775 775
         self.content_box.pack_start(scrolled_window, False, True, 0)
776 776
         
777  
-        advanced_options_box = Gtk.HBox()
  777
+        advanced_options_box = Gtk.Box()
778 778
         expander.add(advanced_options_box)
779 779
         advanced_options_box.set_spacing(10)
780 780
         
@@ -790,7 +790,7 @@ def build(self):
790 790
         self.color_shading_type = GSettingsComboBox("", "org.gnome.desktop.background", "color-shading-type", None, BACKGROUND_COLOR_SHADING_TYPES)
791 791
         advanced_options_box.pack_start(self.color_shading_type, False, False, 0)
792 792
         
793  
-        hbox = Gtk.HBox()
  793
+        hbox = Gtk.Box()
794 794
         l = Gtk.Label(_("Colors"))
795 795
         hbox.pack_start(l, False, False, 2)
796 796
         self.primary_color = GSettingsColorChooser("org.gnome.desktop.background", "primary-color", None)
@@ -838,7 +838,7 @@ def build(self):
838 838
         # Add our own widgets
839 839
         notebook = Gtk.Notebook()
840 840
         
841  
-        cinnamon_theme_vbox = Gtk.VBox()
  841
+        cinnamon_theme_vbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
842 842
         
843 843
         scrolledWindow = Gtk.ScrolledWindow()   
844 844
         cinnamon_theme_vbox.pack_start(scrolledWindow, True, True, 2)
@@ -871,7 +871,7 @@ def build(self):
871 871
         notebook.append_page(cinnamon_theme_vbox, Gtk.Label(_("Cinnamon themes")))
872 872
         
873 873
         scrolledWindow = Gtk.ScrolledWindow()
874  
-        other_settings_box = Gtk.VBox()
  874
+        other_settings_box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
875 875
         scrolledWindow.add_with_viewport(other_settings_box)
876 876
         other_settings_box.set_border_width(5)
877 877
         
@@ -1933,7 +1933,7 @@ def __init__(self, label):
1933 1933
     def on_my_value_changed(self, widget):
1934 1934
         self.date_time_wrapper.set_using_ntp(self.get_active())
1935 1935
 
1936  
-class GSettingsSpinButton(Gtk.HBox):    
  1936
+class GSettingsSpinButton(Gtk.Box):    
1937 1937
     def __init__(self, label, schema, key, dep_key, min, max, step, page, units):
1938 1938
         self.key = key
1939 1939
         self.dep_key = dep_key
@@ -1977,7 +1977,7 @@ def on_dependency_setting_changed(self, settings, dep_key):
1977 1977
         else:
1978 1978
             self.set_sensitive(not self.dep_settings.get_boolean(self.dep_key))
1979 1979
 
1980  
-class GSettingsEntry(Gtk.HBox):    
  1980
+class GSettingsEntry(Gtk.Box):    
1981 1981
     def __init__(self, label, schema, key, dep_key):
1982 1982
         self.key = key
1983 1983
         self.dep_key = dep_key
@@ -2014,8 +2014,7 @@ def on_dependency_setting_changed(self, settings, dep_key):
2014 2014
         else:
2015 2015
             self.set_sensitive(not self.dep_settings.get_boolean(self.dep_key))
2016 2016
 
2017  
-
2018  
-class GSettingsFileChooser(Gtk.HBox):
  2017
+class GSettingsFileChooser(Gtk.Box):
2019 2018
     def __init__(self, label, schema, key, dep_key, show_none_cb = False):
2020 2019
         self.key = key
2021 2020
         self.dep_key = dep_key
@@ -2067,7 +2066,7 @@ def on_dependency_setting_changed(self, settings, dep_key):
2067 2066
         else:
2068 2067
             self.set_sensitive(not self.dep_settings.get_boolean(self.dep_key))
2069 2068
 
2070  
-class GSettingsFontButton(Gtk.HBox):
  2069
+class GSettingsFontButton(Gtk.Box):
2071 2070
     def __init__(self, label, schema, key, dep_key):
2072 2071
         self.key = key
2073 2072
         self.dep_key = dep_key
@@ -2105,7 +2104,7 @@ def on_dependency_setting_changed(self, settings, dep_key):
2105 2104
         else:
2106 2105
             self.set_sensitive(not self.dep_settings.get_boolean(self.dep_key))
2107 2106
 
2108  
-class GConfFontButton(Gtk.HBox):
  2107
+class GConfFontButton(Gtk.Box):
2109 2108
     def __init__(self, label, key):
2110 2109
         self.key = key
2111 2110
         super(GConfFontButton, self).__init__()
@@ -2125,7 +2124,7 @@ def __init__(self, label, key):
2125 2124
     def on_my_value_changed(self, widget):
2126 2125
         self.settings.set_string(self.key, widget.get_font_name())
2127 2126
 
2128  
-class GSettingsRange(Gtk.HBox):
  2127
+class GSettingsRange(Gtk.Box):
2129 2128
     def __init__(self, label, schema, key, dep_key, **options):
2130 2129
         self.key = key
2131 2130
         self.dep_key = dep_key
@@ -2165,7 +2164,7 @@ def on_dependency_setting_changed(self, settings, dep_key):
2165 2164
         else:
2166 2165
             self.set_sensitive(not self.dep_settings.get_boolean(self.dep_key))
2167 2166
 
2168  
-class GSettingsRangeSpin(Gtk.HBox):
  2167
+class GSettingsRangeSpin(Gtk.Box):
2169 2168
     def __init__(self, label, schema, key, dep_key, **options):
2170 2169
         self.key = key
2171 2170
         self.dep_key = dep_key
@@ -2213,7 +2212,7 @@ def on_dependency_setting_changed(self, settings, dep_key):
2213 2212
         else:
2214 2213
             self.set_sensitive(not self.dep_settings.get_boolean(self.dep_key))
2215 2214
 
2216  
-class GSettingsComboBox(Gtk.HBox):    
  2215
+class GSettingsComboBox(Gtk.Box):    
2217 2216
     def __init__(self, label, schema, key, dep_key, options):
2218 2217
         self.key = key
2219 2218
         self.dep_key = dep_key
@@ -2268,7 +2267,7 @@ def on_dependency_setting_changed(self, settings, dep_key):
2268 2267
         else:
2269 2268
             self.set_sensitive(not self.dep_settings.get_boolean(self.dep_key))
2270 2269
 
2271  
-class TimeZoneSelectorWidget(Gtk.HBox):
  2270
+class TimeZoneSelectorWidget(Gtk.Box):
2272 2271
     def __init__(self):
2273 2272
         super(TimeZoneSelectorWidget, self).__init__()
2274 2273
         
@@ -2348,7 +2347,7 @@ def get_selected_zone(self):
2348 2347
         else:
2349 2348
             return "", ""
2350 2349
             
2351  
-class ChangeTimeWidget(Gtk.HBox):
  2350
+class ChangeTimeWidget(Gtk.Box):
2352 2351
     def __init__(self):
2353 2352
         super(ChangeTimeWidget, self).__init__()
2354 2353
         self.date_time_wrapper = DateTimeWrapper()
@@ -2365,8 +2364,8 @@ def __init__(self):
2365 2364
         months = ['January','February','March','April','May','June','July','August','September','October','November','December']
2366 2365
         
2367 2366
         # Boxes
2368  
-        timeBox = Gtk.HBox()
2369  
-        dateBox = Gtk.HBox()
  2367
+        timeBox = Gtk.Box()
  2368
+        dateBox = Gtk.Box()
2370 2369
         
2371 2370
         # Combo Boxes
2372 2371
         self.monthBox = Gtk.ComboBoxText()
@@ -2531,13 +2530,13 @@ def __init__(self):
2531 2530
         label = Gtk.Label(_("Left side title bar buttons"))
2532 2531
         label.set_alignment(0, 0.5)
2533 2532
         self.attach(label, 0, 1, 0, 1, xoptions = Gtk.AttachOptions.FILL, yoptions=0, xpadding=2)
2534  
-        left_side_box = Gtk.HBox()
  2533
+        left_side_box = Gtk.Box()
2535 2534
         self.attach(left_side_box, 1, 2, 0, 1, yoptions=0, xpadding=2)
2536 2535
         
2537 2536
         label = Gtk.Label(_("Right side title bar buttons"))
2538 2537
         label.set_alignment(0, 0.5)
2539 2538
         self.attach(label, 0, 1, 1, 2, xoptions = Gtk.AttachOptions.FILL, yoptions=0, xpadding=2)
2540  
-        right_side_box = Gtk.HBox()
  2539
+        right_side_box = Gtk.Box()
2541 2540
         self.attach(right_side_box, 1, 2, 1, 2, yoptions=0, xpadding=2)
2542 2541
         
2543 2542
         self.left_side_widgets = []
@@ -2603,7 +2602,7 @@ def on_my_value_changed(self, widget):
2603 2602
         self.settings.set_string(self.key, ','.join(str(item) for item in left_items) + ':' + ','.join(str(item) for item in right_items))
2604 2603
 
2605 2604
 
2606  
-class IndentedHBox(Gtk.HBox):
  2605
+class IndentedHBox(Gtk.Box):
2607 2606
     def __init__(self):
2608 2607
         super(IndentedHBox, self).__init__()
2609 2608
         indent = Gtk.Label('\t')
6  files/usr/lib/cinnamon-settings/cinnamon-settings.ui
@@ -49,9 +49,10 @@
49 49
           </packing>
50 50
         </child>
51 51
         <child>
52  
-          <object class="GtkVBox" id="vbox1">
  52
+          <object class="GtkBox" id="vbox1">
53 53
             <property name="visible">True</property>
54 54
             <property name="can_focus">False</property>
  55
+            <property name="orientation">vertical</property>
55 56
             <child>
56 57
               <object class="GtkScrolledWindow" id="side_view_sw">
57 58
                 <property name="height_request">125</property>
@@ -87,10 +88,11 @@
87 88
                     <property name="visible">True</property>
88 89
                     <property name="can_focus">False</property>
89 90
                     <child>
90  
-                      <object class="GtkVBox" id="content_box">
  91
+                      <object class="GtkBox" id="content_box">
91 92
                         <property name="visible">True</property>
92 93
                         <property name="can_focus">False</property>
93 94
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
  95
+                        <property name="orientation">vertical</property>
94 96
                         <property name="hexpand">True</property>
95 97
                         <property name="vexpand">True</property>
96 98
                         <property name="border_width">6</property>
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.