diff options
| author | Ted Gould <ted@gould.cx> | 2016-07-27 15:50:24 +0000 |
|---|---|---|
| committer | Ted Gould <ted@gould.cx> | 2016-07-27 15:50:24 +0000 |
| commit | e0564a4174331f32970bd28695fae5732420accc (patch) | |
| tree | c6b4c430d785bd83f7a930ce4b2c17d6c5a68980 /src/ui | |
| parent | Add build dependencies (diff) | |
| parent | Revert the canvas widget changes, which cause performance regressions (diff) | |
| download | inkscape-e0564a4174331f32970bd28695fae5732420accc.tar.gz inkscape-e0564a4174331f32970bd28695fae5732420accc.zip | |
Merge 0.92.x branch
(bzr r14950.1.12)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/aboutbox.cpp | 24 | ||||
| -rw-r--r-- | src/ui/dialog/knot-properties.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/layer-properties.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/lpe-fillet-chamfer-properties.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/lpe-powerstroke-properties.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/svg-fonts-dialog.cpp | 8 | ||||
| -rw-r--r-- | src/ui/dialog/svg-fonts-dialog.h | 206 | ||||
| -rw-r--r-- | src/ui/tools/freehand-base.cpp | 40 | ||||
| -rw-r--r-- | src/ui/tools/measure-tool.cpp | 7 | ||||
| -rw-r--r-- | src/ui/tools/select-tool.cpp | 257 | ||||
| -rw-r--r-- | src/ui/tools/select-tool.h | 3 | ||||
| -rw-r--r-- | src/ui/tools/tool-base.cpp | 7 | ||||
| -rw-r--r-- | src/ui/widget/color-icc-selector.cpp | 3 | ||||
| -rw-r--r-- | src/ui/widget/registered-widget.cpp | 6 | ||||
| -rw-r--r-- | src/ui/widget/registered-widget.h | 3 |
15 files changed, 271 insertions, 301 deletions
diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp index 1a87a9718..6276d3391 100644 --- a/src/ui/dialog/aboutbox.cpp +++ b/src/ui/dialog/aboutbox.cpp @@ -467,7 +467,8 @@ void AboutBox::initStrings() { "Adib Taraben <theadib@gmail.com>, 2004-2014.\n" "Alan Monfort <alan.monfort@free.fr>, 2009-2010.\n" "Alastair McKinstry <mckinstry@computer.org>, 2000.\n" -"Aleksandar Urošević <urke@users.sourceforge.net>, 2004-2006.\n" +"Aleksandar Marković <alleksandar.markovic@gmail.com>, 2015.\n" +"Aleksandar Urošević <urke@users.sourceforge.net>, 2004-2009.\n" "Alessio Frusciante <algol@firenze.linux.it>, 2002, 2003.\n" "Alexander Shopov <ash@contact.bg>, 2006.\n" "Alexandre Prokoudine <alexandre.prokoudine@gmail.com>, 2005, 2010-2014.\n" @@ -499,18 +500,19 @@ void AboutBox::initStrings() { "Cédric Gemy <radar.map35@free.fr>, 2006.\n" "Daniel Díaz <yosoy@danieldiaz.org>, 2004.\n" "Didier Conchaudron <conchaudron@free.fr>, 2003.\n" -"Dimitris Spingos <dmtrs32@gmail.com>, 2011-2013.\n" +"Dimitris Spingos (Δημήτρης Σπίγγος) <dmtrs32@gmail.com>, 2011-2015.\n" "Dorji Tashi <dorjee_doss@hotmail.com>, 2006.\n" "Duarte Loreto <happyguy_pt@hotmail.com> 2002, 2003 (Maintainer).\n" "Elias Norberg <elno0959 at student.su.se>, 2009.\n" "Equipe de Tradução Inkscape Brasil <www.inkscapebrasil.org>, 2007.\n" "Fatih Demir <kabalak@gtranslator.org>, 2000.\n" -"Firas Hanife <FirasHanife@gmail.com>, 2014-2015.\n" +"Firas Hanife <FirasHanife@gmail.com>, 2014-2016.\n" "Foppe Benedictus <foppe.benedictus@gmail.com>, 2007-2009.\n" "Francesc Dorca <f.dorca@filnet.es>, 2003. Traducció sodipodi.\n" "Francisco Javier F. Serrador <serrador@arrakis.es>, 2003.\n" "Francisco Xosé Vázquez Grandal <fxvazquez@arrakis.es>, 2001.\n" "Frederic Rodrigo <f.rodrigo free.fr>, 2004-2005.\n" +"Ganesh Murmu <g_murmu_in@yahoo.com>, 2014.\n" "Ge'ez Frontier Foundation <locales@geez.org>, 2002.\n" "George Boukeas <boukeas@gmail.com>, 2011.\n" "Heiko Wöhrle <mail@heikowoehrle.de>, 2014.\n" @@ -528,6 +530,7 @@ void AboutBox::initStrings() { "Jeroen van der Vegt <jvdvegt@gmail.com>, 2003, 2005, 2008.\n" "Jin-Hwan Jeong <yongdoria@gmail.com>, 2009.\n" "Jonathan Ernst <jernst@users.sourceforge.net>, 2006.\n" +"Jordi Mas i Hernàndez <jmas@softcatala.org>, 2015.\n" "Jose Antonio Salgueiro Aquino <developer@telefonica.net>, 2003.\n" "Josef Vybiral <josef.vybiral@gmail.com>, 2005-2006.\n" "Juarez Rudsatz <juarez@correio.com>, 2004.\n" @@ -542,10 +545,11 @@ void AboutBox::initStrings() { "Kingsley Turner <kingsley@maddogsbreakfast.com.au>, 2006.\n" "Kitae <bluetux@gmail.com>, 2006.\n" "Kjartan Maraas <kmaraas@gnome.org>, 2000-2002.\n" -"Kris De Gussem <Kris.DeGussem@gmail.com>, 2008-2014.\n" +"Kris De Gussem <Kris.DeGussem@gmail.com>, 2008-2015.\n" "Lauris Kaplinski <lauris@ariman.ee>, 2000.\n" "Leandro Regueiro <leandro.regueiro@gmail.com>, 2006-2008, 2010.\n" "Liu Xiaoqin <liuxqsmile@gmail.com>, 2008.\n" +"Louni Kandulna <kandulna.louni@gmail.com>, 2014.\n" "Luca Bruno <luca.br@uno.it>, 2005.\n" "Lucas Vieites Fariña<lucas@codexion.com>, 2003-2013.\n" "Mahesh subedi <submanesh@hotmail.com>, 2006.\n" @@ -561,8 +565,10 @@ void AboutBox::initStrings() { "Mufit Eribol <meribol@ere.com.tr>, 2000.\n" "Muhammad Bashir Al-Noimi <mhdbnoimi@gmail.com>, 2008.\n" "Myckel Habets <myckel@sdf.lonestar.org>, 2008.\n" +"Nasreen <nasreen_saifee@hotmail.com>, 2013.\n" "Nguyen Dinh Trung <nguyendinhtrung141@gmail.com>, 2007, 2008.\n" -"Nicolas Dufour <nicoduf@yahoo.fr>, 2008-2014.\n" +"Nicolas Dufour <nicoduf@yahoo.fr>, 2008-2016.\n" +"Paresh prabhu <goa.paresh@Gmail.com>, 2013.\n" "Pawan Chitrakar <pchitrakar@gmail.com>, 2006.\n" "Przemysław Loesch <p_loesch@poczta.onet.pl>, 2005.\n" "Quico Llach <quico@softcatala.org>, 2000. Traducció sodipodi.\n" @@ -570,6 +576,8 @@ void AboutBox::initStrings() { "Riku Leino <tsoots@gmail.com>, 2006-2011.\n" "Rune Rønde Laursen <runerl@skjoldhoej.dk>, 2006.\n" "Ruud Steltenpool <svg@steltenpower.com>, 2006.\n" +"Sangeeta <sk@gma.co>, 2011.\n" +"Savitha <savithasprasad@yahoo.co.in>, 2013.\n" "Serdar Soytetir <sendirom@gmail.com>, 2005.\n" "shivaken <shivaken@owls-nest.net>, 2004.\n" "Shyam Krishna Bal <shyamkrishna_bal@yahoo.com>, 2006.\n" @@ -577,8 +585,11 @@ void AboutBox::initStrings() { "Spyros Blanas <cid_e@users.sourceforge.net>, 2006, 2011.\n" "Stefan Graubner <pflaumenmus92@gmx.net>, 2005.\n" "Supranee Thirawatthanasuk <supranee@opentle.org>, 2006.\n" +"Sushma Joshi <shshma_joshi8266@vsnl.net>, 2011.\n" +"Sveinn í Felli <sv1@fellsnet.is>, 2014-2015.\n" +"Sylvain Chiron <chironsylvain@orange.fr>, 2016.\n" "Takeshi Aihana <aihana@muc.biglobe.ne.jp>, 2000, 2001.\n" -"Tim Sheridan <tghs@tghs.net>, 2007-2014.\n" +"Tim Sheridan <tghs@tghs.net>, 2007-2016.\n" "Theppitak Karoonboonyanan <thep@linux.thai.net>, 2006.\n" "Thiago Pimentel <thiago.merces@gmail.com>, 2006.\n" "Toshifumi Sato <sato@centrosystem.com>, 2005.\n" @@ -592,6 +603,7 @@ void AboutBox::initStrings() { "Vital Khilko <dojlid@mova.org>, 2003.\n" "Vitaly Lipatov <lav@altlinux.ru>, 2002, 2004.\n" "vonHalenbach <vonHalenbach@users.sourceforge.net>, 2005.\n" +"vrundeshw <vrundeshw@cdac.in>, 2012.\n" "Waluyo Adi Siswanto <was.uthm@gmail.com>, 2011.\n" "Wang Li <charlesw1234@163.com>, 2002.\n" "Wei-Lun Chao <william.chao@ossii.com.tw>, 2006.\n" diff --git a/src/ui/dialog/knot-properties.cpp b/src/ui/dialog/knot-properties.cpp index 9c23c33e1..a91a09a4f 100644 --- a/src/ui/dialog/knot-properties.cpp +++ b/src/ui/dialog/knot-properties.cpp @@ -145,7 +145,7 @@ KnotPropertiesDialog::_close() destroy_(); Glib::signal_idle().connect( sigc::bind_return( - sigc::bind(sigc::ptr_fun(&::operator delete), this), + sigc::bind(sigc::ptr_fun<void*, void>(&::operator delete), this), false ) ); diff --git a/src/ui/dialog/layer-properties.cpp b/src/ui/dialog/layer-properties.cpp index 1b8fbb3f7..5d550ed48 100644 --- a/src/ui/dialog/layer-properties.cpp +++ b/src/ui/dialog/layer-properties.cpp @@ -146,7 +146,7 @@ LayerPropertiesDialog::_close() destroy_(); Glib::signal_idle().connect( sigc::bind_return( - sigc::bind(sigc::ptr_fun(&::operator delete), this), + sigc::bind(sigc::ptr_fun<void*, void>(&::operator delete), this), false ) ); diff --git a/src/ui/dialog/lpe-fillet-chamfer-properties.cpp b/src/ui/dialog/lpe-fillet-chamfer-properties.cpp index 5ccee103c..b0cc91868 100644 --- a/src/ui/dialog/lpe-fillet-chamfer-properties.cpp +++ b/src/ui/dialog/lpe-fillet-chamfer-properties.cpp @@ -177,7 +177,7 @@ void FilletChamferPropertiesDialog::_close() destroy_(); Glib::signal_idle().connect( sigc::bind_return( - sigc::bind(sigc::ptr_fun(&::operator delete), this), + sigc::bind(sigc::ptr_fun<void*, void>(&::operator delete), this), false ) ); diff --git a/src/ui/dialog/lpe-powerstroke-properties.cpp b/src/ui/dialog/lpe-powerstroke-properties.cpp index cfc972547..a6dcce907 100644 --- a/src/ui/dialog/lpe-powerstroke-properties.cpp +++ b/src/ui/dialog/lpe-powerstroke-properties.cpp @@ -146,7 +146,7 @@ PowerstrokePropertiesDialog::_close() destroy_(); Glib::signal_idle().connect( sigc::bind_return( - sigc::bind(sigc::ptr_fun(&::operator delete), this), + sigc::bind(sigc::ptr_fun<void*, void>(&::operator delete), this), false ) ); diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 790c0e5fb..08ebbcf14 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -266,7 +266,7 @@ void SvgFontsDialog::update_fonts() { SPDesktop* desktop = this->getDesktop(); SPDocument* document = desktop->getDocument(); - std::vector<SPObject *> fonts = document->getResourceList( "fonts" ); + std::vector<SPObject *> fonts = document->getResourceList( "font" ); _model->clear(); for (std::vector<SPObject *>::const_iterator it = fonts.begin(); it != fonts.end(); ++it) { @@ -340,7 +340,7 @@ void SvgFontsDialog::on_font_selection_changed(){ update_sensitiveness(); } -void SvgFontsDialog::on_setwidth_changed(){ +void SvgFontsDialog::on_setfontdata_changed(){ SPFont* spfont = this->get_selected_spfont(); if (spfont){ spfont->horiz_adv_x = setwidth_spin.get_value(); @@ -397,7 +397,7 @@ Gtk::VBox* SvgFontsDialog::global_settings_tab(){ setwidth_hbox->add(*Gtk::manage(new Gtk::Label(_("Set width:")))); setwidth_hbox->add(setwidth_spin); - setwidth_spin.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_setwidth_changed)); + setwidth_spin.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_setfontdata_changed)); setwidth_spin.set_range(0, 4096); setwidth_spin.set_increments(10, 0); global_vbox.pack_start(*setwidth_hbox, false, false); @@ -497,7 +497,7 @@ SvgFontsDialog::flip_coordinate_system(Geom::PathVector pathv){ for (obj = get_selected_spfont()->children; obj; obj=obj->next){ if (SP_IS_FONTFACE(obj)){ //XML Tree being directly used here while it shouldn't be. - sp_repr_get_double(obj->getRepr(), "units_per_em", &units_per_em); + sp_repr_get_double(obj->getRepr(), "units-per-em", &units_per_em); } } diff --git a/src/ui/dialog/svg-fonts-dialog.h b/src/ui/dialog/svg-fonts-dialog.h index e5c4631e4..e80bbfd39 100644 --- a/src/ui/dialog/svg-fonts-dialog.h +++ b/src/ui/dialog/svg-fonts-dialog.h @@ -69,64 +69,63 @@ public: SvgFontsDialog(); ~SvgFontsDialog(); - static SvgFontsDialog &getInstance() - { return *new SvgFontsDialog(); } + static SvgFontsDialog &getInstance() { return *new SvgFontsDialog(); } void update_fonts(); SvgFont* get_selected_svgfont(); SPFont* get_selected_spfont(); - SPGlyph* get_selected_glyph(); - SPGlyphKerning* get_selected_kerning_pair(); + SPGlyph* get_selected_glyph(); + SPGlyphKerning* get_selected_kerning_pair(); - //TODO: these methods should be private, right?! + //TODO: these methods should be private, right?! void on_font_selection_changed(); - void on_kerning_pair_selection_changed(); + void on_kerning_pair_selection_changed(); void on_preview_text_changed(); void on_kerning_pair_changed(); void on_kerning_value_changed(); - void on_setwidth_changed(); - void add_font(); - Geom::PathVector flip_coordinate_system(Geom::PathVector pathv); + void on_setfontdata_changed(); + void add_font(); + Geom::PathVector flip_coordinate_system(Geom::PathVector pathv); - //TODO: AttrEntry is currently unused. Should we remove it? + //TODO: AttrEntry is currently unused. Should we remove it? class AttrEntry : public Gtk::HBox - { - public: - AttrEntry(SvgFontsDialog* d, gchar* lbl, const SPAttributeEnum attr); - void set_text(char*); - private: - SvgFontsDialog* dialog; - void on_attr_changed(); - Gtk::Entry entry; - SPAttributeEnum attr; + { + public: + AttrEntry(SvgFontsDialog* d, gchar* lbl, const SPAttributeEnum attr); + void set_text(char*); + private: + SvgFontsDialog* dialog; + void on_attr_changed(); + Gtk::Entry entry; + SPAttributeEnum attr; }; private: - void update_glyphs(); - void update_sensitiveness(); - void update_global_settings_tab(); - void populate_glyphs_box(); + void update_glyphs(); + void update_sensitiveness(); + void update_global_settings_tab(); + void populate_glyphs_box(); void populate_kerning_pairs_box(); - void set_glyph_description_from_selected_path(); - void missing_glyph_description_from_selected_path(); - void reset_missing_glyph_description(); - void add_glyph(); - void glyph_unicode_edit(const Glib::ustring&, const Glib::ustring&); - void glyph_name_edit(const Glib::ustring&, const Glib::ustring&); - void remove_selected_glyph(); - void remove_selected_font(); - void remove_selected_kerning_pair(); + void set_glyph_description_from_selected_path(); + void missing_glyph_description_from_selected_path(); + void reset_missing_glyph_description(); + void add_glyph(); + void glyph_unicode_edit(const Glib::ustring&, const Glib::ustring&); + void glyph_name_edit(const Glib::ustring&, const Glib::ustring&); + void remove_selected_glyph(); + void remove_selected_font(); + void remove_selected_kerning_pair(); - void add_kerning_pair(); + void add_kerning_pair(); - void create_glyphs_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem); - void glyphs_list_button_release(GdkEventButton* event); + void create_glyphs_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem); + void glyphs_list_button_release(GdkEventButton* event); - void create_fonts_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem); - void fonts_list_button_release(GdkEventButton* event); + void create_fonts_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem); + void fonts_list_button_release(GdkEventButton* event); - void create_kerning_pairs_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem); - void kerning_pairs_list_button_release(GdkEventButton* event); + void create_kerning_pairs_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem); + void kerning_pairs_list_button_release(GdkEventButton* event); Inkscape::XML::SignalObserver _defs_observer; //in order to update fonts Inkscape::XML::SignalObserver _glyphs_observer; @@ -134,47 +133,47 @@ private: Gtk::HBox* AttrCombo(gchar* lbl, const SPAttributeEnum attr); // Gtk::HBox* AttrSpin(gchar* lbl, const SPAttributeEnum attr); Gtk::VBox* global_settings_tab(); - AttrEntry* _familyname_entry; + AttrEntry* _familyname_entry; Gtk::VBox* kerning_tab(); Gtk::VBox* glyphs_tab(); Gtk::Button _add; Gtk::Button add_glyph_button; - Gtk::Button glyph_from_path_button; - Gtk::Button missing_glyph_button; - Gtk::Button missing_glyph_reset_button; + Gtk::Button glyph_from_path_button; + Gtk::Button missing_glyph_button; + Gtk::Button missing_glyph_reset_button; class Columns : public Gtk::TreeModel::ColumnRecord - { - public: - Columns() - { - add(spfont); - add(svgfont); - add(label); - } - - Gtk::TreeModelColumn<SPFont*> spfont; - Gtk::TreeModelColumn<SvgFont*> svgfont; - Gtk::TreeModelColumn<Glib::ustring> label; + { + public: + Columns() + { + add(spfont); + add(svgfont); + add(label); + } + + Gtk::TreeModelColumn<SPFont*> spfont; + Gtk::TreeModelColumn<SvgFont*> svgfont; + Gtk::TreeModelColumn<Glib::ustring> label; }; Glib::RefPtr<Gtk::ListStore> _model; Columns _columns; Gtk::TreeView _FontsList; class GlyphsColumns : public Gtk::TreeModel::ColumnRecord - { - public: - GlyphsColumns() - { - add(glyph_node); - add(glyph_name); - add(unicode); - } - - Gtk::TreeModelColumn<SPGlyph*> glyph_node; - Gtk::TreeModelColumn<Glib::ustring> glyph_name; - Gtk::TreeModelColumn<Glib::ustring> unicode; + { + public: + GlyphsColumns() + { + add(glyph_node); + add(glyph_name); + add(unicode); + } + + Gtk::TreeModelColumn<SPGlyph*> glyph_node; + Gtk::TreeModelColumn<Glib::ustring> glyph_name; + Gtk::TreeModelColumn<Glib::ustring> unicode; }; GlyphsColumns _GlyphsListColumns; Glib::RefPtr<Gtk::ListStore> _GlyphsListStore; @@ -182,30 +181,30 @@ private: Gtk::ScrolledWindow _GlyphsListScroller; class KerningPairColumns : public Gtk::TreeModel::ColumnRecord - { - public: - KerningPairColumns() - { - add(first_glyph); - add(second_glyph); - add(kerning_value); - add(spnode); - } - - Gtk::TreeModelColumn<Glib::ustring> first_glyph; - Gtk::TreeModelColumn<Glib::ustring> second_glyph; - Gtk::TreeModelColumn<double> kerning_value; - Gtk::TreeModelColumn<SPGlyphKerning*> spnode; + { + public: + KerningPairColumns() + { + add(first_glyph); + add(second_glyph); + add(kerning_value); + add(spnode); + } + + Gtk::TreeModelColumn<Glib::ustring> first_glyph; + Gtk::TreeModelColumn<Glib::ustring> second_glyph; + Gtk::TreeModelColumn<double> kerning_value; + Gtk::TreeModelColumn<SPGlyphKerning*> spnode; }; KerningPairColumns _KerningPairsListColumns; Glib::RefPtr<Gtk::ListStore> _KerningPairsListStore; Gtk::TreeView _KerningPairsList; Gtk::ScrolledWindow _KerningPairsListScroller; - Gtk::Button add_kernpair_button; + Gtk::Button add_kernpair_button; Gtk::VBox _font_settings; - Gtk::VBox global_vbox; - Gtk::VBox glyphs_vbox; + Gtk::VBox global_vbox; + Gtk::VBox glyphs_vbox; Gtk::VBox kerning_vbox; Gtk::Entry _preview_entry; @@ -225,20 +224,20 @@ private: #endif class EntryWidget : public Gtk::HBox - { - public: - EntryWidget() - { - this->add(this->_label); - this->add(this->_entry); - } - void set_label(const gchar* l){ - this->_label.set_text(l); - } - private: - Gtk::Label _label; - Gtk::Entry _entry; - }; + { + public: + EntryWidget() + { + this->add(this->_label); + this->add(this->_entry); + } + void set_label(const gchar* l){ + this->_label.set_text(l); + } + private: + Gtk::Label _label; + Gtk::Entry _entry; + }; EntryWidget _font_family, _font_variant; }; @@ -247,3 +246,14 @@ private: } // namespace Inkscape #endif //#ifndef INKSCAPE_UI_DIALOG_SVG_FONTS_H + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index c98ecb686..7697cd59c 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -236,38 +236,14 @@ static void spdc_apply_powerstroke_shape(const std::vector<Geom::Point> & points Effect* lpe = SP_LPE_ITEM(item)->getCurrentLPE(); static_cast<LPEPowerStroke*>(lpe)->offset_points.param_set_and_write_new_value(points); - // find out stroke width (TODO: is there an easier way??) - SPDesktop *desktop = dc->desktop; - Inkscape::XML::Document *xml_doc = desktop->doc()->getReprDoc(); - Inkscape::XML::Node *repr = xml_doc->createElement("svg:path"); - Inkscape::GC::release(repr); - - char const* tool = SP_IS_PEN_CONTEXT(dc) ? "/tools/freehand/pen" : "/tools/freehand/pencil"; - - // apply the tool's current style - sp_desktop_apply_style_tool(desktop, repr, tool, false); - - double stroke_width = 1.0; - char const *style_str = NULL; - style_str = repr->attribute("style"); - if (style_str) { - SPStyle style(SP_ACTIVE_DOCUMENT); - style.mergeString(style_str); - stroke_width = style.stroke_width.computed; - } - - std::ostringstream s; - s.imbue(std::locale::classic()); - s << points[0][Geom::X] << "," << stroke_width / 2.; - // write powerstroke parameters: lpe->getRepr()->setAttribute("start_linecap_type", "zerowidth"); lpe->getRepr()->setAttribute("end_linecap_type", "zerowidth"); - lpe->getRepr()->setAttribute("cusp_linecap_type", "round"); lpe->getRepr()->setAttribute("sort_points", "true"); lpe->getRepr()->setAttribute("interpolator_type", "CubicBezierJohan"); lpe->getRepr()->setAttribute("interpolator_beta", "0.2"); - lpe->getRepr()->setAttribute("offset_points", s.str().c_str()); + lpe->getRepr()->setAttribute("miter_limit", "4"); + lpe->getRepr()->setAttribute("linejoin_type", "extrp_arc"); } static void spdc_apply_bend_shape(gchar const *svgd, FreehandBase *dc, SPItem *item) @@ -341,12 +317,14 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, bool shape_applied = false; SPCSSAttr *css_item = sp_css_attr_from_object(item, SP_STYLE_FLAG_ALWAYS); const char *cstroke = sp_repr_css_property(css_item, "stroke", "none"); + const char *stroke_width = sp_repr_css_property(css_item, "stroke-width", "0"); + double swidth; + sp_svg_number_read_d(stroke_width, &swidth); static SPItem *bend_item; #define SHAPE_LENGTH 10 #define SHAPE_HEIGHT 10 - if(shape == LAST_APPLIED){ shape = previous_shape_type; @@ -363,7 +341,8 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, { // "triangle in" std::vector<Geom::Point> points(1); - points[0] = Geom::Point(0., SHAPE_HEIGHT/2); + points[0] = Geom::Point(0., swidth/2); + points[0] *= i2anc_affine(static_cast<SPItem *>(item->parent), NULL).inverse(); spdc_apply_powerstroke_shape(points, dc, item); shape_applied = true; @@ -374,7 +353,9 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, // "triangle out" guint curve_length = curve->get_segment_count(); std::vector<Geom::Point> points(1); - points[0] = Geom::Point((double)curve_length, SHAPE_HEIGHT/2); + points[0] = Geom::Point(0, swidth/2); + points[0] *= i2anc_affine(static_cast<SPItem *>(item->parent), NULL).inverse(); + points[0][Geom::X] = (double)curve_length; spdc_apply_powerstroke_shape(points, dc, item); shape_applied = true; @@ -455,7 +436,6 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, if(previous_shape_type == CLIPBOARD){ if(previous_shape_pathv.size() != 0){ spdc_paste_curve_as_freehand_shape(previous_shape_pathv, dc, item); - shape_applied = true; shape = CLIPBOARD; } else{ diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp index 287828d32..63e2460ec 100644 --- a/src/ui/tools/measure-tool.cpp +++ b/src/ui/tools/measure-tool.cpp @@ -346,13 +346,13 @@ MeasureTool::MeasureTool() end_p = readMeasurePoint(false); dimension_offset = 35; // create the knots - this->knot_start = new SPKnot(desktop, N_("Measure start, <b>Shift+Click</b> for position dialog")); + this->knot_start = new SPKnot(desktop, _("Measure start, <b>Shift+Click</b> for position dialog")); this->knot_start->setMode(SP_KNOT_MODE_XOR); this->knot_start->setFill(MT_KNOT_COLOR_NORMAL, MT_KNOT_COLOR_MOUSEOVER, MT_KNOT_COLOR_MOUSEOVER); this->knot_start->setStroke(0x0000007f, 0x0000007f, 0x0000007f); this->knot_start->setShape(SP_KNOT_SHAPE_CIRCLE); this->knot_start->updateCtrl(); - this->knot_end = new SPKnot(desktop, N_("Measure end, <b>Shift+Click</b> for position dialog")); + this->knot_end = new SPKnot(desktop, _("Measure end, <b>Shift+Click</b> for position dialog")); this->knot_end->setMode(SP_KNOT_MODE_XOR); this->knot_end->setFill(MT_KNOT_COLOR_NORMAL, MT_KNOT_COLOR_MOUSEOVER, MT_KNOT_COLOR_MOUSEOVER); this->knot_end->setStroke(0x0000007f, 0x0000007f, 0x0000007f); @@ -565,7 +565,6 @@ bool MeasureTool::root_handler(GdkEvent* event) explicit_base = boost::none; explicit_base_tmp = boost::none; last_end = boost::none; - start_p = desktop->w2d(button_w); if (event->button.button == 1 && !this->space_panning) { // save drag origin @@ -778,7 +777,7 @@ void MeasureTool::toPhantom() measure_tmp_items.clear(); showCanvasItems(false, false, true); doc->ensureUpToDate(); - DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_MEASURE,_("Add Stored to measure tool")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_MEASURE,_("Keep last measure on the canvas, for reference")); } void MeasureTool::toItem() diff --git a/src/ui/tools/select-tool.cpp b/src/ui/tools/select-tool.cpp index 905e38f2b..b5ec3d88e 100644 --- a/src/ui/tools/select-tool.cpp +++ b/src/ui/tools/select-tool.cpp @@ -65,7 +65,7 @@ static gint rb_escaped = 0; // if non-zero, rubberband was canceled by esc, so t static gint drag_escaped = 0; // if non-zero, drag was canceled by esc const std::string& SelectTool::getPrefsPath() { - return SelectTool::prefsPath; + return SelectTool::prefsPath; } const std::string SelectTool::prefsPath = "/tools/select"; @@ -111,7 +111,6 @@ SelectTool::SelectTool() //static gint tolerance = 0; //static bool within_tolerance = false; static bool is_cycling = false; -static bool moved_while_cycling = false; SelectTool::~SelectTool() { @@ -297,7 +296,7 @@ bool SelectTool::item_handler(SPItem* item, GdkEvent* event) { } else { GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (desktop->getCanvas())); - this->dragging = TRUE; + this->dragging = TRUE; this->moved = FALSE; gdk_window_set_cursor(window, CursorSelectDragging); @@ -347,11 +346,11 @@ bool SelectTool::item_handler(SPItem* item, GdkEvent* event) { break; } case GDK_LEAVE_NOTIFY: - if (!desktop->isWaitingCursor() && !this->dragging) { + if (!desktop->isWaitingCursor() && !this->dragging) { GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (desktop->getCanvas())); gdk_window_set_cursor(window, this->cursor); - } + } break; case GDK_KEY_PRESS: @@ -379,61 +378,75 @@ bool SelectTool::item_handler(SPItem* item, GdkEvent* event) { } if (!ret) { - ret = ToolBase::item_handler(item, event); + ret = ToolBase::item_handler(item, event); } return ret; } void SelectTool::sp_select_context_cycle_through_items(Inkscape::Selection *selection, GdkEventScroll *scroll_event, bool shift_pressed) { - if (this->cycling_cur_item == this->cycling_items.end()) { + if ( this->cycling_items.empty() ) return; - } Inkscape::DrawingItem *arenaitem; - SPItem *item = *cycling_cur_item; - g_assert(item != NULL); - // Deactivate current item - if (std::find(cycling_items_selected_before.begin(), cycling_items_selected_before.end(), item) == cycling_items_selected_before.end() && selection->includes(item)) { - selection->remove(item); + if(cycling_cur_item) { + arenaitem = cycling_cur_item->get_arenaitem(desktop->dkey); + arenaitem->setOpacity(0.3); } - arenaitem = item->get_arenaitem(desktop->dkey); - arenaitem->setOpacity(0.3); - // Find next item and activate it - std::vector<SPItem *>::iterator next = this->cycling_cur_item; + + + std::vector<SPItem *>::iterator next = cycling_items.end(); + if (scroll_event->direction == GDK_SCROLL_UP) { - ++next; - if (next == this->cycling_items.end() && this->cycling_wrap) { - next = this->cycling_items.begin(); + if (! cycling_cur_item) { + next = cycling_items.begin(); + } else { + next = std::find( cycling_items.begin(), cycling_items.end(), cycling_cur_item ); + g_assert (next != cycling_items.end()); + next++; + if (next == cycling_items.end()) + if ( cycling_wrap ) + next = cycling_items.begin(); + else + next--; } - } else { - if(next == this->cycling_items.begin()) { - next = this->cycling_items.end(); + } else { + if (! cycling_cur_item) { + next = cycling_items.end(); + next--; + } else { + next = std::find( cycling_items.begin(), cycling_items.end(), cycling_cur_item ); + g_assert (next != cycling_items.end()); + if (next == cycling_items.begin()){ + if ( cycling_wrap ) { + next = cycling_items.end(); + next--; + } + } else { + next--; + } } - --next; } - if (next!=this->cycling_items.end()) { - this->cycling_cur_item = next; - item = *next; - g_assert(item != NULL); - } + this->cycling_cur_item = *next; + g_assert(next != cycling_items.end()); + g_assert(cycling_cur_item != NULL); - arenaitem = item->get_arenaitem(desktop->dkey); + arenaitem = cycling_cur_item->get_arenaitem(desktop->dkey); arenaitem->setOpacity(1.0); if (shift_pressed) { - selection->add(item); + selection->add(cycling_cur_item); } else { - selection->set(item); + selection->set(cycling_cur_item); } } void SelectTool::sp_select_context_reset_opacities() { - for (std::vector<SPItem *>::const_iterator l = this->cycling_items.begin(); l != this->cycling_items.end(); ++l ) { + for (std::vector<SPItem *>::const_iterator l = this->cycling_items_cmp.begin(); l != this->cycling_items_cmp.end(); ++l ) { SPItem *item = *l; if (item) { Inkscape::DrawingItem *arenaitem = item->get_arenaitem(desktop->dkey); @@ -443,10 +456,8 @@ void SelectTool::sp_select_context_reset_opacities() { } } - this->cycling_items.clear(); - this->cycling_items_selected_before.clear(); - this->cycling_cur_item = this->cycling_items.end(); this->cycling_items_cmp.clear(); + this->cycling_cur_item = NULL; } bool SelectTool::root_handler(GdkEvent* event) { @@ -533,11 +544,7 @@ bool SelectTool::root_handler(GdkEvent* event) { case GDK_MOTION_NOTIFY: { - if (is_cycling) { - moved_while_cycling = true; - } - - tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); + tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); if ((event->motion.state & GDK_BUTTON1_MASK) && !this->space_panning) { Geom::Point const motion_pt(event->motion.x, event->motion.y); @@ -703,7 +710,7 @@ bool SelectTool::root_handler(GdkEvent* event) { if (r->is_started() && !within_tolerance) { // this was a rubberband drag - std::vector<SPItem*> items; + std::vector<SPItem*> items; if (r->getMode() == RUBBERBAND_MODE_RECT) { Geom::OptRect const b = r->getRectangle(); @@ -796,107 +803,67 @@ bool SelectTool::root_handler(GdkEvent* event) { break; case GDK_SCROLL: { - GdkEventScroll *scroll_event = (GdkEventScroll*) event; - - if (scroll_event->state & GDK_MOD1_MASK) { // alt modified pressed - if (moved_while_cycling) { - moved_while_cycling = false; - this->sp_select_context_reset_opacities(); - } - - is_cycling = true; - - bool shift_pressed = scroll_event->state & GDK_SHIFT_MASK; - - /* Rebuild list of items underneath the mouse pointer */ - Geom::Point p = desktop->d2w(desktop->point()); - SPItem *item = desktop->getItemAtPoint(p, true, NULL); - - // Save pointer to current cycle-item so that we can find it again later, in the freshly built list - SPItem *tmp_cur_item = this->cycling_cur_item!=this->cycling_items.end() ? (*(this->cycling_cur_item)) : NULL; - this->cycling_items.clear(); - this->cycling_cur_item = this->cycling_items.end(); - while(item != NULL) { - this->cycling_items.push_back(item); - item = desktop->getItemAtPoint(p, true, item); - } - - /* Compare current item list with item list during previous scroll ... */ - bool item_lists_differ = this->cycling_items != this->cycling_items_cmp; - /* If list of items under mouse pointer hasn't changed ... */ - if (!item_lists_differ) { - // ... find current item in the freshly built list and continue cycling ... - // TODO: This wouldn't be necessary if cycling_cur_item pointed to an element of cycling_items_cmp instead - this->cycling_cur_item = std::find(this->cycling_items.begin(), this->cycling_items.end(), tmp_cur_item); - g_assert(this->cycling_cur_item != this->cycling_items.end() || this->cycling_items.empty()); - } else { - // ... otherwise reset opacities for outdated items ... - Inkscape::DrawingItem *arenaitem; - - for (std::vector<SPItem *>::const_iterator l = this->cycling_items_cmp.begin(); l != this->cycling_items_cmp.end(); ++l) { - SPItem *item = *l; - if (item) { - arenaitem = item->get_arenaitem(desktop->dkey); - arenaitem->setOpacity(1.0); - //if (!shift_pressed && !g_list_find(this->cycling_items_selected_before, item) && selection->includes(item)) - if (std::find(this->cycling_items_selected_before.begin(),this->cycling_items_selected_before.end(), item)==this->cycling_items_selected_before.end() && selection->includes(item)) { - selection->remove(item); - } - } - } + GdkEventScroll *scroll_event = (GdkEventScroll*) event; - // ... clear the lists ... + if ( ! (scroll_event->state & GDK_MOD1_MASK)) // do nothing specific if alt was not pressed + break; - this->cycling_items_cmp.clear(); - this->cycling_items_selected_before.clear(); - this->cycling_cur_item = this->cycling_items.end(); + bool shift_pressed = scroll_event->state & GDK_SHIFT_MASK; + is_cycling = true; - // ... and rebuild them with the new items. - this->cycling_items_cmp = (this->cycling_items); + /* Rebuild list of items underneath the mouse pointer */ + Geom::Point p = desktop->d2w(desktop->point()); + SPItem *item = desktop->getItemAtPoint(p, true, NULL); + this->cycling_items.clear(); - for(std::vector<SPItem *>::const_iterator l = this->cycling_items.begin(); l != this->cycling_items.end(); ++l) { - SPItem *item =*l; - if (item) { - arenaitem = item->get_arenaitem(desktop->dkey); - arenaitem->setOpacity(0.3); + SPItem *tmp = NULL; + while(item != NULL) { + this->cycling_items.push_back(item); + item = desktop->getItemAtPoint(p, true, item); + if (selection->includes(item)) tmp = item; + } - if (selection->includes(item)) { - // already selected items are stored separately, too - this->cycling_items_selected_before.push_back(item); - } - } else { - g_assert_not_reached(); - } + /* Compare current item list with item list during previous scroll ... */ + bool item_lists_differ = this->cycling_items != this->cycling_items_cmp; + + if(item_lists_differ) { + this->sp_select_context_reset_opacities(); + for (std::vector<SPItem *>::const_iterator l = this->cycling_items_cmp.begin(); l != this->cycling_items_cmp.end(); ++l) + selection->remove(*l); // deselects the previous content of the cycling loop + this->cycling_items_cmp = (this->cycling_items); + + // set opacities in new stack + for(std::vector<SPItem *>::const_iterator l = this->cycling_items.begin(); l != this->cycling_items.end(); ++l) { + SPItem *item =*l; + if (item) { + Inkscape::DrawingItem *arenaitem = item->get_arenaitem(desktop->dkey); + arenaitem->setOpacity(0.3); } - - // set the current item to the bottommost one so that the cycling step below re-starts at the top - this->cycling_cur_item = this->cycling_items.end(); - this->cycling_cur_item--; } + } + if(!cycling_cur_item) cycling_cur_item = tmp; - this->cycling_wrap = prefs->getBool("/options/selection/cycleWrap", true); + this->cycling_wrap = prefs->getBool("/options/selection/cycleWrap", true); - // Cycle through the items underneath the mouse pointer, one-by-one - this->sp_select_context_cycle_through_items(selection, scroll_event, shift_pressed); + // Cycle through the items underneath the mouse pointer, one-by-one + this->sp_select_context_cycle_through_items(selection, scroll_event, shift_pressed); - ret = TRUE; + ret = TRUE; - GtkWindow *w =GTK_WINDOW(gtk_widget_get_toplevel( GTK_WIDGET(desktop->canvas) )); - if (w) - { - gtk_window_present(w); - gtk_widget_grab_focus (GTK_WIDGET(desktop->canvas)); - } + GtkWindow *w =GTK_WINDOW(gtk_widget_get_toplevel( GTK_WIDGET(desktop->canvas) )); + if (w) { + gtk_window_present(w); + gtk_widget_grab_focus (GTK_WIDGET(desktop->canvas)); } break; } case GDK_KEY_PRESS: // keybindings for select context - { - { - guint keyval = get_group0_keyval(&event->key); - + { + { + guint keyval = get_group0_keyval(&event->key); + bool alt = ( MOD__ALT(event) || (keyval == GDK_KEY_Alt_L) || (keyval == GDK_KEY_Alt_R) @@ -924,7 +891,7 @@ bool SelectTool::root_handler(GdkEvent* event) { // if Alt and nonempty selection, show moving cursor ("move selected"): if (alt && !selection->isEmpty() && !desktop->isWaitingCursor()) { - GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (desktop->getCanvas())); + GdkWindow* window = gtk_widget_get_window (GTK_WIDGET (desktop->getCanvas())); gdk_window_set_cursor(window, CursorSelectDragging); } @@ -945,15 +912,15 @@ bool SelectTool::root_handler(GdkEvent* event) { if (MOD__ALT(event)) { // alt if (MOD__SHIFT(event)) { - sp_selection_move_screen(desktop->getSelection(), mul*-10, 0); // shift + sp_selection_move_screen(desktop->getSelection(), mul*-10, 0); // shift } else { - sp_selection_move_screen(desktop->getSelection(), mul*-1, 0); // no shift + sp_selection_move_screen(desktop->getSelection(), mul*-1, 0); // no shift } } else { // no alt if (MOD__SHIFT(event)) { - sp_selection_move(desktop->getSelection(), mul*-10*nudge, 0); // shift + sp_selection_move(desktop->getSelection(), mul*-10*nudge, 0); // shift } else { - sp_selection_move(desktop->getSelection(), mul*-nudge, 0); // no shift + sp_selection_move(desktop->getSelection(), mul*-nudge, 0); // no shift } } @@ -968,15 +935,15 @@ bool SelectTool::root_handler(GdkEvent* event) { if (MOD__ALT(event)) { // alt if (MOD__SHIFT(event)) { - sp_selection_move_screen(desktop->getSelection(), 0, mul*10); // shift + sp_selection_move_screen(desktop->getSelection(), 0, mul*10); // shift } else { - sp_selection_move_screen(desktop->getSelection(), 0, mul*1); // no shift + sp_selection_move_screen(desktop->getSelection(), 0, mul*1); // no shift } } else { // no alt if (MOD__SHIFT(event)) { - sp_selection_move(desktop->getSelection(), 0, mul*10*nudge); // shift + sp_selection_move(desktop->getSelection(), 0, mul*10*nudge); // shift } else { - sp_selection_move(desktop->getSelection(), 0, mul*nudge); // no shift + sp_selection_move(desktop->getSelection(), 0, mul*nudge); // no shift } } @@ -991,15 +958,15 @@ bool SelectTool::root_handler(GdkEvent* event) { if (MOD__ALT(event)) { // alt if (MOD__SHIFT(event)) { - sp_selection_move_screen(desktop->getSelection(), mul*10, 0); // shift + sp_selection_move_screen(desktop->getSelection(), mul*10, 0); // shift } else { - sp_selection_move_screen(desktop->getSelection(), mul*1, 0); // no shift + sp_selection_move_screen(desktop->getSelection(), mul*1, 0); // no shift } } else { // no alt if (MOD__SHIFT(event)) { - sp_selection_move(desktop->getSelection(), mul*10*nudge, 0); // shift + sp_selection_move(desktop->getSelection(), mul*10*nudge, 0); // shift } else { - sp_selection_move(desktop->getSelection(), mul*nudge, 0); // no shift + sp_selection_move(desktop->getSelection(), mul*nudge, 0); // no shift } } @@ -1014,15 +981,15 @@ bool SelectTool::root_handler(GdkEvent* event) { if (MOD__ALT(event)) { // alt if (MOD__SHIFT(event)) { - sp_selection_move_screen(desktop->getSelection(), 0, mul*-10); // shift + sp_selection_move_screen(desktop->getSelection(), 0, mul*-10); // shift } else { - sp_selection_move_screen(desktop->getSelection(), 0, mul*-1); // no shift + sp_selection_move_screen(desktop->getSelection(), 0, mul*-1); // no shift } } else { // no alt if (MOD__SHIFT(event)) { - sp_selection_move(desktop->getSelection(), 0, mul*-10*nudge); // shift + sp_selection_move(desktop->getSelection(), 0, mul*-10*nudge); // shift } else { - sp_selection_move(desktop->getSelection(), 0, mul*-nudge); // no shift + sp_selection_move(desktop->getSelection(), 0, mul*-nudge); // no shift } } @@ -1166,7 +1133,7 @@ bool SelectTool::root_handler(GdkEvent* event) { break; } break; - } + } case GDK_KEY_RELEASE: { guint keyval = get_group0_keyval(&event->key); if (key_is_a_modifier (keyval)) { @@ -1207,7 +1174,7 @@ bool SelectTool::root_handler(GdkEvent* event) { } if (!ret) { - ret = ToolBase::root_handler(event); + ret = ToolBase::root_handler(event); } return ret; diff --git a/src/ui/tools/select-tool.h b/src/ui/tools/select-tool.h index af183b1ca..420374661 100644 --- a/src/ui/tools/select-tool.h +++ b/src/ui/tools/select-tool.h @@ -42,8 +42,7 @@ public: std::vector<SPItem *> cycling_items; std::vector<SPItem *> cycling_items_cmp; - std::vector<SPItem *> cycling_items_selected_before; - std::vector<SPItem *>::iterator cycling_cur_item; + SPItem *cycling_cur_item; bool cycling_wrap; SPItem *item; diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index abac2c091..72ba499de 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -683,6 +683,11 @@ bool ToolBase::root_handler(GdkEvent* event) { } break; + case GDK_KEY_Menu: + sp_event_root_menu_popup(desktop, NULL, event); + ret = TRUE; + break; + case GDK_KEY_F10: if (MOD__SHIFT_ONLY(event)) { sp_event_root_menu_popup(desktop, NULL, event); @@ -1078,7 +1083,7 @@ void sp_event_root_menu_popup(SPDesktop *desktop, SPItem *item, GdkEvent *event) /* fixme: This is not what I want but works for now (Lauris) */ if (event->type == GDK_KEY_PRESS) { - item = desktop->getSelection()->singleItem(); + item = desktop->getSelection()->itemList().front(); } ContextMenu* CM = new ContextMenu(desktop, item); diff --git a/src/ui/widget/color-icc-selector.cpp b/src/ui/widget/color-icc-selector.cpp index b422892fe..e4f58fe8a 100644 --- a/src/ui/widget/color-icc-selector.cpp +++ b/src/ui/widget/color-icc-selector.cpp @@ -633,9 +633,10 @@ void ColorICCSelectorImpl::_switchToProfile(gchar const *name) #endif // DEBUG_LCMS tmp.set(SP_RGBA32_U_COMPOSE(pre[0], pre[1], pre[2], 0xff)); } + + dirty = true; } } - dirty = true; } } else { diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp index 298377af3..572845668 100644 --- a/src/ui/widget/registered-widget.cpp +++ b/src/ui/widget/registered-widget.cpp @@ -113,10 +113,8 @@ RegisteredToggleButton::~RegisteredToggleButton() _toggled_connection.disconnect(); } -RegisteredToggleButton::RegisteredToggleButton (const Glib::ustring& /*label*/, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right, Inkscape::XML::Node* repr_in, SPDocument *doc_in, char const *active_str, char const *inactive_str) +RegisteredToggleButton::RegisteredToggleButton (const Glib::ustring& /*label*/, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right, Inkscape::XML::Node* repr_in, SPDocument *doc_in, char const *icon_active, char const *icon_inactive) : RegisteredWidget<Gtk::ToggleButton>() - , _active_str(active_str) - , _inactive_str(inactive_str) { init_parent(key, wr, repr_in, doc_in); setProgrammatically = false; @@ -149,7 +147,7 @@ RegisteredToggleButton::on_toggled() return; _wr->setUpdating (true); - write_to_xml(get_active() ? _active_str : _inactive_str); + write_to_xml(get_active() ? "true" : "false"); //The slave button is greyed out if the master button is untoggled for (std::list<Gtk::Widget*>::const_iterator i = _slavewidgets.begin(); i != _slavewidgets.end(); ++i) { (*i)->set_sensitive(get_active()); diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h index 9d2489712..ab2e4c8e4 100644 --- a/src/ui/widget/registered-widget.h +++ b/src/ui/widget/registered-widget.h @@ -166,7 +166,7 @@ protected: class RegisteredToggleButton : public RegisteredWidget<Gtk::ToggleButton> { public: virtual ~RegisteredToggleButton(); - RegisteredToggleButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right=true, Inkscape::XML::Node* repr_in=NULL, SPDocument *doc_in=NULL, char const *active_str = "true", char const *inactive_str = "false"); + RegisteredToggleButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right=true, Inkscape::XML::Node* repr_in=NULL, SPDocument *doc_in=NULL, char const *icon_active = "true", char const *icon_inactive = "false"); void setActive (bool); @@ -183,7 +183,6 @@ public: // if a callback checks it, it must reset it back to false protected: - char const *_active_str, *_inactive_str; sigc::connection _toggled_connection; void on_toggled(); }; |
