mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-08-28 04:19:40 +00:00
Do not manually manage fixed column sizes
This commit is contained in:
parent
db31d577f9
commit
377a336120
|
@ -50,15 +50,6 @@ class Paned : Gtk.Paned
|
|||
[GtkChild]
|
||||
private Gtk.ScrolledWindow d_scrolled_window_commit_list;
|
||||
|
||||
[GtkChild]
|
||||
private Gtk.TreeViewColumn d_column_commit_list_subject;
|
||||
|
||||
[GtkChild]
|
||||
private Gtk.TreeViewColumn d_column_commit_list_author;
|
||||
|
||||
[GtkChild]
|
||||
private Gtk.TreeViewColumn d_column_commit_list_author_date;
|
||||
|
||||
[Notify]
|
||||
public Gtk.Orientation inner_orientation
|
||||
{
|
||||
|
@ -119,20 +110,6 @@ class Paned : Gtk.Paned
|
|||
d_renderer_commit_list_author_date.add_class("dim-label");
|
||||
|
||||
d_stack_switcher_panels.set_stack(d_stack_panel);
|
||||
|
||||
d_commit_list_view.size_allocate.connect(on_list_view_size_allocate);
|
||||
}
|
||||
|
||||
private void on_list_view_size_allocate(Gtk.Widget view, Gtk.Allocation alloc)
|
||||
{
|
||||
// Resize columns
|
||||
int subject = (int)(0.6 * alloc.width);
|
||||
int author = (int)(0.6 * (alloc.width - subject));
|
||||
int date = alloc.width - subject - author;
|
||||
|
||||
d_column_commit_list_subject.fixed_width = subject;
|
||||
d_column_commit_list_author.fixed_width = author;
|
||||
d_column_commit_list_author_date.fixed_width = date;
|
||||
}
|
||||
|
||||
public Paned()
|
||||
|
|
|
@ -88,12 +88,12 @@
|
|||
<property name="fixed-height-mode">True</property>
|
||||
<property name="headers-visible">False</property>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="d_column_commit_list_subject">
|
||||
<object class="GtkTreeViewColumn" id="column_commit_list_subject">
|
||||
<property name="title" translatable="yes">Subject</property>
|
||||
<property name="sizing">fixed</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fixed-width">600</property>
|
||||
<property name="fixed-width">50</property>
|
||||
<child>
|
||||
<object class="GitgCellRendererLanes" id="renderer_commit_list_subject">
|
||||
<property name="ellipsize">end</property>
|
||||
|
@ -105,11 +105,11 @@
|
|||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="d_column_commit_list_author">
|
||||
<object class="GtkTreeViewColumn" id="column_commit_list_author">
|
||||
<property name="title" translatable="yes">Author</property>
|
||||
<property name="sizing">fixed</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="fixed-width">200</property>
|
||||
<property name="fixed-width">150</property>
|
||||
<child>
|
||||
<object class="GdStyledTextRenderer" id="d_renderer_commit_list_author">
|
||||
<property name="ellipsize">end</property>
|
||||
|
@ -121,11 +121,11 @@
|
|||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="d_column_commit_list_author_date">
|
||||
<object class="GtkTreeViewColumn" id="column_commit_list_author_date">
|
||||
<property name="title" translatable="yes">Date</property>
|
||||
<property name="sizing">fixed</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="fixed-width">250</property>
|
||||
<property name="fixed-width">100</property>
|
||||
<child>
|
||||
<object class="GdStyledTextRenderer" id="d_renderer_commit_list_author_date">
|
||||
<property name="ellipsize">end</property>
|
||||
|
|
Loading…
Reference in a new issue