Inkscape
Vector Graphics Editor
|
#include <style-swatch.h>
Public Member Functions | |
StyleSwatch (SPCSSAttr *attr, gchar const *main_tip, Gtk::Orientation orient=Gtk::Orientation::VERTICAL) | |
~StyleSwatch () override | |
void | setStyle (SPStyle *style) |
void | setStyle (SPCSSAttr *attr) |
SPCSSAttr * | getStyle () |
void | setWatchedTool (const char *path, bool synthesize) |
void | setToolName (const Glib::ustring &tool_name) |
void | setDesktop (SPDesktop *desktop) |
Private Types | |
using | PrefObs = Preferences::PreferencesObserver |
Private Attributes | |
SPDesktop * | _desktop |
Glib::ustring | _tool_name |
SPCSSAttr * | _css |
std::unique_ptr< PrefObs > | _tool_obs |
std::unique_ptr< PrefObs > | _style_obs |
Glib::ustring | _tool_path |
Gtk::Grid * | _table |
Gtk::Label | _label [2] |
Gtk::Box | _empty_space |
Gtk::Label | _value [2] |
Gtk::Box | _place [2] |
Gtk::Label | _opacity_value |
std::unique_ptr< ColorPreview > | _color_preview [2] |
Glib::ustring | _color [2] |
Gtk::Box | _stroke |
Gtk::Label | _stroke_width |
Util::Unit * | _sw_unit |
Friends | |
void | tool_obs_callback (StyleSwatch &, Preferences::Entry const &) |
Watches whether the tool uses the current style. | |
Definition at line 43 of file style-swatch.h.
Definition at line 58 of file style-swatch.h.
Inkscape::UI::Widget::StyleSwatch::StyleSwatch | ( | SPCSSAttr * | attr, |
gchar const * | main_tip, | ||
Gtk::Orientation | orient = Gtk::Orientation::VERTICAL |
||
) |
Definition at line 92 of file style-swatch.cpp.
References _color_preview, _empty_space, _label, _opacity_value, _place, _stroke, _stroke_width, _table, css, Inkscape::UI::pack_start(), setStyle(), Inkscape::UI::shrink, Inkscape::UI::Widget::SS_FILL, Inkscape::UI::Widget::SS_STROKE, and STYLE_SWATCH_WIDTH.
|
override |
Definition at line 175 of file style-swatch.cpp.
References _css, and sp_repr_css_attr_unref().
SPCSSAttr * Inkscape::UI::Widget::StyleSwatch::getStyle | ( | ) |
void Inkscape::UI::Widget::StyleSwatch::setDesktop | ( | SPDesktop * | desktop | ) |
Definition at line 171 of file style-swatch.cpp.
void Inkscape::UI::Widget::StyleSwatch::setStyle | ( | SPCSSAttr * | attr | ) |
Definition at line 200 of file style-swatch.cpp.
References _css, _desktop, css, SPDesktop::getDocument(), SPStyle::mergeString(), setStyle(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_merge(), and sp_repr_css_write_string().
void Inkscape::UI::Widget::StyleSwatch::setStyle | ( | SPStyle * | style | ) |
Definition at line 221 of file style-swatch.cpp.
References _color_preview, _opacity_value, _place, _stroke_width, _sw_unit, _value, Inkscape::Util::Unit::abbr, Inkscape::Util::Quantity::convert(), SPStyle::fill, SPStyle::fill_opacity, SPIPaint::getColor(), has_stroke(), SPIPaint::isColor(), SPIPaint::isNone(), SPIPaint::isPaintserver(), SPStyle::opacity, Inkscape::UI::remove_all_children(), SPIBase::set, Inkscape::UI::Widget::SS_FILL, Inkscape::UI::Widget::SS_STROKE, SPStyle::stroke, SPStyle::stroke_extensions, SPStyle::stroke_opacity, SPStyle::stroke_width, and w.
Referenced by setStyle(), Inkscape::UI::Widget::style_obs_callback(), Inkscape::UI::Dialog::StyleFromSelectionToTool(), StyleSwatch(), Inkscape::UI::Dialog::ObjectAttributes::update_panel(), and Inkscape::UI::Dialog::ObjectAttributes::widget_setup().
void Inkscape::UI::Widget::StyleSwatch::setToolName | ( | const Glib::ustring & | tool_name | ) |
Definition at line 167 of file style-swatch.cpp.
References _tool_name.
void Inkscape::UI::Widget::StyleSwatch::setWatchedTool | ( | const char * | path, |
bool | synthesize | ||
) |
Definition at line 182 of file style-swatch.cpp.
References _tool_obs, _tool_path, Inkscape::Preferences::PreferencesObserver::create(), and tool_obs_callback.
|
friend |
Watches whether the tool uses the current style.
Definition at line 61 of file style-swatch.cpp.
Referenced by setWatchedTool().
|
private |
Definition at line 73 of file style-swatch.h.
|
private |
Definition at line 72 of file style-swatch.h.
Referenced by setStyle(), and StyleSwatch().
|
private |
Definition at line 62 of file style-swatch.h.
Referenced by setStyle(), and ~StyleSwatch().
|
private |
Definition at line 60 of file style-swatch.h.
Referenced by setDesktop(), and setStyle().
|
private |
Definition at line 68 of file style-swatch.h.
Referenced by StyleSwatch().
|
private |
Definition at line 67 of file style-swatch.h.
Referenced by StyleSwatch().
|
private |
Definition at line 71 of file style-swatch.h.
Referenced by setStyle(), and StyleSwatch().
|
private |
Definition at line 70 of file style-swatch.h.
Referenced by setStyle(), and StyleSwatch().
|
private |
Definition at line 74 of file style-swatch.h.
Referenced by StyleSwatch().
|
private |
Definition at line 75 of file style-swatch.h.
Referenced by setStyle(), and StyleSwatch().
|
private |
Definition at line 64 of file style-swatch.h.
|
private |
Definition at line 76 of file style-swatch.h.
Referenced by setStyle().
|
private |
Definition at line 66 of file style-swatch.h.
Referenced by StyleSwatch().
|
private |
Definition at line 61 of file style-swatch.h.
Referenced by setToolName().
|
private |
Definition at line 63 of file style-swatch.h.
Referenced by setWatchedTool().
|
private |
Definition at line 65 of file style-swatch.h.
Referenced by setWatchedTool().
|
private |
Definition at line 69 of file style-swatch.h.
Referenced by setStyle().