summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2016-07-28 18:15:34 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2016-07-28 18:15:34 +0000
commit49a7927ecf31ace696e9e5770e8d6543c356db7a (patch)
treed5c2d0a3d1581718d0d4cf2b2e2bcddf24b0105f /src/ui
parentDrop remaining GTKMM 2 fallback support (diff)
downloadinkscape-49a7927ecf31ace696e9e5770e8d6543c356db7a.tar.gz
inkscape-49a7927ecf31ace696e9e5770e8d6543c356db7a.zip
Finish removing GTK+ 2 fallbacks
(bzr r15023.2.8)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/export.cpp5
-rw-r--r--src/ui/dialog/font-substitution.cpp6
-rw-r--r--src/ui/interface.cpp32
-rw-r--r--src/ui/previewholder.cpp22
-rw-r--r--src/ui/tools/dropper-tool.cpp8
-rw-r--r--src/ui/tools/select-tool.cpp8
-rw-r--r--src/ui/tools/tool-base.cpp16
-rw-r--r--src/ui/widget/dock-item.h4
-rw-r--r--src/ui/widget/gimpcolorwheel.c137
-rw-r--r--src/ui/widget/selected-style.cpp8
-rw-r--r--src/ui/widget/spinbutton.h4
11 files changed, 3 insertions, 247 deletions
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp
index 5e7c68985..5167ca2a2 100644
--- a/src/ui/dialog/export.cpp
+++ b/src/ui/dialog/export.cpp
@@ -67,12 +67,7 @@
#include "helper/png-write.h"
-#if WITH_EXT_GDL
#include <gdl/gdl-dock-item.h>
-#else
-#include "libgdl/gdl-dock-item.h"
-#endif
-
// required to set status message after export
#include "desktop.h"
diff --git a/src/ui/dialog/font-substitution.cpp b/src/ui/dialog/font-substitution.cpp
index f219f3db6..18a7241a4 100644
--- a/src/ui/dialog/font-substitution.cpp
+++ b/src/ui/dialog/font-substitution.cpp
@@ -106,11 +106,7 @@ FontSubstitution::show(Glib::ustring out, std::vector<SPItem*> &l)
cbWarning->set_label(_("Don't show this warning again"));
cbWarning->show();
-#if GTK_CHECK_VERSION(3,0,0)
- Gtk::Box * box = warning.get_content_area();
-#else
- Gtk::Box * box = warning.get_vbox();
-#endif
+ auto box = warning.get_content_area();
box->set_spacing(2);
box->pack_start(*scrollwindow, true, true, 4);
box->pack_start(*cbSelect, false, false, 0);
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index ab29471ed..1d2fa5b34 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -79,9 +79,7 @@
#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 "widgets/image-menu-item.h"
#include <gdk/gdkkeysyms.h>
@@ -417,11 +415,7 @@ 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
@@ -475,11 +469,7 @@ 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);
@@ -570,11 +560,7 @@ static bool getViewStateFromPref(Inkscape::UI::View::View *view, gchar const *pr
return prefs->getBool(pref_path, true);
}
-#if GTK_CHECK_VERSION(3,0,0)
static gboolean checkitem_update(GtkWidget *widget, cairo_t * /*cr*/, gpointer user_data)
-#else
-static gboolean checkitem_update(GtkWidget *widget, GdkEventExpose * /*event*/, gpointer user_data)
-#endif
{
GtkCheckMenuItem *menuitem=GTK_CHECK_MENU_ITEM(widget);
@@ -631,11 +617,7 @@ static void taskToggled(GtkCheckMenuItem *menuitem, gpointer userData)
/**
* Callback function to update the status of the radio buttons in the View -> Display mode menu (Normal, No Filters, Outline) and Color display mode.
*/
-#if GTK_CHECK_VERSION(3,0,0)
static gboolean update_view_menu(GtkWidget *widget, cairo_t * /*cr*/, gpointer user_data)
-#else
-static gboolean update_view_menu(GtkWidget *widget, GdkEventExpose * /*event*/, gpointer user_data)
-#endif
{
SPAction *action = (SPAction *) user_data;
g_assert(action->id != NULL);
@@ -679,11 +661,7 @@ static gboolean update_view_menu(GtkWidget *widget, GdkEventExpose * /*event*/,
static void
sp_ui_menu_append_check_item_from_verb(GtkMenu *menu, Inkscape::UI::View::View *view, gchar const *label, gchar const *tip, gchar const *pref,
void (*callback_toggle)(GtkCheckMenuItem *, gpointer user_data),
-#if GTK_CHECK_VERSION(3,0,0)
gboolean (*callback_update)(GtkWidget *widget, cairo_t *cr, gpointer user_data),
-#else
- gboolean (*callback_update)(GtkWidget *widget, GdkEventExpose *event, gpointer user_data),
-#endif
Inkscape::Verb *verb)
{
unsigned int shortcut = (verb) ? sp_shortcut_get_primary(verb) : 0;
@@ -707,11 +685,7 @@ sp_ui_menu_append_check_item_from_verb(GtkMenu *menu, Inkscape::UI::View::View *
g_signal_connect( G_OBJECT(item), "toggled", (GCallback) callback_toggle, (void *) pref);
-#if GTK_CHECK_VERSION(3,0,0)
g_signal_connect( G_OBJECT(item), "draw", (GCallback) callback_update, (void *) pref);
-#else
- g_signal_connect( G_OBJECT(item), "expose_event", (GCallback) callback_update, (void *) pref);
-#endif
(*callback_update)(item, NULL, (void *)pref);
@@ -854,11 +828,7 @@ static void sp_ui_build_dyn_menus(Inkscape::XML::Node *menus, GtkWidget *menu, I
}
if (verb->get_code() != SP_VERB_NONE) {
SPAction *action = verb->get_action(Inkscape::ActionContext(view));
-#if GTK_CHECK_VERSION(3,0,0)
g_signal_connect( G_OBJECT(item), "draw", (GCallback) update_view_menu, (void *) action);
-#else
- g_signal_connect( G_OBJECT(item), "expose_event", (GCallback) update_view_menu, (void *) action);
-#endif
}
} else if (menu_pntr->attribute("check") != NULL) {
if (verb->get_code() != SP_VERB_NONE) {
diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp
index 8336467c4..bb7f077b0 100644
--- a/src/ui/previewholder.cpp
+++ b/src/ui/previewholder.cpp
@@ -259,12 +259,8 @@ void PreviewHolder::on_size_allocate( Gtk::Allocation& allocation )
if ( _insides && !_wrap && (_view != VIEW_TYPE_LIST) && (_anchor == SP_ANCHOR_NORTH || _anchor == SP_ANCHOR_SOUTH) ) {
Gtk::Requisition req;
-#if GTK_CHECK_VERSION(3,0,0)
Gtk::Requisition req_natural;
_insides->get_preferred_size(req, req_natural);
-#else
- req = _insides->size_request();
-#endif
gint delta = allocation.get_width() - req.width;
if ( (delta > 4) && req.height < allocation.get_height() ) {
@@ -306,43 +302,27 @@ void PreviewHolder::calcGridSize( const Gtk::Widget* thing, int itemCount, int&
if ( _anchor == SP_ANCHOR_SOUTH || _anchor == SP_ANCHOR_NORTH ) {
Gtk::Requisition req;
-#if GTK_CHECK_VERSION(3,0,0)
Gtk::Requisition req_natural;
_scroller->get_preferred_size(req, req_natural);
-#else
- req = _scroller->size_request();
-#endif
int currW = _scroller->get_width();
if ( currW > req.width ) {
req.width = currW;
}
-#if GTK_CHECK_VERSION(3,0,0)
- Gtk::Scrollbar* hs = dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->get_hscrollbar();
-#else
- Gtk::HScrollbar* hs = dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->get_hscrollbar();
-#endif
+ auto hs = dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->get_hscrollbar();
if ( hs ) {
Gtk::Requisition scrollReq;
-#if GTK_CHECK_VERSION(3,0,0)
Gtk::Requisition scrollReq_natural;
hs->get_preferred_size(scrollReq, scrollReq_natural);
-#else
- scrollReq = hs->size_request();
-#endif
// the +8 is a temporary hack
req.height -= scrollReq.height + 8;
}
Gtk::Requisition req2;
-#if GTK_CHECK_VERSION(3,0,0)
Gtk::Requisition req2_natural;
const_cast<Gtk::Widget*>(thing)->get_preferred_size(req2, req2_natural);
-#else
- req2 = const_cast<Gtk::Widget*>(thing)->size_request();
-#endif
int h2 = ((req2.height > 0) && (req.height > req2.height)) ? (req.height / req2.height) : 1;
int w2 = ((req2.width > 0) && (req.width > req2.width)) ? (req.width / req2.width) : 1;
diff --git a/src/ui/tools/dropper-tool.cpp b/src/ui/tools/dropper-tool.cpp
index c838c27d5..fbc5f088c 100644
--- a/src/ui/tools/dropper-tool.cpp
+++ b/src/ui/tools/dropper-tool.cpp
@@ -121,20 +121,12 @@ void DropperTool::finish() {
}
if (cursor_dropper_fill) {
-#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(cursor_dropper_fill);
-#else
- gdk_cursor_unref (cursor_dropper_fill);
-#endif
cursor_dropper_fill = NULL;
}
if (cursor_dropper_stroke) {
-#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(cursor_dropper_stroke);
-#else
- gdk_cursor_unref (cursor_dropper_stroke);
-#endif
cursor_dropper_fill = NULL;
}
diff --git a/src/ui/tools/select-tool.cpp b/src/ui/tools/select-tool.cpp
index b5ec3d88e..b29fb6979 100644
--- a/src/ui/tools/select-tool.cpp
+++ b/src/ui/tools/select-tool.cpp
@@ -128,20 +128,12 @@ SelectTool::~SelectTool() {
this->_describer = NULL;
if (CursorSelectDragging) {
-#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(CursorSelectDragging);
-#else
- gdk_cursor_unref (CursorSelectDragging);
-#endif
CursorSelectDragging = NULL;
}
if (CursorSelectMouseover) {
-#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(CursorSelectMouseover);
-#else
- gdk_cursor_unref (CursorSelectMouseover);
-#endif
CursorSelectMouseover = NULL;
}
}
diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp
index 17debb59c..d504d82eb 100644
--- a/src/ui/tools/tool-base.cpp
+++ b/src/ui/tools/tool-base.cpp
@@ -118,11 +118,7 @@ ToolBase::~ToolBase() {
}
if (this->cursor != NULL) {
-#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(this->cursor);
-#else
- gdk_cursor_unref(this->cursor);
-#endif
this->cursor = NULL;
}
@@ -182,11 +178,7 @@ void ToolBase::sp_event_context_update_cursor() {
);
if (pixbuf != NULL) {
if (this->cursor) {
-#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(this->cursor);
-#else
- gdk_cursor_unref(this->cursor);
-#endif
}
this->cursor = gdk_cursor_new_from_pixbuf(display, pixbuf, this->hot_x, this->hot_y);
g_object_unref(pixbuf);
@@ -196,11 +188,7 @@ void ToolBase::sp_event_context_update_cursor() {
if (pixbuf) {
if (this->cursor) {
-#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(this->cursor);
-#else
- gdk_cursor_unref(this->cursor);
-#endif
}
this->cursor = gdk_cursor_new_from_pixbuf(display,
pixbuf, this->hot_x, this->hot_y);
@@ -771,11 +759,9 @@ bool ToolBase::root_handler(GdkEvent* event) {
int const wheel_scroll = prefs->getIntLimited(
"/options/wheelscroll/value", 40, 0, 1000);
-#if GTK_CHECK_VERSION(3,0,0)
// Size of smooth-scrolls (only used in GTK+ 3)
gdouble delta_x = 0;
gdouble delta_y = 0;
-#endif
/* shift + wheel, pan left--right */
if (event->scroll.state & GDK_SHIFT_MASK) {
@@ -836,12 +822,10 @@ bool ToolBase::root_handler(GdkEvent* event) {
desktop->scroll_world(-wheel_scroll, 0);
break;
-#if GTK_CHECK_VERSION(3,0,0)
case GDK_SCROLL_SMOOTH:
gdk_event_get_scroll_deltas(event, &delta_x, &delta_y);
desktop->scroll_world(delta_x, delta_y);
break;
-#endif
}
}
break;
diff --git a/src/ui/widget/dock-item.h b/src/ui/widget/dock-item.h
index 25a69d94c..2df45b207 100644
--- a/src/ui/widget/dock-item.h
+++ b/src/ui/widget/dock-item.h
@@ -19,11 +19,7 @@
#include <gtkmm/frame.h>
#include <gtkmm/window.h>
-#if WITH_EXT_GDL
#include <gdl/gdl.h>
-#else
-#include "libgdl/gdl.h"
-#endif
namespace Gtk {
class HButtonBox;
diff --git a/src/ui/widget/gimpcolorwheel.c b/src/ui/widget/gimpcolorwheel.c
index d54486505..212391497 100644
--- a/src/ui/widget/gimpcolorwheel.c
+++ b/src/ui/widget/gimpcolorwheel.c
@@ -110,7 +110,6 @@ static gboolean gimp_color_wheel_button_release (GtkWidget *widget,
GdkEventButton *event);
static gboolean gimp_color_wheel_motion (GtkWidget *widget,
GdkEventMotion *event);
-#if GTK_CHECK_VERSION(3,0,0)
static gboolean gimp_color_wheel_draw (GtkWidget *widget,
cairo_t *cr);
static void gimp_color_wheel_get_preferred_width (GtkWidget *widget,
@@ -119,13 +118,6 @@ static void gimp_color_wheel_get_preferred_width (GtkWidget *widget,
static void gimp_color_wheel_get_preferred_height (GtkWidget *widget,
gint *minimum_height,
gint *natural_height);
-#else
-static gboolean gimp_color_wheel_expose (GtkWidget *widget,
- GdkEventExpose *event);
-static void gimp_color_wheel_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-#endif
-
static gboolean gimp_color_wheel_grab_broken (GtkWidget *widget,
GdkEventGrabBroken *event);
static gboolean gimp_color_wheel_focus (GtkWidget *widget,
@@ -157,16 +149,9 @@ gimp_color_wheel_class_init (GimpColorWheelClass *class)
widget_class->button_press_event = gimp_color_wheel_button_press;
widget_class->button_release_event = gimp_color_wheel_button_release;
widget_class->motion_notify_event = gimp_color_wheel_motion;
-
-#if GTK_CHECK_VERSION(3,0,0)
widget_class->get_preferred_width = gimp_color_wheel_get_preferred_width;
widget_class->get_preferred_height = gimp_color_wheel_get_preferred_height;
widget_class->draw = gimp_color_wheel_draw;
-#else
- widget_class->size_request = gimp_color_wheel_size_request;
- widget_class->expose_event = gimp_color_wheel_expose;
-#endif
-
widget_class->focus = gimp_color_wheel_focus;
widget_class->grab_broken_event = gimp_color_wheel_grab_broken;
@@ -302,10 +287,6 @@ 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
@@ -321,7 +302,6 @@ gimp_color_wheel_unrealize (GtkWidget *widget)
GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
}
-#if GTK_CHECK_VERSION(3,0,0)
static void
gimp_color_wheel_get_preferred_width (GtkWidget *widget,
gint *minimum_width,
@@ -353,23 +333,6 @@ gimp_color_wheel_get_preferred_height (GtkWidget *widget,
*minimum_height = *natural_height = DEFAULT_SIZE + 2 * (focus_width + focus_pad);
}
-#else
-static void
-gimp_color_wheel_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- gint focus_width;
- gint focus_pad;
-
- gtk_widget_style_get (widget,
- "focus-line-width", &focus_width,
- "focus-padding", &focus_pad,
- NULL);
-
- requisition->width = DEFAULT_SIZE + 2 * (focus_width + focus_pad);
- requisition->height = DEFAULT_SIZE + 2 * (focus_width + focus_pad);
-}
-#endif
static void
gimp_color_wheel_size_allocate (GtkWidget *widget,
@@ -688,7 +651,6 @@ set_cross_grab (GimpColorWheel *wheel,
gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (wheel)),
GDK_CROSSHAIR);
-#if GTK_CHECK_VERSION(3,0,0)
gdk_device_grab (gtk_get_current_event_device(),
priv->window,
GDK_OWNERSHIP_NONE,
@@ -698,14 +660,6 @@ set_cross_grab (GimpColorWheel *wheel,
GDK_BUTTON_RELEASE_MASK,
cursor, time);
g_object_unref (cursor);
-#else
- gdk_pointer_grab (priv->window, FALSE,
- GDK_POINTER_MOTION_MASK |
- GDK_POINTER_MOTION_HINT_MASK |
- GDK_BUTTON_RELEASE_MASK,
- NULL, cursor, time);
- gdk_cursor_unref (cursor);
-#endif
}
static gboolean gimp_color_wheel_grab_broken(GtkWidget *widget, GdkEventGrabBroken *event)
@@ -805,13 +759,8 @@ gimp_color_wheel_button_release (GtkWidget *widget,
else
g_assert_not_reached ();
-#if GTK_CHECK_VERSION(3,0,0)
gdk_device_ungrab (gtk_get_current_event_device(),
event->time);
-#else
- gdk_display_pointer_ungrab (gdk_window_get_display (event->window),
- event->time);
-#endif
return TRUE;
}
@@ -859,11 +808,7 @@ static void
paint_ring (GimpColorWheel *wheel,
cairo_t *cr)
{
-#if GTK_CHECK_VERSION(3,0,0)
GtkWidget *widget = GTK_WIDGET (wheel);
-#else
- GtkAllocation allocation;
-#endif
GimpColorWheelPrivate *priv = wheel->priv;
gint width, height;
gint xx, yy;
@@ -879,14 +824,8 @@ paint_ring (GimpColorWheel *wheel,
cairo_t *source_cr;
gint stride;
-#if GTK_CHECK_VERSION(3,0,0)
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);
-#else
- gtk_widget_get_allocation (GTK_WIDGET (wheel), &allocation);
- width = allocation.width;
- height = allocation.height;
-#endif
center_x = width / 2.0;
center_y = height / 2.0;
@@ -1027,19 +966,10 @@ paint_triangle (GimpColorWheel *wheel,
gdouble r, g, b;
gint stride;
gint width, height;
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context;
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);
-#else
- gchar *detail;
-
- GtkAllocation allocation;
- gtk_widget_get_allocation (widget, &allocation);
- width = allocation.width;
- height = allocation.height;
-#endif
/* Compute triangle's vertices */
@@ -1180,28 +1110,18 @@ paint_triangle (GimpColorWheel *wheel,
b = priv->v;
hsv_to_rgb (&r, &g, &b);
-#if GTK_CHECK_VERSION(3,0,0)
context = gtk_widget_get_style_context (widget);
gtk_style_context_save (context);
-#endif
if (INTENSITY (r, g, b) > 0.5)
{
-#if GTK_CHECK_VERSION(3,0,0)
gtk_style_context_add_class (context, "light-area-focus");
-#else
- detail = "colorwheel_light";
-#endif
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
}
else
{
-#if GTK_CHECK_VERSION(3,0,0)
gtk_style_context_add_class (context, "dark-area-focus");
-#else
- detail = "colorwheel_dark";
-#endif
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
}
@@ -1224,31 +1144,16 @@ paint_triangle (GimpColorWheel *wheel,
"focus-padding", &focus_pad,
NULL);
-#if GTK_CHECK_VERSION(3,0,0)
gtk_render_focus (context, cr,
xx - FOCUS_RADIUS - focus_width - focus_pad,
yy - FOCUS_RADIUS - focus_width - focus_pad,
2 * (FOCUS_RADIUS + focus_width + focus_pad),
2 * (FOCUS_RADIUS + focus_width + focus_pad));
-#else
- gtk_widget_get_allocation (widget, &allocation);
- gtk_paint_focus (gtk_widget_get_style (widget),
- gtk_widget_get_window (widget),
- gtk_widget_get_state (widget),
- NULL, widget, detail,
- allocation.x + xx - FOCUS_RADIUS - focus_width - focus_pad,
- allocation.y + yy - FOCUS_RADIUS - focus_width - focus_pad,
- 2 * (FOCUS_RADIUS + focus_width + focus_pad),
- 2 * (FOCUS_RADIUS + focus_width + focus_pad));
-#endif
}
-#if GTK_CHECK_VERSION(3,0,0)
gtk_style_context_restore (context);
-#endif
}
-#if GTK_CHECK_VERSION(3,0,0)
static gboolean
gimp_color_wheel_draw (GtkWidget *widget,
cairo_t *cr)
@@ -1273,48 +1178,6 @@ gimp_color_wheel_draw (GtkWidget *widget,
return FALSE;
}
-#else
-static gint
-gimp_color_wheel_expose (GtkWidget *widget,
- GdkEventExpose *event)
-{
- cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
-
- GimpColorWheel *wheel = GIMP_COLOR_WHEEL (widget);
- GimpColorWheelPrivate *priv = wheel->priv;
- gboolean draw_focus;
- GtkAllocation allocation;
-
- if (! (event->window == gtk_widget_get_window (widget) &&
- gtk_widget_is_drawable (widget)))
- return FALSE;
-
- gdk_cairo_region (cr, event->region);
- cairo_clip (cr);
-
- gtk_widget_get_allocation (widget, &allocation);
- cairo_translate (cr, allocation.x, allocation.y);
-
- draw_focus = gtk_widget_has_focus (widget);
-
- paint_ring (wheel, cr);
- paint_triangle (wheel, cr, draw_focus);
-
- cairo_destroy (cr);
-
- if (draw_focus && priv->focus_on_ring)
- gtk_paint_focus (gtk_widget_get_style (widget),
- gtk_widget_get_window (widget),
- gtk_widget_get_state (widget),
- &event->area, widget, NULL,
- allocation.x,
- allocation.y,
- allocation.width,
- allocation.height);
-
- return FALSE;
-}
-#endif
static gboolean
gimp_color_wheel_focus (GtkWidget *widget,
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index 7679fadb4..418cd13ae 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -1320,11 +1320,7 @@ RotateableSwatch::do_motion(double by, guint modifier) {
g_object_unref(pixbuf);
gdk_window_set_cursor(gtk_widget_get_window(w), cr);
-#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(cr);
-#else
- gdk_cursor_unref(cr);
-#endif
cr = NULL;
cr_set = true;
}
@@ -1388,11 +1384,7 @@ RotateableSwatch::do_release(double by, guint modifier) {
GtkWidget *w = GTK_WIDGET(gobj());
gdk_window_set_cursor(gtk_widget_get_window(w), NULL);
if (cr) {
-#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(cr);
-#else
- gdk_cursor_unref (cr);
-#endif
cr = NULL;
}
cr_set = false;
diff --git a/src/ui/widget/spinbutton.h b/src/ui/widget/spinbutton.h
index 30ffc7d77..ae571994b 100644
--- a/src/ui/widget/spinbutton.h
+++ b/src/ui/widget/spinbutton.h
@@ -36,11 +36,7 @@ public:
{
connect_signals();
};
-#if GTK_CHECK_VERSION(3,0,0)
explicit SpinButton(Glib::RefPtr<Gtk::Adjustment>& adjustment, double climb_rate = 0.0, guint digits = 0)
-#else
- explicit SpinButton(Gtk::Adjustment& adjustment, double climb_rate = 0.0, guint digits = 0)
-#endif
: Gtk::SpinButton(adjustment, climb_rate, digits),
_unit_menu(NULL),
_unit_tracker(NULL),