summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/preferences-widget.cpp
diff options
context:
space:
mode:
authorMichael Soegtrop <MSoegtrop@yahoo.de>2017-06-05 13:01:17 +0000
committerMichael Soegtrop <MSoegtrop@yahoo.de>2017-06-05 13:01:17 +0000
commite7248b2fa042f42a5c4dd14cd86ab6a5b4524059 (patch)
tree9097520c54e355ded9bd0b4d6618af4e8dacdd91 /src/ui/widget/preferences-widget.cpp
parentupdated to latest trunk (diff)
parent[Bug #1695016] Xaml export misses some radialGradients. (diff)
downloadinkscape-e7248b2fa042f42a5c4dd14cd86ab6a5b4524059.tar.gz
inkscape-e7248b2fa042f42a5c4dd14cd86ab6a5b4524059.zip
updated to latest trunk
(bzr r14876.2.4)
Diffstat (limited to 'src/ui/widget/preferences-widget.cpp')
-rw-r--r--src/ui/widget/preferences-widget.cpp94
1 files changed, 7 insertions, 87 deletions
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index d56506d62..b2cebcaa6 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -11,14 +11,13 @@
*/
#ifdef HAVE_CONFIG_H
-# include <config.h>
+#include <config.h>
#endif
#include <gtkmm/box.h>
#include <gtkmm/frame.h>
#include <gtkmm/alignment.h>
#include <gtkmm/scale.h>
-#include <gtkmm/stock.h>
#include <gtkmm/table.h>
#include "preferences.h"
@@ -26,20 +25,16 @@
#include "verbs.h"
#include "selcue.h"
#include "io/sys.h"
-#include <iostream>
#include "desktop.h"
-#include "enums.h"
#include "inkscape.h"
#include "message-stack.h"
#include "style.h"
-#include "selection.h"
#include "selection-chemistry.h"
#include "ui/dialog/filedialog.h"
-#include "xml/repr.h"
-#include <glibmm/convert.h>
#include <glibmm/i18n.h>
+#include <glibmm/convert.h>
#ifdef WIN32
#include <windows.h>
@@ -55,14 +50,9 @@ DialogPage::DialogPage()
{
set_border_width(12);
-#if WITH_GTKMM_3_0
set_orientation(Gtk::ORIENTATION_VERTICAL);
set_column_spacing(12);
set_row_spacing(6);
-#else
- set_col_spacings(12);
- set_row_spacings(6);
-#endif
}
/**
@@ -101,12 +91,7 @@ void DialogPage::add_line(bool indent,
// be indented if desired
Gtk::Alignment* w_alignment = Gtk::manage(new Gtk::Alignment());
w_alignment->add(*hb);
-
-#if WITH_GTKMM_3_0
w_alignment->set_valign(Gtk::ALIGN_CENTER);
-#else
- guint row = property_n_rows();
-#endif
// Add a label in the first column if provided
if (label != "")
@@ -122,17 +107,12 @@ void DialogPage::add_line(bool indent,
if (indent)
label_alignment->set_padding(0, 0, 12, 0);
-#if WITH_GTKMM_3_0
label_alignment->set_valign(Gtk::ALIGN_CENTER);
add(*label_alignment);
attach_next_to(*w_alignment, *label_alignment, Gtk::POS_RIGHT, 1, 1);
-#else
- attach(*label_alignment, 0, 1, row, row + 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
-#endif
}
// Now add the widget to the bottom of the dialog
-#if WITH_GTKMM_3_0
if (label == "")
{
if (indent)
@@ -145,17 +125,6 @@ void DialogPage::add_line(bool indent,
g_value_set_int(&width, 2);
gtk_container_child_set_property(GTK_CONTAINER(gobj()), GTK_WIDGET(w_alignment->gobj()), "width", &width);
}
-#else
- // The widget should span two columns if there is no label
- int w_col_span = 1;
- if (label == "")
- w_col_span = 2;
-
- attach(*w_alignment, 2 - w_col_span, 2, row, row + 1,
- Gtk::FILL | Gtk::EXPAND,
- Gtk::AttachOptions(),
- 0, 0);
-#endif
// Add a label on the right of the widget if desired
if (suffix != "")
@@ -174,18 +143,8 @@ void DialogPage::add_group_header(Glib::ustring name)
Glib::ustring("</b>"/*</span>"*/) , Gtk::ALIGN_START , Gtk::ALIGN_CENTER, true));
label_widget->set_use_markup(true);
-
-#if WITH_GTKMM_3_0
label_widget->set_valign(Gtk::ALIGN_CENTER);
add(*label_widget);
-// if (row != 1)
- // set_row_spacing(row - 1, 18);
-#else
- int row = property_n_rows();
- attach(*label_widget , 0, 4, row, row + 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
- if (row != 1)
- set_row_spacing(row - 1, 18);
-#endif
}
}
@@ -427,24 +386,6 @@ ZoomCorrRuler::draw_marks(Cairo::RefPtr<Cairo::Context> cr, double dist, int maj
}
}
-#if !WITH_GTKMM_3_0
-bool
-ZoomCorrRuler::on_expose_event(GdkEventExpose *event) {
- bool result = false;
-
- if(get_is_drawable())
- {
- Cairo::RefPtr<Cairo::Context> cr = get_window()->create_cairo_context();
- cr->rectangle(event->area.x, event->area.y,
- event->area.width, event->area.height);
- cr->clip();
- result = on_draw(cr);
- }
-
- return result;
-}
-#endif
-
bool
ZoomCorrRuler::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) {
Glib::RefPtr<Gdk::Window> window = get_window();
@@ -548,11 +489,7 @@ ZoomCorrRulerSlider::init(int ruler_width, int ruler_height, double lower, doubl
_ruler.set_size(ruler_width, ruler_height);
-#if WITH_GTKMM_3_0
_slider = Gtk::manage(new Gtk::Scale(Gtk::ORIENTATION_HORIZONTAL));
-#else
- _slider = Gtk::manage(new Gtk::HScale());
-#endif
_slider->set_size_request(_ruler.width(), -1);
_slider->set_range (lower, upper);
@@ -579,21 +516,13 @@ ZoomCorrRulerSlider::init(int ruler_width, int ruler_height, double lower, doubl
alignment1->add(_sb);
alignment2->add(_unit);
-#if WITH_GTKMM_3_0
- Gtk::Grid *table = Gtk::manage(new Gtk::Grid());
+ auto table = Gtk::manage(new Gtk::Grid());
table->attach(*_slider, 0, 0, 1, 1);
alignment1->set_halign(Gtk::ALIGN_CENTER);
table->attach(*alignment1, 1, 0, 1, 1);
table->attach(_ruler, 0, 1, 1, 1);
alignment2->set_halign(Gtk::ALIGN_CENTER);
table->attach(*alignment2, 1, 1, 1, 1);
-#else
- Gtk::Table *table = Gtk::manage(new Gtk::Table());
- table->attach(*_slider, 0, 1, 0, 1);
- table->attach(*alignment1, 1, 2, 0, 1, static_cast<Gtk::AttachOptions>(0));
- table->attach(_ruler, 0, 1, 1, 2);
- table->attach(*alignment2, 1, 2, 1, 2, static_cast<Gtk::AttachOptions>(0));
-#endif
pack_start(*table, Gtk::PACK_SHRINK);
}
@@ -640,11 +569,7 @@ PrefSlider::init(Glib::ustring const &prefs_path,
freeze = false;
-#if WITH_GTKMM_3_0
_slider = Gtk::manage(new Gtk::Scale(Gtk::ORIENTATION_HORIZONTAL));
-#else
- _slider = Gtk::manage(new Gtk::HScale());
-#endif
_slider->set_range (lower, upper);
_slider->set_increments (step_increment, page_increment);
@@ -661,17 +586,11 @@ PrefSlider::init(Glib::ustring const &prefs_path,
Gtk::Alignment *alignment1 = Gtk::manage(new Gtk::Alignment(0.5,1,0,0));
alignment1->add(_sb);
-#if WITH_GTKMM_3_0
- Gtk::Grid *table = Gtk::manage(new Gtk::Grid());
+ auto table = Gtk::manage(new Gtk::Grid());
_slider->set_hexpand();
table->attach(*_slider, 0, 0, 1, 1);
alignment1->set_halign(Gtk::ALIGN_CENTER);
table->attach(*alignment1, 1, 0, 1, 1);
-#else
- Gtk::Table *table = Gtk::manage(new Gtk::Table());
- table->attach(*_slider, 0, 1, 0, 1);
- table->attach(*alignment1, 1, 2, 0, 1, static_cast<Gtk::AttachOptions>(0));
-#endif
this->pack_start(*table, Gtk::PACK_EXPAND_WIDGET);
}
@@ -788,8 +707,9 @@ void PrefEntryFileButtonHBox::init(Glib::ustring const &prefs_path,
relatedButton = new Gtk::Button();
Gtk::HBox* pixlabel = new Gtk::HBox(false, 3);
- Gtk::Image *im = new Gtk::Image(Gtk::StockID(Gtk::Stock::INDEX),
- Gtk::ICON_SIZE_BUTTON);
+ Gtk::Image *im = new Gtk::Image();
+ im->set_from_icon_name("applications-graphics",
+ Gtk::ICON_SIZE_BUTTON);
pixlabel->pack_start(*im);
Gtk::Label *l = new Gtk::Label();
l->set_markup_with_mnemonic(_("_Browse..."));