Commits

Steve Borho  committed 6cad7c7

thgconfig: move description frame to the right of options

  • Participants
  • Parent commits 82dbf1e

Comments (0)

Files changed (1)

File hggtk/thgconfig.py

                 self.response(gtk.RESPONSE_CANCEL)
 
         # Catch close events
+        self.set_default_size(700, 300)
         self.connect('delete-event', self._delete)
         self.connect('response', self._response)
 
         self.show_tabs = True
         self.show_border = True
 
-        descframe = gtk.Frame('Description')
-        vbox = gtk.VBox()
-        self.desctext = gtk.TextView()
-        self.desctext.set_wrap_mode(gtk.WRAP_WORD)
-        self.desctext.set_editable(False)
-        vbox.pack_start(self.desctext, False, False)
-        vbox.set_border_width(10)
-        descframe.add(vbox)
-        self.vbox.pack_start(descframe, True, True)
-
         self._btn_apply = gtk.Button("Apply")
         self._btn_apply.connect('clicked', self._apply_clicked)
         self.action_area.pack_end(self._btn_apply)
         self._delpathbutton.set_sensitive(path_selected)
         self._testpathbutton.set_sensitive(repo_available and path_selected)
 
-    def set_help(self, widget, event, tooltip):
-        self.desctext.get_buffer().set_text(tooltip)
+    def set_help(self, widget, event, label, tooltip):
+        label.set_text(tooltip)
 
     def fill_frame(self, frame, info):
         widgets = []
+
+        descframe = gtk.Frame('Description')
+        fvbox = gtk.VBox()
+        desclabel = gtk.Label()
+        desclabel.set_line_wrap(True)
+        desclabel.set_alignment(0.0, 0.0)
+        fvbox.pack_start(desclabel, True, True, 2)
+        fvbox.set_border_width(5)
+        descframe.add(fvbox)
+
+        hbox = gtk.HBox()
+        vbox = gtk.VBox()
         table = gtk.Table(len(info), 2, False)
-        vbox = gtk.VBox()
-        frame.add(vbox)
         vbox.pack_start(table, False, False, 2)
 
+        hbox.pack_start(vbox, False, False, 2)
+        hbox.pack_start(descframe, True, True, 2)
+        frame.add(hbox)
+
         for row, (label, cpath, values, tooltip) in enumerate(info):
             vlist = gtk.ListStore(str, bool)
             combo = gtk.ComboBoxEntry(vlist, 0)
             combo.connect("changed", self.dirty_event)
-            combo.child.connect("focus-in-event", self.set_help, tooltip)
+            combo.child.connect("focus-in-event", self.set_help,
+                    desclabel, tooltip)
             combo.set_row_separator_func(lambda model, path: model[path][1])
             widgets.append(combo)