[gnumeric] GUI: Show more tabs and less status text.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] GUI: Show more tabs and less status text.
- Date: Tue, 23 Mar 2010 18:36:26 +0000 (UTC)
commit c578a14d0a50cd1218f77ee22635acb01e3b4fe8
Author: Morten Welinder <terra gnome org>
Date: Tue Mar 23 14:35:56 2010 -0400
GUI: Show more tabs and less status text.
ChangeLog | 2 +-
src/wbc-gtk.c | 17 ++++++++++++++---
2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 104bdf4..01d002d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
2010-03-23 Morten Welinder <terra gnome org>
* src/wbc-gtk.c (cb_paned_size_allocate): Improve handling of
- too-narrow windows.
+ too-narrow windows. Show more tabs for wide windows.
(cb_status_size_allocate): New function to trigger repartition
after window resize.
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index b7c8cf0..925f33a 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -934,7 +934,7 @@ cb_paned_size_allocate (GtkHPaned *hpaned,
GtkWidget *widget = (GtkWidget *)paned;
GtkRequisition child1_requisition;
gint handle_size;
- gint p1, p2, h1, h2, w1, w2, w, desired;
+ gint p1, p2, h1, h2, w1, w2, w, wp;
gint border_width = GTK_CONTAINER (paned)->border_width;
gboolean position_set;
GtkWidget *child1 = paned->child1;
@@ -969,8 +969,19 @@ cb_paned_size_allocate (GtkHPaned *hpaned,
gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
w = widget->allocation.width - handle_size - 2 * border_width;
- desired = MAX (0, w / 3);
- p1 = MIN (desired, child1->requisition.width);
+ p1 = MAX (0, w / 2);
+
+ /*
+ * Don't let the status text take up more then 125% of the space
+ * used for auto-expr and other little things. This helps with
+ * wide windows.
+ */
+ wp = GTK_WIDGET (hpaned)->parent->allocation.width;
+ p1 = MAX (p1, w - (wp - w) * 125 / 100);
+
+ /* However, never use more for tabs than we want. */
+ p1 = MIN (p1, child1->requisition.width);
+
p2 = MAX (0, w - p1);
if (p1 < child1->requisition.width) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]