From ae6bacac46deba4fdcad6a933c0890b680970c9b Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 16 Jul 2012 12:58:31 -0400 Subject: 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. --- xombrero.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'xombrero.c') 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); -- cgit 1.4.1-2-gfad0