about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@devio.us>2012-07-16 12:58:31 -0400
committerJosh Rickmar <jrick@devio.us>2012-07-16 12:58:31 -0400
commitae6bacac46deba4fdcad6a933c0890b680970c9b (patch)
tree5da3a31477a8881dbeeab478e4530d1ad1c40261
parentfb09a625f24b7f18d02a702e251f225348a67601 (diff)
downloadxombrero-ae6bacac46deba4fdcad6a933c0890b680970c9b.tar.gz
Make some modifications to the notebook tabs so they do not expand
when the spinner is shown.  Doing this in a way so that the text
doesn't bounce around when the spinner is shown and hidden requires a
ugly ugly hack of giving the label a fixed size instead of letting the
GtkBox give it an appropiate width, but afaik this isnecessary (and
the old gtk2 code was using the same hack).

While in here, give the Arrow name to the arrow button itself and not
the GtkArrow it holds, and remove the .button#Arrow CSS as we don't
want to remove the border from this button, only the tab close and
fancy_bar buttons.
-rw-r--r--xombrero.c17
-rw-r--r--xombrero.css3
2 files changed, 15 insertions, 5 deletions
diff --git a/xombrero.c b/xombrero.c
index b9dd589..40a6553 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -7519,15 +7519,26 @@ create_new_tab(char *title, struct undo *u, int focus, int position)
 #endif
 	t->label = gtk_label_new(title);
 	bb = create_button("Close", GTK_STOCK_CLOSE, 1);
-	gtk_widget_set_size_request(t->label, 100, 0);
 	gtk_label_set_max_width_chars(GTK_LABEL(t->label), 20);
 	gtk_label_set_ellipsize(GTK_LABEL(t->label), PANGO_ELLIPSIZE_END);
+	gtk_label_set_line_wrap(GTK_LABEL(t->label), FALSE);
 	gtk_widget_set_size_request(b, 130, 0);
 
+	/*
+	 * this is a total hack and most likely breaks with other styles but
+	 * is necessary so the text doesn't bounce around when the spinner is
+	 * shown/hidden
+	 */
+#if GTK_CHECK_VERSION(3, 0, 0)
+	gtk_widget_set_size_request(t->label, 95, 0);
+#else
+	gtk_widget_set_size_request(t->label, 100, 0);
+#endif
+
 	gtk_box_pack_start(GTK_BOX(b), bb, FALSE, FALSE, 0);
 	gtk_box_pack_start(GTK_BOX(b), t->label, FALSE, FALSE, 0);
 #if GTK_CHECK_VERSION(2, 20, 0)
-	gtk_box_pack_start(GTK_BOX(b), t->spinner, FALSE, FALSE, 0);
+	gtk_box_pack_end(GTK_BOX(b), t->spinner, FALSE, FALSE, 0);
 #endif
 
 	/* toolbar */
@@ -7958,7 +7969,7 @@ create_canvas(void)
 
 	abtn = gtk_button_new();
 	arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE);
-	gtk_widget_set_name(arrow, "Arrow");
+	gtk_widget_set_name(abtn, "Arrow");
 	gtk_container_add(GTK_CONTAINER(abtn), arrow);
 	gtk_widget_set_size_request(abtn, -1, 20);
 
diff --git a/xombrero.css b/xombrero.css
index 8c0918e..fb4ea54 100644
--- a/xombrero.css
+++ b/xombrero.css
@@ -104,8 +104,7 @@
 .button#Home,
 .button#Stop,
 .button#JS-Toggle,
-.button#Close,
-.button#Arrow {
+.button#Close {
 	border-width: 0;
 }