31#include <glibmm/i18n.h>
32#include <gtkmm/adjustment.h>
33#include <gtkmm/label.h>
34#include <gtkmm/togglebutton.h>
75 auto unit_menu =
_tracker->create_tool_item(_(
"Units"),
"");
76 get_widget<Gtk::Box>(
builder,
"unit_menu_box").append(*unit_menu);
134 auto const adj = btn.get_adjustment();
136 adj->set_value(Quantity::convert(val,
"px",
_tracker->getActiveUnit()));
139 _tracker->addAdjustment(adj->gobj());
141 btn.set_sensitive(
false);
147 auto const adj = btn.get_adjustment();
211 if (!adj->get_value()) {
215 auto const unit =
_tracker->getActiveUnit();
219 bool modified =
false;
221 if (
auto ge = cast<SPGenericEllipse>(
item)) {
223 if (value_name ==
"rx") {
224 ge->setVisibleRx(Quantity::convert(adj->get_value(), unit,
"px"));
226 ge->setVisibleRy(Quantity::convert(adj->get_value(), unit,
"px"));
253 bool modified =
false;
255 if (
auto ge = cast<SPGenericEllipse>(
item)) {
257 auto const val = Geom::rad_from_deg(adj->get_value());
258 if (value_name ==
"start") {
290 char const *arc_type =
"slice";
306 std::cerr << __FUNCTION__ <<
": bad arc type: " << type << std::endl;
310 bool modified =
false;
312 if (is<SPGenericEllipse>(
item)) {
314 repr->
setAttribute(
"sodipodi:open", open ?
"true" :
nullptr);
315 repr->setAttribute(
"sodipodi:arc-type", arc_type);
329 _end_item.get_adjustment()->set_value(0.0);
335 bool disabled =
_start_item.get_adjustment()->get_value() == 0 &&
336 _end_item .get_adjustment()->get_value() == 0 &&
339 btn->set_sensitive(!disabled);
355 if (
auto ge = cast<SPGenericEllipse>(
item)) {
357 repr = ge->getRepr();
369 _mode_item.set_markup(n_selected == 0 ? _(
"<b>New:</b>") : _(
"<b>Change:</b>"));
370 _rx_item.set_sensitive(n_selected > 0);
371 _ry_item.set_sensitive(n_selected > 0);
397 _tick_callback = add_tick_callback([
this] (Glib::RefPtr<Gdk::FrameClock>
const &) {
Wrapper for angular values.
static void done(SPDocument *document, Glib::ustring const &event_description, Glib::ustring const &undo_icon, unsigned int object_modified_tag=0)
static void maybeDone(SPDocument *document, const gchar *keyconst, Glib::ustring const &event_description, Glib::ustring const &undo_icon, unsigned int object_modified_tag=0)
SPItemRange items()
Returns a range of selected SPItems.
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.
int getInt(Glib::ustring const &pref_path, int def=0)
Retrieve an integer.
void setDouble(Glib::ustring const &pref_path, double value)
Set a floating point value.
void setInt(Glib::ustring const &pref_path, int value)
Set an integer value.
The set of selected SPObjects for a given document and layer model.
sigc::connection connectChanged(sigc::slot< void(Selection *)> slot)
Connects a slot to be notified of selection changes.
Interface for refcounted XML nodes.
void setAttribute(Util::const_char_ptr key, Util::const_char_ptr value)
Change an attribute of this node.
virtual void addObserver(NodeObserver &observer)=0
Add an object that will be notified of the changes to this node.
virtual void removeObserver(NodeObserver &observer)=0
Remove an object from the list of observers.
To do: update description of desktop.
SPDocument * getDocument() const
Inkscape::Selection * getSelection() const
double getVisibleRy() const
double getVisibleRx() const
GenericEllipseArcType arc_type
Inkscape::XML::Node * updateRepr(unsigned int flags=SP_OBJECT_WRITE_EXT)
Updates the object's repr based on the object's state.
Inkscape::XML::Node * getRepr()
Returns the XML representation of tree.
Editable view implementation.
TODO: insert short description here.
Macro for icon names used in Inkscape.
static R & anchor(R &r)
Increments the reference count of a anchored object.
static R & release(R &r)
Decrements the reference count of a anchored object.
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.
Glib::RefPtr< Gtk::Builder > builder