diff options
| author | vanntile <valentin.ionita1201@gmail.com> | 2019-08-10 13:50:42 +0000 |
|---|---|---|
| committer | vanntile <valentin.ionita1201@gmail.com> | 2019-08-17 15:33:46 +0000 |
| commit | 7ca50519fac1ac5f2df5111df13c445b75dfd669 (patch) | |
| tree | 6ea3418f148a5d27be5edb821c4478443cfecfa6 /src/ui/widget | |
| parent | HatchKnotHolderEntityScale & some fixes (diff) | |
| download | inkscape-7ca50519fac1ac5f2df5111df13c445b75dfd669.tar.gz inkscape-7ca50519fac1ac5f2df5111df13c445b75dfd669.zip | |
Some useful hatch changes
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/selected-style.cpp | 12 | ||||
| -rw-r--r-- | src/ui/widget/selected-style.h | 12 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 0adf7997e..53ec6c1a2 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -26,6 +26,7 @@ #include "include/gtkmm_version.h" +#include "object/sp-hatch.h" #include "object/sp-linear-gradient.h" #include "object/sp-mesh-gradient.h" #include "object/sp-namedview.h" @@ -189,6 +190,11 @@ SelectedStyle::SelectedStyle(bool /*layout*/) _pattern[i].show_all(); __pattern[i] = (i == SS_FILL)? (_("Pattern fill")) : (_("Pattern stroke")); + _hatch[i].set_markup (_("Hatch")); + sp_set_font_size_smaller (GTK_WIDGET(_hatch[i].gobj())); + _hatch[i].show_all(); + __hatch[i] = (i == SS_FILL)? (_("Hatch fill")) : (_("Hatch stroke")); + _lgradient[i].set_markup (_("<b>L</b>")); sp_set_font_size_smaller (GTK_WIDGET(_lgradient[i].gobj())); _lgradient[i].show_all(); @@ -993,6 +999,10 @@ SelectedStyle::update() place->add(_pattern[i]); place->set_tooltip_text(__pattern[i]); _mode[i] = SS_PATTERN; + } else if (SP_IS_HATCH (server)) { + place->add(_hatch[i]); + place->set_tooltip_text(__hatch[i]); + _mode[i] == SS_HATCH; } } else { g_warning ("file %s: line %d: Unknown paint server", __FILE__, __LINE__); @@ -1287,7 +1297,7 @@ RotateableSwatch::do_motion(double by, guint modifier) { if (pixbuf != nullptr) { cr = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf, 16, 16); - g_object_unref(pixbuf); + g_object_unref(pixbuf); gdk_window_set_cursor(gtk_widget_get_window(w), cr); g_object_unref(cr); cr = nullptr; diff --git a/src/ui/widget/selected-style.h b/src/ui/widget/selected-style.h index 2f76b7a11..5134b4ab3 100644 --- a/src/ui/widget/selected-style.h +++ b/src/ui/widget/selected-style.h @@ -52,7 +52,8 @@ enum { SS_MGRADIENT, #endif SS_MANY, - SS_COLOR + SS_COLOR, + SS_HATCH }; enum { @@ -62,7 +63,7 @@ enum { class SelectedStyle; -class RotateableSwatch: public Rotateable +class RotateableSwatch: public Rotateable { public: RotateableSwatch(SelectedStyle *parent, guint mode); @@ -88,7 +89,7 @@ private: bool cr_set; }; -class RotateableStrokeWidth: public Rotateable +class RotateableStrokeWidth: public Rotateable { public: RotateableStrokeWidth(SelectedStyle *parent); @@ -158,6 +159,9 @@ protected: Gtk::Label _pattern[2]; Glib::ustring __pattern[2]; + Gtk::Label _hatch[2]; + Glib::ustring __hatch[2]; + Gtk::Label _lgradient[2]; Glib::ustring __lgradient[2]; @@ -264,7 +268,7 @@ protected: Gtk::MenuItem _popup_unset[2]; Gtk::MenuItem _popup_remove[2]; - Gtk::Menu _popup_sw; + Gtk::Menu _popup_sw; Gtk::RadioButtonGroup _sw_group; std::vector<Gtk::RadioMenuItem*> _unit_mis; void on_popup_units(Inkscape::Util::Unit const *u); |
