From 89e7c7ddf54c5c0390b5ad3459afc37f9f7960b6 Mon Sep 17 00:00:00 2001 From: joncruz Date: Tue, 8 May 2007 23:57:56 +0000 Subject: [PATCH] Added preference to allow for system toolbox size --- src/preferences-skeleton.h | 10 ++++++++++ src/ui/dialog/inkscape-preferences.cpp | 3 +++ src/ui/dialog/inkscape-preferences.h | 1 + src/widgets/toolbox.cpp | 17 ++++++++++++++--- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index 18df327ef..30ea64dd0 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -222,6 +222,16 @@ static char const preferences_skeleton[] = " \n" "\n" " \n" +" \n" +" \n" +"\n" +" \n" " \n" diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 3627b2e6b..f40197cef 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -587,6 +587,9 @@ void InkscapePreferences::initPageMisc() _misc_comment.init( _("Add label comments to printing output"), "printing.debug", "show-label-comments", false); _page_misc.add_line( false, "", _misc_comment, "", _("When on, a comment will be added to the raw print output, marking the rendered output for an object with its label"), true); + _misc_small_toolbar.init( _("Make commands toolbar smaller"), "toolbox", "small", true); + _page_misc.add_line( false, "", _misc_small_toolbar, "", + _("Make the commands toolbar use the 'secondary' toolbar size (requires restart)"), true); _misc_recent.init("options.maxrecentdocuments", "value", 0.0, 1000.0, 1.0, 1.0, 1.0, true, false); _page_misc.add_line( false, _("Max recent documents:"), _misc_recent, "", _("The maximum length of the Open Recent list in the File menu"), false); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 2c815a309..a08894638 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -148,6 +148,7 @@ protected: PrefSpinButton _misc_export, _misc_recent, _misc_simpl; PrefCheckButton _misc_imp_bitmap, _misc_comment, _misc_scripts; + PrefCheckButton _misc_small_toolbar; PrefCombo _misc_overs_bitmap; int _max_dialog_width; diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 91b94fe4d..dad4f11f6 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -909,7 +909,14 @@ static void setup_tool_toolbox(GtkWidget *toolbox, SPDesktop *desktop) { GtkTooltips *tooltips=GTK_TOOLTIPS(g_object_get_data(G_OBJECT(toolbox), "tooltips")); - gint shrinkLeft = prefs_get_int_attribute_limited( "toolbox.left", "small", 0, 0, 1 ); + gint shrinkLeft = prefs_get_int_attribute_limited( "toolbox.tools", "small", 0, 0, 1 ); + if ( (shrinkLeft == 0) && (prefs_get_int_attribute_limited( "toolbox.tools", "small", 1, 0, 1 ) == 1) ) { + // "toolbox.tools" was not set. Fallback to older value + shrinkLeft = prefs_get_int_attribute_limited( "toolbox.left", "small", 0, 0, 1 ); + + // Copy the setting forwards + prefs_set_int_attribute( "toolbox.tools", "small", shrinkLeft ); + } Inkscape::IconSize toolboxSize = shrinkLeft ? Inkscape::ICON_SIZE_SMALL_TOOLBAR : Inkscape::ICON_SIZE_LARGE_TOOLBAR; for (int i = 0 ; tools[i].type_name ; i++ ) { @@ -994,7 +1001,9 @@ setup_aux_toolbox(GtkWidget *toolbox, SPDesktop *desktop) gint shrinkTop = prefs_get_int_attribute_limited( "toolbox", "small", 1, 0, 1 ); Inkscape::IconSize toolboxSize = shrinkTop ? Inkscape::ICON_SIZE_SMALL_TOOLBAR : Inkscape::ICON_SIZE_LARGE_TOOLBAR; - gtk_toolbar_set_style( GTK_TOOLBAR(toolBar), GTK_TOOLBAR_ICONS ); + if ( prefs_get_int_attribute_limited( "toolbox", "icononly", 1, 0, 1 ) ) { + gtk_toolbar_set_style( GTK_TOOLBAR(toolBar), GTK_TOOLBAR_ICONS ); + } gtk_toolbar_set_icon_size( GTK_TOOLBAR(toolBar), static_cast(toolboxSize) ); @@ -1090,7 +1099,9 @@ setup_commands_toolbox(GtkWidget *toolbox, SPDesktop *desktop) gtk_ui_manager_add_ui_from_string( mgr, descr, -1, &errVal ); GtkWidget* toolBar = gtk_ui_manager_get_widget( mgr, "/ui/CommandsToolbar" ); - gtk_toolbar_set_style( GTK_TOOLBAR(toolBar), GTK_TOOLBAR_ICONS ); + if ( prefs_get_int_attribute_limited( "toolbox", "icononly", 1, 0, 1 ) ) { + gtk_toolbar_set_style( GTK_TOOLBAR(toolBar), GTK_TOOLBAR_ICONS ); + } gint shrinkTop = prefs_get_int_attribute_limited( "toolbox", "small", 1, 0, 1 ); Inkscape::IconSize toolboxSize = shrinkTop ? Inkscape::ICON_SIZE_SMALL_TOOLBAR : Inkscape::ICON_SIZE_LARGE_TOOLBAR; gtk_toolbar_set_icon_size( GTK_TOOLBAR(toolBar), (GtkIconSize)toolboxSize ); -- 2.30.2