Code

Added preference to allow for system toolbox size
authorjoncruz <joncruz@users.sourceforge.net>
Tue, 8 May 2007 23:57:56 +0000 (23:57 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Tue, 8 May 2007 23:57:56 +0000 (23:57 +0000)
src/preferences-skeleton.h
src/ui/dialog/inkscape-preferences.cpp
src/ui/dialog/inkscape-preferences.h
src/widgets/toolbox.cpp

index 18df327efc6d55080fe35e7136d8f94bf0ff91de..30ea64dd018e3bf04fa1a2dec3ac790498d546d5 100644 (file)
@@ -222,6 +222,16 @@ static char const preferences_skeleton[] =
 "  </group>\n"
 "\n"
 "  <group\n"
+"     id=\"toolbox\"\n"
+"     icononly=\"1\"\n"
+"     small=\"1\">\n"
+"    <group\n"
+"       id=\"tools\"\n"
+"       icononly=\"1\"\n"
+"       small=\"0\" />\n"
+"  </group>\n"
+"\n"
+"  <group\n"
 "     id=\"iconpreview\">\n"
 "    <group\n"
 "       id=\"sizes\">\n"
index 3627b2e6b74a9d39e69de626793d9c6502308a4b..f40197cef5cbbd76cff50dfa7fa03b69295e73d5 100644 (file)
@@ -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);
index 2c815a309beda142456c8d9990a5d35cbb5d928d..a088946388f08321a89a9c89ba56e114c133e05c 100644 (file)
@@ -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;
index 91b94fe4d4756e4e3983d6e9081b6786f828d5eb..dad4f11f6a3a61dfea4dd6df13e219374ce81c4c 100644 (file)
@@ -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<GtkIconSize>(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 );