diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-06-10 14:14:58 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-06-10 14:15:25 +0000 |
| commit | f958a8f1d4e5ac324207aaaeb0c81a84b0646d1a (patch) | |
| tree | ba5b070b2cfdc98e59b0fe7d54176ea8eb1b41bf /src/ui/dialog/styledialog.cpp | |
| parent | Fix typo bug found by PeterK (diff) | |
| download | inkscape-f958a8f1d4e5ac324207aaaeb0c81a84b0646d1a.tar.gz inkscape-f958a8f1d4e5ac324207aaaeb0c81a84b0646d1a.zip | |
Move from XMLDialog to another paned dialog
Diffstat (limited to 'src/ui/dialog/styledialog.cpp')
| -rw-r--r-- | src/ui/dialog/styledialog.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/ui/dialog/styledialog.cpp b/src/ui/dialog/styledialog.cpp index 2e43838b2..4ce8da925 100644 --- a/src/ui/dialog/styledialog.cpp +++ b/src/ui/dialog/styledialog.cpp @@ -200,8 +200,9 @@ StyleDialog::StyleDialog() Gtk::Box *alltoggler = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL)); Gtk::Label *infotoggler = Gtk::manage(new Gtk::Label(_("Edit Full Stylesheet"))); _all_css = Gtk::manage(new Gtk::Switch()); - _all_css->set_margin_right(5); - _all_css->set_margin_top(2); + _scroolpos = 0; + vadj = _scrolledWindow.get_vadjustment(); + vadj->signal_changed().connect(sigc::mem_fun(*this, &StyleDialog::_vscrool)); _all_css->property_active().signal_changed().connect(sigc::mem_fun(*this, &StyleDialog::_reload)); alltoggler->pack_start(*_all_css, false, false, 0); alltoggler->pack_start(*infotoggler, false, false, 0); @@ -228,6 +229,12 @@ StyleDialog::StyleDialog() _readStyleElement(); } +void +StyleDialog::_vscrool() +{ + _scroolpos = vadj->get_value(); +} + /** * Class destructor */ @@ -340,7 +347,6 @@ void StyleDialog::_readStyleElement() if (_updating) return; // Don't read if we wrote style element. _updating = true; - Inkscape::XML::Node *textNode = _getStyleTextNode(); if (textNode == nullptr) { std::cerr << "StyleDialog::_readStyleElement: No text node!" << std::endl; @@ -945,6 +951,7 @@ bool StyleDialog::_addRow(GdkEventButton *evt, Glib::RefPtr<Gtk::TreeStore> stor Glib::ustring selector, gint pos) { if (evt->type == GDK_BUTTON_RELEASE && evt->button == 1) { + vadj->set_value(_scroolpos); Gtk::TreeIter iter = store->append(); Gtk::TreeModel::Path path = (Gtk::TreeModel::Path)iter; Gtk::TreeModel::Row row = *(iter); @@ -1013,6 +1020,7 @@ void StyleDialog::_setAutocompletion(Gtk::Entry *entry, Glib::ustring name) void StyleDialog::_startValueEdit(Gtk::CellEditable* cell, const Glib::ustring& path, Glib::RefPtr<Gtk::TreeStore> store) { + vadj->set_value(_scroolpos); Gtk::TreeModel::Row row = *store->get_iter(path); if (row) { Gtk::Entry *entry = dynamic_cast<Gtk::Entry *>(cell); @@ -1069,6 +1077,7 @@ StyleDialog::_startValueEdit(Gtk::CellEditable* cell, const Glib::ustring& path, void StyleDialog::_startNameEdit(Gtk::CellEditable *cell, const Glib::ustring &path) { + vadj->set_value(_scroolpos); Glib::RefPtr<Gtk::ListStore> completionModel = Gtk::ListStore::create(_mCSSData); Glib::RefPtr<Gtk::EntryCompletion> entry_completion = Gtk::EntryCompletion::create(); entry_completion->set_model(completionModel); @@ -1118,6 +1127,7 @@ void StyleDialog::_nameEdited(const Glib::ustring &path, const Glib::ustring &na } else { css_tree->set_cursor(pathel, *(css_tree->get_column(col)), true); grab_focus(); + vadj->set_value(_scroolpos); } } } |
