[Xfce4-commits] <midori:master> Resize History List based on the requested size
Christian Dywan
noreply at xfce.org
Tue Nov 23 23:24:01 CET 2010
Updating branch refs/heads/master
to cb5bdb86460d333e42adf05482eed879632a813f (commit)
from 97a7ae9955d4264f922452d6933f3a0e1e4b03f6 (commit)
commit cb5bdb86460d333e42adf05482eed879632a813f
Author: André Stösel <Midori-Plugin at PyIT.de>
Date: Tue Nov 23 23:22:47 2010 +0100
Resize History List based on the requested size
extensions/history-list.vala | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/extensions/history-list.vala b/extensions/history-list.vala
index f52b753..89dd35d 100644
--- a/extensions/history-list.vala
+++ b/extensions/history-list.vala
@@ -57,7 +57,6 @@ private class TabWindow : HistoryWindow {
this.add (hbox);
var sw = new Gtk.ScrolledWindow (null, null);
- sw.set_size_request (320, 20);
sw.set_policy (PolicyType.NEVER , PolicyType.AUTOMATIC);
sw.set_shadow_type (ShadowType.ETCHED_IN);
hbox.pack_start (sw, true, true, 0);
@@ -81,7 +80,6 @@ private class TabWindow : HistoryWindow {
TabTreeCells.TREE_CELL_POINTER, view);
}
- this.set_default_size (320, list.len > 10 ? 232 : (int) list.len * 23 + 2);
this.treeview = new Gtk.TreeView.with_model (store);
this.treeview.set_fixed_height_mode (true);
sw.add (treeview);
@@ -96,6 +94,17 @@ private class TabWindow : HistoryWindow {
TabTreeCells.TREE_CELL_STRING, "Title",
new CellRendererText (), "text", 1);
+ Requisition requisition;
+ int height;
+ int max_lines = 10;
+ this.treeview.size_request (out requisition);
+ if ((int)list.len > max_lines) {
+ height = requisition.height / (int)list.len * max_lines + 2;
+ } else {
+ height = requisition.height + 2;
+ }
+ sw.set_size_request (320, height);
+
this.show_all ();
}
public override void make_update () {
More information about the Xfce4-commits
mailing list