summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorMoritz Eberl <moritz@semiodesk.com>2016-04-13 14:05:30 +0000
committerMoritz Eberl <moritz@semiodesk.com>2016-04-13 14:05:30 +0000
commit3a1aa63dc5df1aaebe89226e484f49289cae5f7c (patch)
tree4afa9d90d2650f27f0411bc52ef608dca5e5a88b /src/ui
parentMerge (diff)
parentgimpcolorwheel: Fix deprecated gtk_widget_style_attach #Hackfest2016 (diff)
downloadinkscape-3a1aa63dc5df1aaebe89226e484f49289cae5f7c.tar.gz
inkscape-3a1aa63dc5df1aaebe89226e484f49289cae5f7c.zip
Merge and fixed CMake build
(bzr r14761.1.5)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/clonetiler.cpp24
-rw-r--r--src/ui/interface.cpp12
-rw-r--r--src/ui/widget/color-icc-selector.cpp13
-rw-r--r--src/ui/widget/color-notebook.cpp4
-rw-r--r--src/ui/widget/color-scales.cpp6
-rw-r--r--src/ui/widget/gimpcolorwheel.c2
6 files changed, 54 insertions, 7 deletions
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp
index fbd050f8e..9656878e0 100644
--- a/src/ui/dialog/clonetiler.cpp
+++ b/src/ui/dialog/clonetiler.cpp
@@ -1061,7 +1061,11 @@ CloneTiler::CloneTiler () :
{
GtkWidget *l = gtk_label_new ("");
gtk_label_set_markup (GTK_LABEL(l), "&#215;");
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(l, GTK_ALIGN_END);
+#else
gtk_misc_set_alignment (GTK_MISC (l), 1.0, 0.5);
+#endif
gtk_box_pack_start (GTK_BOX (hb), l, TRUE, TRUE, 0);
}
@@ -1135,7 +1139,11 @@ CloneTiler::CloneTiler () :
{
GtkWidget *l = gtk_label_new ("");
gtk_label_set_markup (GTK_LABEL(l), "&#215;");
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(l, GTK_ALIGN_END);
+#else
gtk_misc_set_alignment (GTK_MISC (l), 1.0, 0.5);
+#endif
gtk_box_pack_start (GTK_BOX (hb), l, TRUE, TRUE, 0);
}
@@ -2777,7 +2785,12 @@ GtkWidget * CloneTiler::clonetiler_spinbox(const char *tip, const char *attr, do
{
GtkWidget *l = gtk_label_new ("");
gtk_label_set_markup (GTK_LABEL(l), suffix);
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(l, GTK_ALIGN_END);
+ gtk_widget_set_valign(l, GTK_ALIGN_START);
+#else
gtk_misc_set_alignment (GTK_MISC (l), 1.0, 0);
+#endif
gtk_box_pack_start (GTK_BOX (hb), l, FALSE, FALSE, 0);
}
@@ -2853,14 +2866,13 @@ void CloneTiler::clonetiler_reset(GtkWidget */*widget*/, GtkWidget *dlg)
void CloneTiler::clonetiler_table_attach(GtkWidget *table, GtkWidget *widget, float align, int row, int col)
{
- GtkWidget *a = gtk_alignment_new (align, 0, 0, 0);
- gtk_container_add(GTK_CONTAINER(a), widget);
-
#if GTK_CHECK_VERSION(3,0,0)
- gtk_widget_set_halign(table, GTK_ALIGN_FILL);
- gtk_widget_set_valign(table, GTK_ALIGN_CENTER);
- gtk_grid_attach(GTK_GRID(table), a, col, row, 1, 1);
+ gtk_widget_set_halign(widget, GTK_ALIGN_FILL);
+ gtk_widget_set_valign(widget, GTK_ALIGN_START);
+ gtk_grid_attach(GTK_GRID(table), widget, col, row, 1, 1);
#else
+ GtkWidget *a = gtk_alignment_new (align, 0, 0, 0);
+ gtk_container_add(GTK_CONTAINER(a), widget);
gtk_table_attach ( GTK_TABLE (table), a, col, col + 1, row, row + 1, GTK_FILL, (GtkAttachOptions)0, 0, 0 );
#endif
}
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index 8639861f8..a16bbc472 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -79,6 +79,10 @@
#include "message-stack.h"
#include "ui/dialog/layer-properties.h"
+#if GTK_CHECK_VERSION(3,0,0)
+ #include "widgets/image-menu-item.h"
+#endif
+
#include <gdk/gdkkeysyms.h>
#include <glibmm/miscutils.h>
@@ -413,7 +417,11 @@ sp_ui_menuitem_add_icon( GtkWidget *item, gchar *icon_name )
icon = sp_icon_new( Inkscape::ICON_SIZE_MENU, icon_name );
gtk_widget_show(icon);
+#if GTK_CHECK_VERSION(3,0,0)
+ image_menu_item_set_image((ImageMenuItem *) item, icon);
+#else
gtk_image_menu_item_set_image((GtkImageMenuItem *) item, icon);
+#endif
} // end of sp_ui_menu_add_icon
void
@@ -467,7 +475,11 @@ static GtkWidget *sp_ui_menu_append_item_from_verb(GtkMenu *menu, Inkscape::Verb
if (radio) {
item = gtk_radio_menu_item_new_with_mnemonic(group, action->name);
} else {
+#if GTK_CHECK_VERSION(3,0,0)
+ item = image_menu_item_new_with_mnemonic(action->name);
+#else
item = gtk_image_menu_item_new_with_mnemonic(action->name);
+#endif
}
gtk_label_set_markup_with_mnemonic( GTK_LABEL(gtk_bin_get_child(GTK_BIN (item))), action->name);
diff --git a/src/ui/widget/color-icc-selector.cpp b/src/ui/widget/color-icc-selector.cpp
index 2fe4a0704..ec2e69fb3 100644
--- a/src/ui/widget/color-icc-selector.cpp
+++ b/src/ui/widget/color-icc-selector.cpp
@@ -377,7 +377,6 @@ void ColorICCSelector::init()
(gpointer)_impl);
gtk_widget_set_sensitive(_impl->_fixupBtn, FALSE);
gtk_widget_set_tooltip_text(_impl->_fixupBtn, _("Fix RGB fallback to match icc-color() value."));
- // gtk_misc_set_alignment( GTK_MISC (_impl->_fixupBtn), 1.0, 0.5 );
gtk_widget_show(_impl->_fixupBtn);
attachToGridOrTable(t, _impl->_fixupBtn, 0, row, 1, 1);
@@ -431,7 +430,13 @@ void ColorICCSelector::init()
#endif
_impl->_compUI[i]._label = gtk_label_new_with_mnemonic(labelStr.c_str());
+
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(_impl->_compUI[i]._label, GTK_ALIGN_END);
+#else
gtk_misc_set_alignment(GTK_MISC(_impl->_compUI[i]._label), 1.0, 0.5);
+#endif
+
gtk_widget_show(_impl->_compUI[i]._label);
gtk_widget_set_no_show_all(_impl->_compUI[i]._label, TRUE);
@@ -489,7 +494,13 @@ void ColorICCSelector::init()
// Label
_impl->_label = gtk_label_new_with_mnemonic(_("_A:"));
+
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(_impl->_label, GTK_ALIGN_END);
+#else
gtk_misc_set_alignment(GTK_MISC(_impl->_label), 1.0, 0.5);
+#endif
+
gtk_widget_show(_impl->_label);
attachToGridOrTable(t, _impl->_label, 0, row, 1, 1);
diff --git a/src/ui/widget/color-notebook.cpp b/src/ui/widget/color-notebook.cpp
index 60abf43bf..6d7ada734 100644
--- a/src/ui/widget/color-notebook.cpp
+++ b/src/ui/widget/color-notebook.cpp
@@ -210,7 +210,11 @@ void ColorNotebook::_initUI()
/* Create RGBA entry and color preview */
_rgbal = gtk_label_new_with_mnemonic(_("RGBA_:"));
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(_rgbal, GTK_ALIGN_END);
+#else
gtk_misc_set_alignment(GTK_MISC(_rgbal), 1.0, 0.5);
+#endif
gtk_box_pack_start(GTK_BOX(rgbabox), _rgbal, TRUE, TRUE, 2);
ColorEntry *rgba_entry = Gtk::manage(new ColorEntry(_selected_color));
diff --git a/src/ui/widget/color-scales.cpp b/src/ui/widget/color-scales.cpp
index 170f83887..48a2693bc 100644
--- a/src/ui/widget/color-scales.cpp
+++ b/src/ui/widget/color-scales.cpp
@@ -92,7 +92,13 @@ void ColorScales::_initUI(SPColorScalesMode mode)
for (i = 0; i < static_cast<gint>(G_N_ELEMENTS(_a)); i++) {
/* Label */
_l[i] = gtk_label_new("");
+
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(_l[i], GTK_ALIGN_END);
+#else
gtk_misc_set_alignment(GTK_MISC(_l[i]), 1.0, 0.5);
+#endif
+
gtk_widget_show(_l[i]);
#if GTK_CHECK_VERSION(3, 0, 0)
diff --git a/src/ui/widget/gimpcolorwheel.c b/src/ui/widget/gimpcolorwheel.c
index 3642848df..d54486505 100644
--- a/src/ui/widget/gimpcolorwheel.c
+++ b/src/ui/widget/gimpcolorwheel.c
@@ -303,7 +303,9 @@ gimp_color_wheel_realize (GtkWidget *widget)
priv->window = gdk_window_new (parent_window, &attr, attr_mask);
gdk_window_set_user_data (priv->window, wheel);
+#if !GTK_CHECK_VERSION(3,0,0)
gtk_widget_style_attach (widget);
+#endif
}
static void