summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/zoom-status.cpp
diff options
context:
space:
mode:
authorDenis Declara <declara91@gmail.com>2012-05-05 13:32:42 +0000
committerDenis Declara <declara91@gmail.com>2012-05-05 13:32:42 +0000
commitaeb9c1bde66de096910757abb17dedb94ad74207 (patch)
treec0adf97685b0fa8af1553b14d20601f280492762 /src/ui/widget/zoom-status.cpp
parentFixed some math, so that the objects now line up correctly (diff)
parentAdding checks to prevent null pointer dereferences (diff)
downloadinkscape-aeb9c1bde66de096910757abb17dedb94ad74207.tar.gz
inkscape-aeb9c1bde66de096910757abb17dedb94ad74207.zip
Trunk merge
(bzr r11073.1.29)
Diffstat (limited to 'src/ui/widget/zoom-status.cpp')
-rw-r--r--src/ui/widget/zoom-status.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ui/widget/zoom-status.cpp b/src/ui/widget/zoom-status.cpp
index 579449744..aea1beb17 100644
--- a/src/ui/widget/zoom-status.cpp
+++ b/src/ui/widget/zoom-status.cpp
@@ -23,7 +23,11 @@ namespace UI {
namespace Widget {
ZoomStatus::ZoomStatus()
+#if WITH_GTKMM_3_0
+ : _adj(Gtk::Adjustment::create(0.0, -1.0, 1.0, 0.1, 0.1))
+#else
: _adj(0.0, -1.0, 1.0, 0.1, 0.1)
+#endif
{
_dt = 0;
_upd_f = false;
@@ -43,11 +47,19 @@ ZoomStatus::init(SPDesktop *dt)
{
_dt = dt;
property_digits() = 4;
+#if WITH_GTKMM_3_0
+ _adj->set_value(0.0);
+ _adj->set_lower(log(SP_DESKTOP_ZOOM_MIN)/log(2.0));
+ _adj->set_upper(log(SP_DESKTOP_ZOOM_MAX)/log(2.0));
+ _adj->set_step_increment(0.1);
+ _adj->set_page_increment(0.1);
+#else
_adj.set_value(0.0);
_adj.set_lower(log(SP_DESKTOP_ZOOM_MIN)/log(2.0));
_adj.set_upper(log(SP_DESKTOP_ZOOM_MAX)/log(2.0));
_adj.set_step_increment(0.1);
_adj.set_page_increment(0.1);
+#endif
set_adjustment(_adj);
}