19#include <glibmm/i18n.h>
20#include <gtkmm/button.h>
34bool relative_toggle_status =
false;
35Glib::ustring angle_unit_status =
DEG;
42 , _locked_toggle(_(
"Lo_cked"))
43 , _relative_toggle(_(
"Rela_tive change"))
44 , _spin_button_x(C_(
"Guides",
"_X:"),
Glib::ustring{}, UNIT_TYPE_LINEAR,
Glib::ustring{}, &_unit_menu)
45 , _spin_button_y(C_(
"Guides",
"_Y:"),
Glib::ustring{}, UNIT_TYPE_LINEAR,
Glib::ustring{}, &_unit_menu)
46 , _label_entry(_(
"_Label:"), _(
"Optionally give this guideline a name"))
47 , _spin_angle(_(
"_Angle:"), {}, UNIT_TYPE_RADIAL)
49 set_name(
"GuidelinePropertiesDialog");
50 _locked_toggle.set_use_underline();
51 _locked_toggle.set_tooltip_text(_(
"Lock the movement of guides"));
52 _relative_toggle.set_use_underline();
53 _relative_toggle.set_tooltip_text(_(
"Move and/or rotate the guide relative to current settings"));
108 if ( deg_angle == 90. || deg_angle == 270. || deg_angle == -90. || deg_angle == -270.) {
110 }
else if ( deg_angle == 0. || deg_angle == 180. || deg_angle == -180.) {
113 double rad_angle = Geom::rad_from_deg( deg_angle );
114 normal =
Geom::rot90(Geom::Point::polar(rad_angle, 1.0));
131 newpos *= pm.getSelectedPageAffine();
138 const auto c =
_color.get_rgba();
139 unsigned r =
c.get_red_u()/257, g =
c.get_green_u()/257, b =
c.get_blue_u()/257;
162 set_title(_(
"Guideline"));
164 auto vbox = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::VERTICAL);
195 _color.set_halign(Gtk::Align::FILL);
196 _color.set_valign(Gtk::Align::FILL);
212 size_t minimumexponent = std::min(std::abs(prefs->
getInt(
"/options/svgoutput/minimumexponent", -8)), 5);
227 _row_labels = Gtk::SizeGroup::create(Gtk::SizeGroup::Mode::HORIZONTAL);
230 label->set_xalign(0);
282 if(global_guides_lock){
288 auto buttonbox = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
289 vbox->append(*buttonbox);
290 buttonbox->set_halign(Gtk::Align::END);
291 buttonbox->set_homogeneous();
293 auto add_button = [&] (Glib::ustring
const &
label, sigc::slot<void ()> &&slot) {
294 auto button = Gtk::make_managed<Gtk::Button>(
label,
true);
295 button->signal_clicked().connect(std::move(slot));
296 buttonbox->append(*button);
300 auto ok = add_button(_(
"_OK"), [
this] {
_onOK(); destroy(); });
301 add_button(_(
"_Duplicate"), [
this] {
_onDuplicate(); destroy(); });
302 add_button(_(
"_Delete"), [
this] {
_onDelete(); destroy(); });
303 add_button(_(
"_Cancel"), [
this] { destroy(); });
322 gchar *
label = g_strdup_printf(_(
"Current: %s"), guide_description);
323 g_free(guide_description);
348 set_default_widget(*ok);
Affine inverse() const
Compute the inverse matrix.
Two-dimensional point that doubles as a vector.
static void done(SPDocument *document, Glib::ustring const &event_description, Glib::ustring const &undo_icon, unsigned int object_modified_tag=0)
Geom::Affine getSelectedPageAffine() const
Preference storage class.
static Preferences * get()
Access the singleton Preferences object.
int getInt(Glib::ustring const &pref_path, int def=0)
Retrieve an integer.
Dialog for modifying guidelines.
Glib::RefPtr< Gtk::SizeGroup > _row_labels
static void showDialog(SPGuide *guide, SPDesktop *desktop)
Inkscape::UI::Widget::Entry _label_entry
Gtk::CheckButton _relative_toggle
Inkscape::UI::Widget::ScalarUnit _spin_angle
Gtk::CheckButton _locked_toggle
Inkscape::UI::Widget::UnitMenu _unit_menu
Inkscape::UI::Widget::ScalarUnit _spin_button_x
Inkscape::UI::Widget::ScalarUnit _spin_button_y
~GuidelinePropertiesDialog() override
GuidelinePropertiesDialog(SPGuide *guide, SPDesktop *desktop)
Gtk::Entry const * getEntry() const
To do: update description of desktop.
SPNamedView * getNamedView() const
void setWindowTransient(Gtk::Window &window, int transient_policy=1)
Typed SVG document implementation.
bool get_origin_follows_page()
Inkscape::PageManager & getPageManager()
void set_locked(const bool locked, bool const commit)
char * description(bool const verbose=true) const
Returns a human-readable description of the guideline for use in dialog boxes and status bar.
Geom::Point getNormal() const
bool isHorizontal() const
void set_color(const unsigned r, const unsigned g, const unsigned b, bool const commit)
void moveto(Geom::Point const point_on_line, bool const commit)
void set_normal(Geom::Point const normal_to_line, bool const commit)
Geom::Point getPoint() const
bool remove(bool force=false)
void set_label(const char *label, bool const commit)
char const * getLabel() const
Inkscape::Util::Unit const * display_units
char const * getId() const
Returns the objects current ID string.
Editable view implementation.
TODO: insert short description here.
static const unsigned int DEG
D2< T > rot90(D2< T > const &a)
Singleton class to access the preferences file in a convenient way.