summaryrefslogtreecommitdiffstats
path: root/src/widgets/toolbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/toolbox.cpp')
-rw-r--r--src/widgets/toolbox.cpp48
1 files changed, 21 insertions, 27 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 65c54f0ce..68e38e8ed 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -41,7 +41,6 @@
#include "document-undo.h"
#include "widgets/ege-adjustment-action.h"
#include "../helper/action.h"
-#include "icon.h"
#include "ink-action.h"
#include "ink-toggle-action.h"
#include "../inkscape.h"
@@ -102,7 +101,7 @@ using Inkscape::UI::ToolboxFactory;
using Inkscape::UI::Tools::ToolBase;
using Inkscape::IO::Resource::get_filename;
-using Inkscape::IO::Resource::UI;
+using Inkscape::IO::Resource::UIS;
typedef void (*SetupFunction)(GtkWidget *toolbox, SPDesktop *desktop);
typedef void (*UpdateFunction)(SPDesktop *desktop, ToolBase *eventcontext, GtkWidget *toolbox);
@@ -120,12 +119,12 @@ enum BarId {
static GtkWidget *sp_empty_toolbox_new(SPDesktop *desktop);
-Inkscape::IconSize ToolboxFactory::prefToSize( Glib::ustring const &path, int base ) {
- static Inkscape::IconSize sizeChoices[] = {
- Inkscape::ICON_SIZE_LARGE_TOOLBAR,
- Inkscape::ICON_SIZE_SMALL_TOOLBAR,
- Inkscape::ICON_SIZE_MENU,
- Inkscape::ICON_SIZE_DIALOG
+GtkIconSize ToolboxFactory::prefToSize( Glib::ustring const &path, int base ) {
+ static GtkIconSize sizeChoices[] = {
+ GTK_ICON_SIZE_LARGE_TOOLBAR,
+ GTK_ICON_SIZE_SMALL_TOOLBAR,
+ GTK_ICON_SIZE_MENU,
+ GTK_ICON_SIZE_DIALOG
};
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
int index = prefs->getIntLimited( path, base, 0, G_N_ELEMENTS(sizeChoices) );
@@ -244,7 +243,7 @@ static void update_aux_toolbox(SPDesktop *desktop, ToolBase *eventcontext, GtkWi
static void setup_commands_toolbox(GtkWidget *toolbox, SPDesktop *desktop);
static void update_commands_toolbox(SPDesktop *desktop, ToolBase *eventcontext, GtkWidget *toolbox);
-static GtkToolItem * sp_toolbox_button_item_new_from_verb_with_doubleclick( GtkWidget *t, Inkscape::IconSize size, SPButtonType type,
+static GtkToolItem * sp_toolbox_button_item_new_from_verb_with_doubleclick( GtkWidget *t, GtkIconSize size, SPButtonType type,
Inkscape::Verb *verb, Inkscape::Verb *doubleclick_verb,
Inkscape::UI::View::View *view);
@@ -301,11 +300,6 @@ VerbAction::~VerbAction()
Gtk::Widget* VerbAction::create_menu_item_vfunc()
{
-// First call in to get the icon rendered if present in SVG
- Gtk::Widget *widget = sp_icon_get_icon( get_icon_name(), Inkscape::ICON_SIZE_MENU );
- delete widget;
- widget = 0;
-
Gtk::Widget* widg = Gtk::Action::create_menu_item_vfunc();
// g_message("create_menu_item_vfunc() = %p for '%s'", widg, verb->get_id());
return widg;
@@ -314,7 +308,7 @@ Gtk::Widget* VerbAction::create_menu_item_vfunc()
Gtk::Widget* VerbAction::create_tool_item_vfunc()
{
// Gtk::Widget* widg = Gtk::Action::create_tool_item_vfunc();
- Inkscape::IconSize toolboxSize = ToolboxFactory::prefToSize("/toolbox/tools/small");
+ GtkIconSize toolboxSize = ToolboxFactory::prefToSize("/toolbox/tools/small");
GtkWidget* toolbox = 0;
GtkToolItem *button_toolitem = sp_toolbox_button_item_new_from_verb_with_doubleclick( toolbox, toolboxSize,
SP_BUTTON_TYPE_TOGGLE,
@@ -452,7 +446,7 @@ void delete_prefspusher(GObject * /*obj*/, PrefPusher *watcher )
// ------------------------------------------------------
-GtkToolItem * sp_toolbox_button_item_new_from_verb_with_doubleclick(GtkWidget *t, Inkscape::IconSize size, SPButtonType type,
+GtkToolItem * sp_toolbox_button_item_new_from_verb_with_doubleclick(GtkWidget *t, GtkIconSize size, SPButtonType type,
Inkscape::Verb *verb, Inkscape::Verb *doubleclick_verb,
Inkscape::UI::View::View *view)
{
@@ -504,7 +498,7 @@ static void trigger_sp_action( GtkAction* /*act*/, gpointer user_data )
}
}
-static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::View::View* view, Inkscape::IconSize size )
+static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::View::View* view, GtkIconSize size )
{
GtkAction* act = 0;
@@ -584,7 +578,7 @@ static Glib::RefPtr<Gtk::ActionGroup> create_or_fetch_actions( SPDesktop* deskto
SP_VERB_ZOOM_SELECTION
};
- Inkscape::IconSize toolboxSize = ToolboxFactory::prefToSize("/toolbox/small");
+ GtkIconSize toolboxSize = ToolboxFactory::prefToSize("/toolbox/small");
Glib::RefPtr<Gtk::ActionGroup> mainActions;
if (desktop == NULL)
{
@@ -840,10 +834,10 @@ static void setupToolboxCommon( GtkWidget *toolbox,
gtk_ui_manager_insert_action_group( mgr, mainActions->gobj(), 0 );
- char const *filename = get_filename(UI, ui_file);
- gtk_ui_manager_add_ui_from_file( mgr, filename, &err );
+ Glib::ustring filename = get_filename(UIS, ui_file);
+ gtk_ui_manager_add_ui_from_file( mgr, filename.c_str(), &err );
if(err) {
- g_warning("Failed to load %s: %s", filename, err->message);
+ g_warning("Failed to load %s: %s", filename.c_str(), err->message);
g_error_free(err);
return;
}
@@ -853,7 +847,7 @@ static void setupToolboxCommon( GtkWidget *toolbox,
gtk_toolbar_set_style( GTK_TOOLBAR(toolBar), GTK_TOOLBAR_ICONS );
}
- Inkscape::IconSize toolboxSize = ToolboxFactory::prefToSize(sizePref);
+ GtkIconSize toolboxSize = ToolboxFactory::prefToSize(sizePref);
gtk_toolbar_set_icon_size( GTK_TOOLBAR(toolBar), static_cast<GtkIconSize>(toolboxSize) );
GtkPositionType pos = static_cast<GtkPositionType>(GPOINTER_TO_INT(g_object_get_data( G_OBJECT(toolbox), HANDLE_POS_MARK )));
@@ -984,10 +978,10 @@ void setup_aux_toolbox(GtkWidget *toolbox, SPDesktop *desktop)
GError *err = 0;
gtk_ui_manager_insert_action_group( mgr, mainActions->gobj(), 0 );
- char const *filename = get_filename(UI, "select-toolbar.ui");
- guint ret = gtk_ui_manager_add_ui_from_file(mgr, filename, &err);
+ Glib::ustring filename = get_filename(UIS, "select-toolbar.ui");
+ guint ret = gtk_ui_manager_add_ui_from_file(mgr, filename.c_str(), &err);
if(err) {
- g_warning("Failed to load aux toolbar %s: %s", filename, err->message);
+ g_warning("Failed to load aux toolbar %s: %s", filename.c_str(), err->message);
g_error_free(err);
return;
}
@@ -1039,7 +1033,7 @@ void setup_aux_toolbox(GtkWidget *toolbox, SPDesktop *desktop)
gtk_toolbar_set_style( GTK_TOOLBAR(toolBar), GTK_TOOLBAR_ICONS );
}
- Inkscape::IconSize toolboxSize = ToolboxFactory::prefToSize("/toolbox/small");
+ GtkIconSize toolboxSize = ToolboxFactory::prefToSize("/toolbox/small");
gtk_toolbar_set_icon_size( GTK_TOOLBAR(toolBar), static_cast<GtkIconSize>(toolboxSize) );
gtk_widget_set_hexpand(toolBar, TRUE);
gtk_grid_attach( GTK_GRID(holder), toolBar, 0, 0, 1, 1);
@@ -1230,7 +1224,7 @@ void setup_snap_toolbox(GtkWidget *toolbox, SPDesktop *desktop)
{
Glib::RefPtr<Gtk::ActionGroup> mainActions = create_or_fetch_actions(desktop);
- Inkscape::IconSize secondarySize = ToolboxFactory::prefToSize("/toolbox/secondary", 1);
+ GtkIconSize secondarySize = ToolboxFactory::prefToSize("/toolbox/secondary", 1);
{
// TODO: This is a cludge. On the one hand we have verbs+actions,