summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/inkscape-preferences.cpp
diff options
context:
space:
mode:
authorkamalpreetgrewal <grewalkamal005@gmail.com>2016-08-15 03:59:18 +0000
committerkamalpreetgrewal <grewalkamal005@gmail.com>2016-08-15 03:59:18 +0000
commit25a9ed4f38121eeb59cf15dbf19391aaef45bba3 (patch)
treee123aeae50d98a52e1ad4575b29bf3c199619e33 /src/ui/dialog/inkscape-preferences.cpp
parentSolve crash when deleting CSS property (diff)
parentinkview: Convert to ApplicationWindow (diff)
downloadinkscape-25a9ed4f38121eeb59cf15dbf19391aaef45bba3.tar.gz
inkscape-25a9ed4f38121eeb59cf15dbf19391aaef45bba3.zip
Merge changes from trunk
(bzr r14949.1.64)
Diffstat (limited to 'src/ui/dialog/inkscape-preferences.cpp')
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp42
1 files changed, 5 insertions, 37 deletions
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 2f4ac8606..4574e93fe 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -78,12 +78,8 @@ InkscapePreferences::InkscapePreferences()
_getContents()->add(*sb);
show_all_children();
Gtk::Requisition sreq;
-#if WITH_GTKMM_3_0
Gtk::Requisition sreq_natural;
sb->get_preferred_size(sreq_natural, sreq);
-#else
- sreq = sb->size_request();
-#endif
_sb_width = sreq.width;
_getContents()->remove(*sb);
delete sb;
@@ -855,17 +851,10 @@ static void proofComboChanged( Gtk::ComboBoxText* combo )
}
static void gamutColorChanged( Gtk::ColorButton* btn ) {
-#if WITH_GTKMM_3_0
- Gdk::RGBA rgba = btn->get_rgba();
- gushort r = rgba.get_red_u();
- gushort g = rgba.get_green_u();
- gushort b = rgba.get_blue_u();
-#else
- Gdk::Color color = btn->get_color();
- gushort r = color.get_red();
- gushort g = color.get_green();
- gushort b = color.get_blue();
-#endif
+ auto rgba = btn->get_rgba();
+ auto r = rgba.get_red_u();
+ auto g = rgba.get_green_u();
+ auto b = rgba.get_blue_u();
gchar* tmp = g_strdup_printf("#%02x%02x%02x", (r >> 8), (g >> 8), (b >> 8) );
@@ -1035,13 +1024,8 @@ void InkscapePreferences::initPageIO()
Glib::ustring colorStr = prefs->getString("/options/softproof/gamutcolor");
-#if WITH_GTKMM_3_0
Gdk::RGBA tmpColor( colorStr.empty() ? "#00ff00" : colorStr);
_cms_gamutcolor.set_rgba( tmpColor );
-#else
- Gdk::Color tmpColor( colorStr.empty() ? "#00ff00" : colorStr);
- _cms_gamutcolor.set_color( tmpColor );
-#endif
_page_cms.add_line( true, _("Out of gamut warning color:"), _cms_gamutcolor, "",
_("Selects the color used for out of gamut warning"), false);
@@ -1586,31 +1570,19 @@ void InkscapePreferences::initKeyboardShortcuts(Gtk::TreeModel::iterator iter_ui
int row = 3;
-#if WITH_GTKMM_3_0
scroller->set_hexpand();
scroller->set_vexpand();
_page_keyshortcuts.attach(*scroller, 0, row, 2, 1);
-#else
- _page_keyshortcuts.attach(*scroller, 0, 2, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL);
-#endif
row++;
-#if WITH_GTKMM_3_0
- Gtk::ButtonBox *box_buttons = Gtk::manage(new Gtk::ButtonBox);
-#else
- Gtk::HButtonBox *box_buttons = Gtk::manage (new Gtk::HButtonBox);
-#endif
+ auto box_buttons = Gtk::manage(new Gtk::ButtonBox);
box_buttons->set_layout(Gtk::BUTTONBOX_END);
box_buttons->set_spacing(4);
-#if WITH_GTKMM_3_0
box_buttons->set_hexpand();
_page_keyshortcuts.attach(*box_buttons, 0, row, 3, 1);
-#else
- _page_keyshortcuts.attach(*box_buttons, 0, 3, row, row+1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK);
-#endif
UI::Widget::Button *kb_reset = Gtk::manage(new UI::Widget::Button(_("Reset"), _("Remove all your customized keyboard shortcuts, and revert to the shortcuts in the shortcut file listed above")));
box_buttons->pack_start(*kb_reset, true, true, 6);
@@ -2043,12 +2015,8 @@ bool InkscapePreferences::SetMaxDialogSize(const Gtk::TreeModel::iterator& iter)
_page_frame.add(*page);
this->show_all_children();
Gtk::Requisition sreq;
-#if WITH_GTKMM_3_0
Gtk::Requisition sreq_natural;
this->get_preferred_size(sreq_natural, sreq);
-#else
- sreq = this->size_request();
-#endif
_max_dialog_width=std::max(_max_dialog_width, sreq.width);
_max_dialog_height=std::max(_max_dialog_height, sreq.height);
_page_frame.remove();