30#include <glibmm/i18n.h>
31#include <gtkmm/adjustment.h>
33#include <gtkmm/button.h>
34#include <gtkmm/liststore.h>
35#include <gtkmm/treemodel.h>
54 , _tracker{
std::make_unique<UI::Widget::UnitTracker>(
Inkscape::
Util::UNIT_TYPE_LINEAR)}
72 Glib::RefPtr<Gtk::ListStore>
store = Gtk::ListStore::create(columns);
75 Gtk::TreeModel::Row row = *
store->append();
83 int channels = prefs->getInt(
"/tools/paintbucket/channels", 0);
90 Glib::ustring stored_unit = prefs->getString(
"/tools/paintbucket/offsetunits");
91 if (!stored_unit.empty()) {
101 Glib::RefPtr<Gtk::ListStore>
store = Gtk::ListStore::create(columns);
104 Gtk::TreeModel::Row row = *
store->append();
105 row[columns.
col_label ] = g_dpgettext2(
nullptr,
"Flood autogap",
item);
112 int autogap = prefs->getInt(
"/tools/paintbucket/autogap", 0);
118 auto units_menu =
_tracker->create_tool_item(_(
"Units"),
"");
119 get_widget<Gtk::Box>(
builder,
"unit_menu_box").append(*units_menu);
123 get_widget<Gtk::Button>(
builder,
"reset_btn")
140 auto const path =
"/tools/painbucket/" +
name;
143 auto adj = btn.get_adjustment();
145 adj->signal_value_changed().connect(sigc::mem_fun(*
this, value_changed_mem_fun));
147 if (
name ==
"offset") {
148 _tracker->addAdjustment(adj->gobj());
167 auto const unit =
_tracker->getActiveUnit();
172 prefs->setDouble(
"/tools/paintbucket/offset", (gdouble)
_offset_item.get_adjustment()->get_value());
174 prefs->setString(
"/tools/paintbucket/offsetunits", unit->abbr);
double getDouble(Glib::ustring const &pref_path, double def=0.0, Glib::ustring const &unit="")
Retrieve a floating point value.
static Preferences * get()
Access the singleton Preferences object.
void setInt(Glib::ustring const &pref_path, int value)
Set an integer value.
Unit const * getUnit(Glib::ustring const &name) const
Retrieve a given unit based on its string identifier.
Editable view implementation.
W & get_widget(const Glib::RefPtr< Gtk::Builder > &builder, const char *id)
W & get_derived_widget(const Glib::RefPtr< Gtk::Builder > &builder, const char *id, Args &&... args)
Glib::RefPtr< Gtk::Builder > create_builder(const char *filename)
Miscellaneous supporting code.
Helper class to stream background task notifications as a series of messages.
Singleton class to access the preferences file in a convenient way.
Glib::RefPtr< Gtk::Builder > builder