/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 viz/branchwin.py

  • Committer: Jelmer Vernooij
  • Date: 2011-11-30 21:45:54 UTC
  • Revision ID: jelmer@samba.org-20111130214554-5kfx0b5y7t5zh033
Extend branch preferences, show location widget.

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
    def construct_paned(self):
135
135
        """Construct the main HPaned/VPaned contents."""
136
136
        if self.config.get_user_option('viz-vertical') == 'True':
137
 
            self.paned = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)
 
137
            self.paned = Gtk.HPaned()
138
138
        else:
139
 
            self.paned = Gtk.Paned.new(Gtk.Orientation.VERTICAL)
 
139
            self.paned = Gtk.VPaned()
140
140
 
141
141
        self.paned.pack1(self.construct_top(), resize=False, shrink=True)
142
142
        self.paned.pack2(self.construct_bottom(), resize=True, shrink=False)
336
336
        align.add(self.treeview)
337
337
        # user-configured size
338
338
        size = self._load_size('viz-graph-size')
 
339
        if size:
 
340
            width, height = size
 
341
            align.set_size_request(width, height)
 
342
        else:
 
343
            (width, height) = self.get_size()
 
344
            align.set_size_request(width, int(height / 2.5))
339
345
        self._save_size_on_destroy(align, 'viz-graph-size')
340
346
        align.show()
341
347
 
365
371
    def construct_bottom(self):
366
372
        """Construct the bottom half of the window."""
367
373
        if self.config.get_user_option('viz-wide-diffs') == 'True':
368
 
            self.diff_paned = Gtk.Paned.new(Gtk.Orientation.VERTICAL)
 
374
            self.diff_paned = Gtk.VPaned()
369
375
        else:
370
 
            self.diff_paned = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)
 
376
            self.diff_paned = Gtk.HPaned()
371
377
        (width, height) = self.get_size()
372
378
        self.diff_paned.set_size_request(20, 20) # shrinkable
373
379
 
472
478
        else:
473
479
            parent_id = parents[0]
474
480
 
475
 
        if revision is not None:
476
 
            self.show_diff(revision.revision_id, parent_id)
477
 
        else:
478
 
            self.show_diff(NULL_REVISION)
 
481
        self.show_diff(revision.revision_id, parent_id)
479
482
        self.treeview.grab_focus()
480
483
 
481
484
    def _back_clicked_cb(self, *args):
651
654
            return width, height
652
655
        return None
653
656
 
654
 
    def show_diff(self, revid, parentid=NULL_REVISION):
 
657
    def show_diff(self, revid=None, parentid=NULL_REVISION):
655
658
        """Open a new window to show a diff between the given revisions."""
656
659
        from bzrlib.plugins.gtk.diff import DiffWindow
657
660
        window = DiffWindow(parent=self)