summaryrefslogtreecommitdiffstats
path: root/src/widgets/button.cpp
diff options
context:
space:
mode:
authorAlexander Valavanis <valavanisalex@gmail.com>2017-06-29 12:35:19 +0000
committerAlexander Valavanis <valavanisalex@gmail.com>2017-06-29 12:35:19 +0000
commit2380b3e055e1fb4167d2aff01a79b1d06f1d10f7 (patch)
treeadc5683e882c8a04bb8177350deb0072491c8edc /src/widgets/button.cpp
parentAdd replacements for themedir for osx and win32 (diff)
parentAdd missing icon (diff)
downloadinkscape-2380b3e055e1fb4167d2aff01a79b1d06f1d10f7.tar.gz
inkscape-2380b3e055e1fb4167d2aff01a79b1d06f1d10f7.zip
Hackfest icon work: restore selected menu icons and make theming easier
Diffstat (limited to 'src/widgets/button.cpp')
-rw-r--r--src/widgets/button.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/widgets/button.cpp b/src/widgets/button.cpp
index 485300a25..7dcfc9771 100644
--- a/src/widgets/button.cpp
+++ b/src/widgets/button.cpp
@@ -12,7 +12,6 @@
*/
#include <glibmm.h>
-#include "icon.h"
#include "button.h"
#include "helper/action-context.h"
@@ -155,12 +154,12 @@ static void sp_button_perform_action(SPButton *button, gpointer /*data*/)
}
}
-GtkWidget *sp_button_new(Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action)
+GtkWidget *sp_button_new(GtkIconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action)
{
SPButton *button = SP_BUTTON(g_object_new(SP_TYPE_BUTTON, NULL));
button->type = type;
- button->lsize = CLAMP(size, Inkscape::ICON_SIZE_MENU, Inkscape::ICON_SIZE_DECORATION);
+ button->lsize = CLAMP(size, GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_DIALOG);
sp_button_set_action(button, action);
if (doubleclick_action)
@@ -212,7 +211,7 @@ static void sp_button_set_action(SPButton *button, SPAction *action)
button->c_set_sensitive = action->signal_set_sensitive.connect(
sigc::bind<0>(sigc::ptr_fun(&gtk_widget_set_sensitive), GTK_WIDGET(button)));
if (action->image) {
- child = sp_icon_new(button->lsize, action->image);
+ child = gtk_image_new_from_icon_name(action->image, button->lsize);
gtk_widget_show(child);
gtk_container_add(GTK_CONTAINER(button), child);
}
@@ -256,12 +255,11 @@ static void sp_button_set_composed_tooltip(GtkWidget *widget, SPAction *action)
}
}
-GtkWidget *sp_button_new_from_data(Inkscape::IconSize size, SPButtonType type, Inkscape::UI::View::View *view,
+GtkWidget *sp_button_new_from_data(GtkIconSize size, SPButtonType type, Inkscape::UI::View::View *view,
const gchar *name, const gchar *tip)
{
- GtkWidget *button;
SPAction *action = sp_action_new(Inkscape::ActionContext(view), name, name, tip, name, 0);
- button = sp_button_new(size, type, action, NULL);
+ GtkWidget *button = sp_button_new(size, type, action, NULL);
g_object_unref(action);
return button;
}