summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2013-03-08 00:43:48 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2013-03-08 00:43:48 +0000
commitcafc767ad5c5fbb7bf993b298223eba6714ecd78 (patch)
tree38c965e0172ec16ebd531f546c68a2f7d5c46089 /src/ui/dialog
parentFix deprecated Gtkmm symbols in preferences widget (diff)
downloadinkscape-cafc767ad5c5fbb7bf993b298223eba6714ecd78.tar.gz
inkscape-cafc767ad5c5fbb7bf993b298223eba6714ecd78.zip
Switch to orientable Scale widgets in Gtkmm 3
(bzr r12179)
Diffstat (limited to 'src/ui/dialog')
-rw-r--r--src/ui/dialog/svg-fonts-dialog.cpp21
-rw-r--r--src/ui/dialog/svg-fonts-dialog.h16
2 files changed, 28 insertions, 9 deletions
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp
index be69635e8..0da39dd73 100644
--- a/src/ui/dialog/svg-fonts-dialog.cpp
+++ b/src/ui/dialog/svg-fonts-dialog.cpp
@@ -22,6 +22,7 @@
#include "document-undo.h"
#include <gtkmm/notebook.h>
#include <gtkmm/imagemenuitem.h>
+#include <gtkmm/scale.h>
#include <gtkmm/stock.h>
#include <glibmm/i18n.h>
#include <message-stack.h>
@@ -191,7 +192,7 @@ void SvgFontsDialog::on_kerning_value_changed(){
//slider values increase from right to left so that they match the kerning pair preview
//XML Tree being directly used here while it shouldn't be.
- this->kerning_pair->getRepr()->setAttribute("k", Glib::Ascii::dtostr(get_selected_spfont()->horiz_adv_x - kerning_slider.get_value()).c_str());
+ this->kerning_pair->getRepr()->setAttribute("k", Glib::Ascii::dtostr(get_selected_spfont()->horiz_adv_x - kerning_slider->get_value()).c_str());
DocumentUndo::maybeDone(document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS, _("Adjust kerning value"));
//populate_kerning_pairs_box();
@@ -299,7 +300,7 @@ void SvgFontsDialog::on_kerning_pair_selection_changed(){
this->kerning_pair = kern;
//slider values increase from right to left so that they match the kerning pair preview
- kerning_slider.set_value(get_selected_spfont()->horiz_adv_x - kern->k);
+ kerning_slider->set_value(get_selected_spfont()->horiz_adv_x - kern->k);
}
void SvgFontsDialog::update_global_settings_tab(){
@@ -328,9 +329,9 @@ void SvgFontsDialog::on_font_selection_changed(){
double set_width = spfont->horiz_adv_x;
setwidth_spin.set_value(set_width);
- kerning_slider.set_range(0, set_width);
- kerning_slider.set_draw_value(false);
- kerning_slider.set_value(0);
+ kerning_slider->set_range(0, set_width);
+ kerning_slider->set_draw_value(false);
+ kerning_slider->set_value(0);
update_global_settings_tab();
populate_glyphs_box();
@@ -779,7 +780,7 @@ Gtk::VBox* SvgFontsDialog::kerning_tab(){
add_kernpair_button.set_label(_("Add pair"));
add_kernpair_button.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::add_kerning_pair));
_KerningPairsList.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_kerning_pair_selection_changed));
- kerning_slider.signal_value_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_kerning_value_changed));
+ kerning_slider->signal_value_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_kerning_value_changed));
kerning_vbox.pack_start(*kerning_selector, false,false);
@@ -797,7 +798,7 @@ Gtk::VBox* SvgFontsDialog::kerning_tab(){
Gtk::HBox* kerning_amount_hbox = Gtk::manage(new Gtk::HBox());
kerning_vbox.pack_start(*kerning_amount_hbox, false,false);
kerning_amount_hbox->add(*Gtk::manage(new Gtk::Label(_("Kerning value:"))));
- kerning_amount_hbox->add(kerning_slider);
+ kerning_amount_hbox->add(*kerning_slider);
kerning_preview.set_size(300 + 20, 150 + 20);
_font_da.set_size(150 + 20, 50 + 20);
@@ -884,6 +885,12 @@ void SvgFontsDialog::add_font(){
SvgFontsDialog::SvgFontsDialog()
: UI::Widget::Panel("", "/dialogs/svgfonts", SP_VERB_DIALOG_SVG_FONTS), _add(Gtk::Stock::NEW)
{
+#if WITH_GTKMM_3_0
+ kerning_slider = Gtk::manage(new Gtk::Scale(Gtk::ORIENTATION_HORIZONTAL));
+#else
+ kerning_slider = Gtk::manage(new Gtk::HScale);
+#endif
+
_add.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::add_font));
Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox());
diff --git a/src/ui/dialog/svg-fonts-dialog.h b/src/ui/dialog/svg-fonts-dialog.h
index 910f79d4c..9be984820 100644
--- a/src/ui/dialog/svg-fonts-dialog.h
+++ b/src/ui/dialog/svg-fonts-dialog.h
@@ -20,13 +20,20 @@
#include <gtkmm/drawingarea.h>
#include <gtkmm/entry.h>
#include <gtkmm/liststore.h>
-#include <gtkmm/scale.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/treeview.h>
#include "attributes.h"
#include "xml/helper-observer.h"
+namespace Gtk {
+#if WITH_GTKMM_3_0
+class Scale;
+#else
+class HScale;
+#endif
+}
+
class SPGlyph;
class SPGlyphKerning;
class SvgFont;
@@ -210,7 +217,12 @@ private:
GlyphComboBox first_glyph, second_glyph;
SPGlyphKerning* kerning_pair;
Inkscape::UI::Widget::SpinButton setwidth_spin;
- Gtk::HScale kerning_slider;
+
+#if WITH_GTKMM_3_0
+ Gtk::Scale* kerning_slider;
+#else
+ Gtk::HScale* kerning_slider;
+#endif
class EntryWidget : public Gtk::HBox
{