summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2019-07-22 00:59:51 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2019-08-02 21:26:28 +0000
commit88fea892272f0ac5508bf6c868c7f292ebcf1460 (patch)
tree18dbbd8d7074dbb607218101914ab162306fdc41 /src/ui/widget
parentfix a toggle of unit selection (diff)
downloadinkscape-88fea892272f0ac5508bf6c868c7f292ebcf1460.tar.gz
inkscape-88fea892272f0ac5508bf6c868c7f292ebcf1460.zip
Add lineheight proposal
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/combo-tool-item.cpp3
-rw-r--r--src/ui/widget/spinbutton.cpp27
-rw-r--r--src/ui/widget/spinbutton.h4
3 files changed, 2 insertions, 32 deletions
diff --git a/src/ui/widget/combo-tool-item.cpp b/src/ui/widget/combo-tool-item.cpp
index 4da817131..6adafe316 100644
--- a/src/ui/widget/combo-tool-item.cpp
+++ b/src/ui/widget/combo-tool-item.cpp
@@ -54,8 +54,7 @@ ComboToolItem::ComboToolItem(Glib::ustring group_label,
_use_pixbuf (true),
_icon_size ( Gtk::ICON_SIZE_LARGE_TOOLBAR ),
_combobox (nullptr),
- _menuitem (nullptr),
- _active(0)
+ _menuitem (nullptr)
{
Gtk::Box* box = Gtk::manage(new Gtk::Box());
add(*box);
diff --git a/src/ui/widget/spinbutton.cpp b/src/ui/widget/spinbutton.cpp
index 677072c6b..c633035cf 100644
--- a/src/ui/widget/spinbutton.cpp
+++ b/src/ui/widget/spinbutton.cpp
@@ -9,11 +9,10 @@
*/
#include "spinbutton.h"
-#include "ui/tools/tool-base.h"
#include "unit-menu.h"
#include "unit-tracker.h"
#include "util/expression-evaluator.h"
-#include <cmath>
+#include "ui/tools/tool-base.h"
namespace Inkscape {
namespace UI {
@@ -27,10 +26,7 @@ SpinButton::connect_signals() {
signal_key_press_event().connect(sigc::mem_fun(*this, &SpinButton::on_my_key_press_event));
gtk_widget_add_events(GTK_WIDGET(gobj()), GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK);
signal_scroll_event().connect(sigc::mem_fun(*this, &SpinButton::on_scroll_event));
- signal_value_changed().connect(sigc::mem_fun(*this, &SpinButton::on_value_changed));
set_focus_on_click(true);
- prevdigits = get_digits();
- on_value_changed();
};
int SpinButton::on_input(double* newvalue)
@@ -65,27 +61,6 @@ int SpinButton::on_input(double* newvalue)
return true;
}
-void SpinButton::on_value_changed()
-{
- double val = get_value();
- double absval = std::abs(val);
- int count = get_digits();
- double intpart;
- if (modf(absval, &intpart) == 0.0) {
- set_digits(0);
- count = 0;
- } else {
- set_digits(prevdigits);
- count = prevdigits + 1;
- }
- if (val < 0) {
- count += 1;
- }
- count += absval > 9 ? (int)log10(absval) + 1 : 1;
- count = std::min(std::max(count, 3), 7);
- set_width_chars(count);
-}
-
bool SpinButton::on_my_focus_in_event(GdkEventFocus* /*event*/)
{
_on_focus_in_value = get_value();
diff --git a/src/ui/widget/spinbutton.h b/src/ui/widget/spinbutton.h
index 3e7e829f5..710b511b1 100644
--- a/src/ui/widget/spinbutton.h
+++ b/src/ui/widget/spinbutton.h
@@ -93,14 +93,10 @@ protected:
*/
bool on_my_key_press_event(GdkEventKey* event);
-
- void on_value_changed();
/**
* Undo the editing, by resetting the value upon when the spinbutton got focus.
*/
void undo();
-
- int prevdigits;
};
} // namespace Widget