summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorAlexander Valavanis <valavanisalex@gmail.com>2019-05-26 15:11:07 +0000
committerAlexander Valavanis <valavanisalex@gmail.com>2019-05-26 15:11:07 +0000
commit630be8274013c5eef5f19e19a14bc6d759aada5a (patch)
tree6774d8db433426ab8361e18638869ad2336bf705 /src/ui/widget
parentRename wrong named function (diff)
downloadinkscape-630be8274013c5eef5f19e19a14bc6d759aada5a.tar.gz
inkscape-630be8274013c5eef5f19e19a14bc6d759aada5a.zip
Rm unused code now Gtk+ >= 3.22 dependency is set
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/color-icc-selector.cpp9
-rw-r--r--src/ui/widget/color-notebook.cpp15
-rw-r--r--src/ui/widget/color-scales.cpp15
-rw-r--r--src/ui/widget/color-slider.cpp16
-rw-r--r--src/ui/widget/font-variants.cpp36
-rw-r--r--src/ui/widget/frame.cpp6
-rw-r--r--src/ui/widget/labelled.cpp5
-rw-r--r--src/ui/widget/preferences-widget.cpp8
-rw-r--r--src/ui/widget/selected-style.cpp22
-rw-r--r--src/ui/widget/style-swatch.cpp12
10 files changed, 9 insertions, 135 deletions
diff --git a/src/ui/widget/color-icc-selector.cpp b/src/ui/widget/color-icc-selector.cpp
index 27c4b4bea..4862d6d03 100644
--- a/src/ui/widget/color-icc-selector.cpp
+++ b/src/ui/widget/color-icc-selector.cpp
@@ -86,23 +86,20 @@ std::set<cmsUInt32Number> knownColorspaces;
void attachToGridOrTable(GtkWidget *parent, GtkWidget *child, guint left, guint top, guint width, guint height,
bool hexpand = false, bool centered = false, guint xpadding = XPAD, guint ypadding = YPAD)
{
- #if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_start(child, xpadding);
gtk_widget_set_margin_end(child, xpadding);
- #else
- gtk_widget_set_margin_left(child, xpadding);
- gtk_widget_set_margin_right(child, xpadding);
- #endif
-
gtk_widget_set_margin_top(child, ypadding);
gtk_widget_set_margin_bottom(child, ypadding);
+
if (hexpand) {
gtk_widget_set_hexpand(child, TRUE);
}
+
if (centered) {
gtk_widget_set_halign(child, GTK_ALIGN_CENTER);
gtk_widget_set_valign(child, GTK_ALIGN_CENTER);
}
+
gtk_grid_attach(GTK_GRID(parent), child, left, top, width, height);
}
diff --git a/src/ui/widget/color-notebook.cpp b/src/ui/widget/color-notebook.cpp
index 67347d8a4..ca688c660 100644
--- a/src/ui/widget/color-notebook.cpp
+++ b/src/ui/widget/color-notebook.cpp
@@ -121,13 +121,8 @@ void ColorNotebook::_initUI()
sp_set_font_size_smaller(_buttonbox);
- #if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_start(_buttonbox, XPAD);
gtk_widget_set_margin_end(_buttonbox, XPAD);
- #else
- gtk_widget_set_margin_left(_buttonbox, XPAD);
- gtk_widget_set_margin_right(_buttonbox, XPAD);
- #endif
gtk_widget_set_margin_top(_buttonbox, YPAD);
gtk_widget_set_margin_bottom(_buttonbox, YPAD);
gtk_widget_set_hexpand(_buttonbox, TRUE);
@@ -136,13 +131,8 @@ void ColorNotebook::_initUI()
row++;
-#if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_start(_book, XPAD * 2);
gtk_widget_set_margin_end(_book, XPAD * 2);
-#else
- gtk_widget_set_margin_left(_book, XPAD * 2);
- gtk_widget_set_margin_right(_book, XPAD * 2);
-#endif
gtk_widget_set_margin_top(_book, YPAD);
gtk_widget_set_margin_bottom(_book, YPAD);
gtk_widget_set_hexpand(_book, TRUE);
@@ -208,13 +198,8 @@ void ColorNotebook::_initUI()
gtk_widget_hide(GTK_WIDGET(_box_toomuchink));
#endif // defined(HAVE_LIBLCMS2)
- #if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_start(rgbabox, XPAD);
gtk_widget_set_margin_end(rgbabox, XPAD);
- #else
- gtk_widget_set_margin_left(rgbabox, XPAD);
- gtk_widget_set_margin_right(rgbabox, XPAD);
- #endif
gtk_widget_set_margin_top(rgbabox, YPAD);
gtk_widget_set_margin_bottom(rgbabox, YPAD);
attach(*Glib::wrap(rgbabox), 0, row, 2, 1);
diff --git a/src/ui/widget/color-scales.cpp b/src/ui/widget/color-scales.cpp
index d68d19aec..03d5767a9 100644
--- a/src/ui/widget/color-scales.cpp
+++ b/src/ui/widget/color-scales.cpp
@@ -94,13 +94,8 @@ void ColorScales::_initUI(SPColorScalesMode mode)
gtk_widget_set_halign(_l[i], GTK_ALIGN_START);
gtk_widget_show(_l[i]);
- #if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_start(_l[i], XPAD);
gtk_widget_set_margin_end(_l[i], XPAD);
- #else
- gtk_widget_set_margin_left(_l[i], XPAD);
- gtk_widget_set_margin_right(_l[i], XPAD);
- #endif
gtk_widget_set_margin_top(_l[i], YPAD);
gtk_widget_set_margin_bottom(_l[i], YPAD);
gtk_grid_attach(GTK_GRID(t), _l[i], 0, i, 1, 1);
@@ -111,13 +106,8 @@ void ColorScales::_initUI(SPColorScalesMode mode)
_s[i] = Gtk::manage(new Inkscape::UI::Widget::ColorSlider(Glib::wrap(_a[i], true)));
_s[i]->show();
- #if GTK_CHECK_VERSION(3, 12, 0)
_s[i]->set_margin_start(XPAD);
_s[i]->set_margin_end(XPAD);
- #else
- _s[i]->set_margin_left(XPAD);
- _s[i]->set_margin_right(XPAD);
- #endif
_s[i]->set_margin_top(YPAD);
_s[i]->set_margin_bottom(YPAD);
_s[i]->set_hexpand(true);
@@ -129,13 +119,8 @@ void ColorScales::_initUI(SPColorScalesMode mode)
gtk_label_set_mnemonic_widget(GTK_LABEL(_l[i]), _b[i]);
gtk_widget_show(_b[i]);
- #if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_start(_b[i], XPAD);
gtk_widget_set_margin_end(_b[i], XPAD);
- #else
- gtk_widget_set_margin_left(_b[i], XPAD);
- gtk_widget_set_margin_right(_b[i], XPAD);
- #endif
gtk_widget_set_margin_top(_b[i], YPAD);
gtk_widget_set_margin_bottom(_b[i], YPAD);
gtk_widget_set_halign(_b[i], GTK_ALIGN_END);
diff --git a/src/ui/widget/color-slider.cpp b/src/ui/widget/color-slider.cpp
index a6a516774..2d190552a 100644
--- a/src/ui/widget/color-slider.cpp
+++ b/src/ui/widget/color-slider.cpp
@@ -160,7 +160,6 @@ bool ColorSlider::on_button_press_event(GdkEventButton *event)
auto window = _gdk_window->gobj();
-#if GTK_CHECK_VERSION(3,20,0)
auto seat = gdk_event_get_seat(reinterpret_cast<GdkEvent *>(event));
gdk_seat_grab(seat,
window,
@@ -170,16 +169,6 @@ bool ColorSlider::on_button_press_event(GdkEventButton *event)
reinterpret_cast<GdkEvent *>(event),
nullptr,
nullptr);
-#else
- auto device = gdk_event_get_device(reinterpret_cast<GdkEvent *>(event));
- gdk_device_grab(device,
- window,
- GDK_OWNERSHIP_NONE,
- FALSE,
- static_cast<GdkEventMask>(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK),
- NULL,
- event->time);
-#endif
}
return false;
@@ -188,12 +177,7 @@ bool ColorSlider::on_button_press_event(GdkEventButton *event)
bool ColorSlider::on_button_release_event(GdkEventButton *event)
{
if (event->button == 1) {
-#if GTK_CHECK_VERSION(3,20,0)
gdk_seat_ungrab(gdk_event_get_seat(reinterpret_cast<GdkEvent *>(event)));
-#else
- gdk_device_ungrab(gdk_event_get_device(reinterpret_cast<GdkEvent *>(event)),
- gdk_event_get_time(reinterpret_cast<GdkEvent *>(event)));
-#endif
_dragging = false;
signal_released.emit();
if (_value != _oldvalue) {
diff --git a/src/ui/widget/font-variants.cpp b/src/ui/widget/font-variants.cpp
index b4f991863..26d30652b 100644
--- a/src/ui/widget/font-variants.cpp
+++ b/src/ui/widget/font-variants.cpp
@@ -221,13 +221,9 @@ namespace Widget {
_ligatures_grid.attach( _ligatures_label_historical, 1, 2, 1, 1);
_ligatures_grid.attach( _ligatures_label_contextual, 1, 3, 1, 1);
-#if GTK_CHECK_VERSION(3,12,0)
_ligatures_grid.set_margin_start(15);
_ligatures_grid.set_margin_end(15);
-#else
- _ligatures_grid.set_margin_left(15);
- _ligatures_grid.set_margin_right(15);
-#endif
+
_ligatures_frame.add( _ligatures_grid );
pack_start( _ligatures_frame, Gtk::PACK_SHRINK );
@@ -255,13 +251,9 @@ namespace Widget {
_position_grid.attach( _position_sub, 1, 0, 1, 1);
_position_grid.attach( _position_super, 2, 0, 1, 1);
-#if GTK_CHECK_VERSION(3,12,0)
_position_grid.set_margin_start(15);
_position_grid.set_margin_end(15);
-#else
- _position_grid.set_margin_left(15);
- _position_grid.set_margin_right(15);
-#endif
+
_position_frame.add( _position_grid );
pack_start( _position_frame, Gtk::PACK_SHRINK );
@@ -305,13 +297,9 @@ namespace Widget {
_caps_grid.attach( _caps_petite, 2, 1, 1, 1);
_caps_grid.attach( _caps_all_petite, 3, 1, 1, 1);
-#if GTK_CHECK_VERSION(3,12,0)
_caps_grid.set_margin_start(15);
_caps_grid.set_margin_end(15);
-#else
- _caps_grid.set_margin_left(15);
- _caps_grid.set_margin_right(15);
-#endif
+
_caps_frame.add( _caps_grid );
pack_start( _caps_frame, Gtk::PACK_SHRINK );
@@ -383,13 +371,9 @@ namespace Widget {
_numeric_grid.attach (_numeric_slashed_zero, 0, 4, 1, 1);
_numeric_grid.attach (_numeric_slashed_zero_label, 1, 4, 1, 1);
-#if GTK_CHECK_VERSION(3,12,0)
_numeric_grid.set_margin_start(15);
_numeric_grid.set_margin_end(15);
-#else
- _numeric_grid.set_margin_left(15);
- _numeric_grid.set_margin_right(15);
-#endif
+
_numeric_frame.add( _numeric_grid );
pack_start( _numeric_frame, Gtk::PACK_SHRINK );
@@ -434,13 +418,9 @@ namespace Widget {
_asian_grid.attach (_asian_proportional_width, 2, 3, 1, 1);
_asian_grid.attach (_asian_ruby, 0, 4, 1, 1);
-#if GTK_CHECK_VERSION(3,12,0)
_asian_grid.set_margin_start(15);
_asian_grid.set_margin_end(15);
-#else
- _asian_grid.set_margin_left(15);
- _asian_grid.set_margin_right(15);
-#endif
+
_asian_frame.add( _asian_grid );
pack_start( _asian_frame, Gtk::PACK_SHRINK );
@@ -476,13 +456,9 @@ namespace Widget {
_feature_vbox.pack_start( _feature_substitutions );
_feature_vbox.pack_start( _feature_list );
-#if GTK_CHECK_VERSION(3,12,0)
_feature_vbox.set_margin_start(15);
_feature_vbox.set_margin_end(15);
-#else
- _feature_vbox.set_margin_left(15);
- _feature_vbox.set_margin_right(15);
-#endif
+
_feature_frame.add( _feature_vbox );
pack_start( _feature_frame, Gtk::PACK_SHRINK );
diff --git a/src/ui/widget/frame.cpp b/src/ui/widget/frame.cpp
index 34ed38eb7..eac4e221b 100644
--- a/src/ui/widget/frame.cpp
+++ b/src/ui/widget/frame.cpp
@@ -53,14 +53,8 @@ Frame::set_padding (guint padding_top, guint padding_bottom, guint padding_left,
{
child->set_margin_top(padding_top);
child->set_margin_bottom(padding_bottom);
-
-#if GTK_CHECK_VERSION(3,12,0)
child->set_margin_start(padding_left);
child->set_margin_end(padding_right);
-#else
- child->set_margin_left(padding_left);
- child->set_margin_right(padding_right);
-#endif
}
}
diff --git a/src/ui/widget/labelled.cpp b/src/ui/widget/labelled.cpp
index 83d2684aa..b320b70af 100644
--- a/src/ui/widget/labelled.cpp
+++ b/src/ui/widget/labelled.cpp
@@ -35,13 +35,8 @@ Labelled::Labelled(Glib::ustring const &label, Glib::ustring const &tooltip,
set_spacing(6);
// Setting margins separately allows for more control over them
-#if GTK_CHECK_VERSION(3,12,0)
set_margin_start(6);
set_margin_end(6);
-#else
- set_margin_left(6);
- set_margin_right(6);
-#endif
pack_start(*Gtk::manage(_label), Gtk::PACK_SHRINK);
pack_start(*Gtk::manage(_widget), Gtk::PACK_SHRINK);
if (mnemonic) {
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index 7e79abb5b..0ba641098 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -99,11 +99,7 @@ void DialogPage::add_line(bool indent,
label_widget->set_markup(label_widget->get_text());
if (indent) {
-#if GTKMM_CHECK_VERSION(3,12,0)
label_widget->set_margin_start(12);
-#else
- label_widget->set_margin_left(12);
-#endif
}
label_widget->set_valign(Gtk::ALIGN_CENTER);
@@ -115,11 +111,7 @@ void DialogPage::add_line(bool indent,
if (label == "")
{
if (indent) {
-#if GTKMM_CHECK_VERSION(3,12,0)
hb->set_margin_start(12);
-#else
- hb->set_margin_left(12);
-#endif
}
add(*hb);
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index b7437c031..ea053765b 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -158,22 +158,12 @@ SelectedStyle::SelectedStyle(bool /*layout*/)
_stroke_width.set_name("monoStrokeWidth");
_fill_empty_space.set_name("fillEmptySpace");
-
-#if GTK_CHECK_VERSION(3,12,0)
_fill_label.set_margin_start(0);
_fill_label.set_margin_end(0);
_stroke_label.set_margin_start(0);
_stroke_label.set_margin_end(0);
_opacity_label.set_margin_start(0);
_opacity_label.set_margin_end(0);
-#else
- _fill_label.set_margin_left(0);
- _fill_label.set_margin_right(0);
- _stroke_label.set_margin_left(0);
- _stroke_label.set_margin_right(0);
- _opacity_label.set_margin_left(0);
- _opacity_label.set_margin_right(0);
-#endif
_table.set_column_spacing(2);
_table.set_row_spacing(0);
@@ -834,11 +824,7 @@ SelectedStyle::on_fill_click(GdkEventButton *event)
fs->showPageFill();
} else if (event->button == 3) { // right-click, popup menu
-#if GTKMM_CHECK_VERSION(3,22,0)
_popup[SS_FILL].popup_at_pointer(reinterpret_cast<GdkEvent *>(event));
-#else
- _popup[SS_FILL].popup(event->button, event->time);
-#endif
} else if (event->button == 2) { // middle click, toggle none/lastcolor
if (_mode[SS_FILL] == SS_NONE) {
on_fill_lastused();
@@ -856,11 +842,7 @@ SelectedStyle::on_stroke_click(GdkEventButton *event)
if (Dialog::FillAndStroke *fs = get_fill_and_stroke_panel(_desktop))
fs->showPageStrokePaint();
} else if (event->button == 3) { // right-click, popup menu
-#if GTKMM_CHECK_VERSION(3,22,0)
_popup[SS_STROKE].popup_at_pointer(reinterpret_cast<GdkEvent *>(event));
-#else
- _popup[SS_STROKE].popup(event->button, event->time);
-#endif
} else if (event->button == 2) { // middle click, toggle none/lastcolor
if (_mode[SS_STROKE] == SS_NONE) {
on_stroke_lastused();
@@ -878,11 +860,7 @@ SelectedStyle::on_sw_click(GdkEventButton *event)
if (Dialog::FillAndStroke *fs = get_fill_and_stroke_panel(_desktop))
fs->showPageStrokeStyle();
} else if (event->button == 3) { // right-click, popup menu
-#if GTKMM_CHECK_VERSION(3,22,0)
_popup_sw.popup_at_pointer(reinterpret_cast<GdkEvent *>(event));
-#else
- _popup_sw.popup(event->button, event->time);
-#endif
} else if (event->button == 2) { // middle click, toggle none/lastwidth?
//
}
diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp
index 97b801547..1d8da2091 100644
--- a/src/ui/widget/style-swatch.cpp
+++ b/src/ui/widget/style-swatch.cpp
@@ -125,14 +125,8 @@ StyleSwatch::StyleSwatch(SPCSSAttr *css, gchar const *main_tip)
_label[i].set_valign(Gtk::ALIGN_CENTER);
_label[i].set_margin_top(0);
_label[i].set_margin_bottom(0);
-
-#if GTK_CHECK_VERSION(3,12,0)
_label[i].set_margin_start(0);
_label[i].set_margin_end(0);
-#else
- _label[i].set_margin_left(0);
- _label[i].set_margin_right(0);
-#endif
_color_preview[i] = new Inkscape::UI::Widget::ColorPreview (0);
}
@@ -141,14 +135,8 @@ StyleSwatch::StyleSwatch(SPCSSAttr *css, gchar const *main_tip)
_opacity_value.set_valign(Gtk::ALIGN_CENTER);
_opacity_value.set_margin_top(0);
_opacity_value.set_margin_bottom(0);
-
-#if GTK_CHECK_VERSION(3,12,0)
_opacity_value.set_margin_start(0);
_opacity_value.set_margin_end(0);
-#else
- _opacity_value.set_margin_left(0);
- _opacity_value.set_margin_right(0);
-#endif
_table->set_column_spacing(2);
_table->set_row_spacing(0);