def create_edge_setting(self): hbox = Gtk.HBox(spacing=12) left_vbox = Gtk.VBox(spacing=6) self.TopLeft = EdgeComboBox("TopLeft") left_vbox.pack_start(self.TopLeft, False, False, 0) self.BottomLeft = EdgeComboBox("BottomLeft") left_vbox.pack_end(self.BottomLeft, False, False, 0) wallpaper = get_local_path( GSetting('org.gnome.desktop.background.picture-uri').get_value()) if wallpaper: try: pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size( wallpaper, 160, 100) except GObject.GError: pixbuf = icon.get_from_name('ubuntu-tweak', size=128) else: pixbuf = icon.get_from_name('ubuntu-tweak', size=128) image = Gtk.Image.new_from_pixbuf(pixbuf) right_vbox = Gtk.VBox(spacing=6) self.TopRight = EdgeComboBox("TopRight") right_vbox.pack_start(self.TopRight, False, False, 0) self.BottomRight = EdgeComboBox("BottomRight") right_vbox.pack_end(self.BottomRight, False, False, 0) if self.is_arabic: hbox.pack_start(right_vbox, False, False, 0) hbox.pack_start(image, False, False, 0) hbox.pack_start(left_vbox, False, False, 0) else: hbox.pack_start(left_vbox, False, False, 0) hbox.pack_start(image, False, False, 0) hbox.pack_start(right_vbox, False, False, 0) for edge in ('TopLeft', 'TopRight', 'BottomLeft', 'BottomRight'): getattr(self, edge).connect('edge_changed', self.on_edge_changed) return hbox
def create_edge_setting(self): hbox = Gtk.HBox(spacing=12) left_vbox = Gtk.VBox(spacing=6) self.TopLeft = EdgeComboBox("TopLeft") left_vbox.pack_start(self.TopLeft, False, False, 0) self.BottomLeft = EdgeComboBox("BottomLeft") left_vbox.pack_end(self.BottomLeft, False, False, 0) wallpaper = get_local_path(GSetting('org.gnome.desktop.background.picture-uri').get_value()) if wallpaper: try: pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(wallpaper, 160, 100) except GObject.GError: pixbuf = icon.get_from_name('ubuntu-tweak', size=128) else: pixbuf = icon.get_from_name('ubuntu-tweak', size=128) image = Gtk.Image.new_from_pixbuf(pixbuf) right_vbox = Gtk.VBox(spacing=6) self.TopRight = EdgeComboBox("TopRight") right_vbox.pack_start(self.TopRight, False, False, 0) self.BottomRight = EdgeComboBox("BottomRight") right_vbox.pack_end(self.BottomRight, False, False, 0) if self.is_arabic: hbox.pack_start(right_vbox, False, False, 0) hbox.pack_start(image, False, False, 0) hbox.pack_start(left_vbox, False, False, 0) else: hbox.pack_start(left_vbox, False, False, 0) hbox.pack_start(image, False, False, 0) hbox.pack_start(right_vbox, False, False, 0) for edge in ('TopLeft', 'TopRight', 'BottomLeft', 'BottomRight'): getattr(self, edge).connect('edge_changed', self.on_edge_changed) return hbox
def _get_desktop_background_path(self): return get_local_path(GSetting('org.gnome.desktop.background.picture-uri').get_value())