/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to commit.py

  • Committer: John Arbash Meinel
  • Date: 2007-10-01 18:22:16 UTC
  • mto: (322.1.1 trunk) (330.3.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 368.
  • Revision ID: john@arbash-meinel.com-20071001182216-z6p6s38u9ela7s9s
Worked out the rest of the spacing.
Also left aligning the labels on the right side, to make them consistent.
I might consider doing the same for the left side.

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
        self.set_focus(self._global_message_text_view)
134
134
 
135
135
    def _construct_left_pane(self):
136
 
        self._left_pane_box = gtk.VBox(homogeneous=False, spacing=3)
 
136
        self._left_pane_box = gtk.VBox(homogeneous=False, spacing=5)
137
137
        self._construct_file_list()
138
138
        self._construct_pending_list()
139
139
 
149
149
        # to have a way to do that with the gtk boxes... :( (Which is extra
150
150
        # weird since wx uses gtk on Linux...)
151
151
        self._right_pane_table = gtk.Table(rows=10, columns=1, homogeneous=False)
 
152
        self._right_pane_table.set_row_spacings(5)
 
153
        self._right_pane_table.set_col_spacings(5)
152
154
        self._right_pane_table_row = 0
153
155
        self._construct_diff_view()
154
156
        self._construct_file_message()
175
177
        self._right_pane_table_row = end_row
176
178
 
177
179
    def _construct_file_list(self):
178
 
        self._files_box = gtk.VBox()
 
180
        self._files_box = gtk.VBox(homogeneous=False, spacing=0)
179
181
        file_label = gtk.Label()
180
182
        file_label.set_markup(_('<b>Files</b>'))
181
183
        file_label.show()
203
205
        pending_message = gtk.Label()
204
206
        pending_message.set_markup(
205
207
            _('<i>Cannot select specific files when merging</i>'))
206
 
        self._pending_box.pack_start(pending_message, expand=False)
 
208
        self._pending_box.pack_start(pending_message, expand=False, padding=5)
207
209
        pending_message.show()
208
210
 
209
211
        pending_label = gtk.Label()
210
212
        pending_label.set_markup(_('<b>Pending Revisions</b>'))
211
 
        self._pending_box.pack_start(pending_label, expand=False)
 
213
        self._pending_box.pack_start(pending_label, expand=False, padding=0)
212
214
        pending_label.show()
213
215
 
214
216
        scroller = gtk.ScrolledWindow()
218
220
        scroller.show()
219
221
        scroller.set_shadow_type(gtk.SHADOW_IN)
220
222
        self._pending_box.pack_start(scroller,
221
 
                                     expand=True, fill=True)
 
223
                                     expand=True, fill=True, padding=5)
222
224
        self._treeview_pending.show()
223
225
        self._left_pane_box.pack_start(self._pending_box)
224
226
 
226
228
        from diff import DiffDisplay
227
229
 
228
230
        self._diff_label = gtk.Label(_('Diff for whole tree'))
229
 
        # We don't want this widget to resize
 
231
        self._diff_label.set_alignment(0, 0)
 
232
        self._right_pane_table.set_row_spacing(self._right_pane_table_row, 0)
230
233
        self._add_to_right_table(self._diff_label, 1, False)
231
234
        self._diff_label.show()
232
235
 
233
236
        self._diff_view = DiffDisplay()
234
 
        # self._diff_display.set_trees(self.wt, self.wt.basis_tree())
235
 
        # self._diff_display.show_diff(None)
236
237
        self._add_to_right_table(self._diff_view, 4, True)
237
238
        self._diff_view.show()
238
239
 
255
256
        self._file_message_expander = gtk.Expander(_('Message for XXX'))
256
257
        self._file_message_expander.add(file_message_box)
257
258
        file_message_box.show()
258
 
        # When expanded, we want to change expand=True, so that the message box
259
 
        # gets more space. But when it is shrunk, it has nothing to do with
260
 
        # that space, so we start it at expand=False
261
259
        self._add_to_right_table(self._file_message_expander, 1, False)
262
 
        # self._right_pane_table.pack_start(self._file_message_expander,
263
 
        #                                 expand=False, fill=True)
264
 
        # self._file_message_expander.connect('notify::expanded',
265
 
        #                                     self._expand_file_message_callback)
266
260
        self._file_message_expander.show()
267
261
 
268
 
    def _expand_file_message_callback(self, expander, param_spec):
269
 
        if expander.get_expanded():
270
 
            self._right_pane_table.set_child_packing(expander,
271
 
                expand=True, fill=True, padding=0, pack_type=gtk.PACK_START)
272
 
        else:
273
 
            self._right_pane_table.set_child_packing(expander,
274
 
                expand=False, fill=True, padding=0, pack_type=gtk.PACK_START)
275
 
 
276
262
    def _construct_global_message(self):
277
263
        self._global_message_label = gtk.Label(_('Global Commit Message'))
 
264
        self._global_message_label.set_alignment(0, 0)
 
265
        self._right_pane_table.set_row_spacing(self._right_pane_table_row, 0)
278
266
        self._add_to_right_table(self._global_message_label, 1, False)
 
267
        # Can we remove the spacing between the label and the box?
279
268
        self._global_message_label.show()
280
269
 
281
270
        scroller = gtk.ScrolledWindow()