From 6c99bdf7c2e74900dbeb8534ba153c83fae25dfa Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Fri, 21 Jun 2002 12:05:41 +0000 Subject: [PATCH] r1578: Added 'Text beside icon' toolbar style (Michael Adams). --- ROX-Filer/Help/Changes | 4 ++++ ROX-Filer/Options.xml | 5 +++-- ROX-Filer/src/toolbar.c | 30 +++++++++++++++++++++--------- ROX-Filer/src/toolbar.h | 7 ++++--- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index 282d4cee..94e15de4 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -2,6 +2,10 @@ A RISC OS-like filer for X by Thomas Leonard +21-Jun-2002 +~~~~~~~~~~~ +Added 'Text beside icon' toolbar style (Michael Adams). + 20-Jun-2002 ~~~~~~~~~~~ Bugfix: Using another window in between entering target mode and selecting diff --git a/ROX-Filer/Options.xml b/ROX-Filer/Options.xml index f7b4407f..4fbf4105 100644 --- a/ROX-Filer/Options.xml +++ b/ROX-Filer/Options.xml @@ -86,8 +86,9 @@ If on, ignores case and punctuation and handles numbers properly: file8, File9, - - + + + Show the number of items displayed in a filer window, as well as the number of hidden items (if any). When there's a selection, show the number of selected items and their combined size. diff --git a/ROX-Filer/src/toolbar.c b/ROX-Filer/src/toolbar.c index 6257d884..7fe4d4b2 100644 --- a/ROX-Filer/src/toolbar.c +++ b/ROX-Filer/src/toolbar.c @@ -439,7 +439,7 @@ static gint menu_pressed(GtkWidget *button, static GtkWidget *add_button(GtkWidget *bar, Tool *tool, FilerWindow *filer_window) { - GtkWidget *button, *icon_widget; + GtkWidget *button, *icon_widget, *box = NULL; button = gtk_button_new(); gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); @@ -470,26 +470,38 @@ static GtkWidget *add_button(GtkWidget *bar, Tool *tool, icon_widget = gtk_image_new_from_pixbuf(tool->icon->pixbuf); - if (o_toolbar.int_value == TOOLBAR_LARGE) + if (o_toolbar.int_value == TOOLBAR_HORIZONTAL) + box = gtk_hbox_new(FALSE, 0); + else if (o_toolbar.int_value == TOOLBAR_LARGE) + box = gtk_vbox_new(FALSE, 0); + + if (box) { - GtkWidget *vbox, *text; + GtkWidget *text; - vbox = gtk_vbox_new(FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), icon_widget, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(box), icon_widget, TRUE, TRUE, 0); text = gtk_label_new(_(tool->label)); - gtk_box_pack_start(GTK_BOX(vbox), text, FALSE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(box), text, FALSE, TRUE, 0); - gtk_container_add(GTK_CONTAINER(button), vbox); + gtk_container_add(GTK_CONTAINER(button), box); } else gtk_container_add(GTK_CONTAINER(button), icon_widget); gtk_container_set_border_width(GTK_CONTAINER(button), 1); - gtk_misc_set_padding(GTK_MISC(icon_widget), - o_toolbar.int_value == TOOLBAR_LARGE ? 16 : 8, 1); + + if (o_toolbar.int_value == TOOLBAR_HORIZONTAL) + gtk_misc_set_padding(GTK_MISC(icon_widget), 4, 1); + else if (o_toolbar.int_value == TOOLBAR_LARGE) + gtk_misc_set_padding(GTK_MISC(icon_widget), 16, 1); + else + gtk_misc_set_padding(GTK_MISC(icon_widget), 8, 1); gtk_toolbar_append_widget(GTK_TOOLBAR(bar), button, NULL, NULL); + + if (o_toolbar.int_value == TOOLBAR_HORIZONTAL) + gtk_toolbar_append_space(GTK_TOOLBAR(bar)); return button; } diff --git a/ROX-Filer/src/toolbar.h b/ROX-Filer/src/toolbar.h index f2f4dd20..9c628739 100644 --- a/ROX-Filer/src/toolbar.h +++ b/ROX-Filer/src/toolbar.h @@ -12,9 +12,10 @@ /* The values correspond to the menu indexes in the option widget */ typedef enum { - TOOLBAR_NONE = 0, - TOOLBAR_NORMAL = 1, - TOOLBAR_LARGE = 2, + TOOLBAR_NONE = 0, + TOOLBAR_NORMAL = 1, + TOOLBAR_LARGE = 2, + TOOLBAR_HORIZONTAL = 3, } ToolbarType; extern Option o_toolbar, o_toolbar_info; -- 2.11.4.GIT