summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFelipe Corr??a da Silva Sanches <juca@members.fsf.org>2009-05-04 11:49:18 +0000
committerjucablues <jucablues@users.sourceforge.net>2009-05-04 11:49:18 +0000
commit4315349e3ef79fe6d7ceeefc1e9c2da8299a76aa (patch)
treedcabb432c3be7e2fffea27c417e06d66d77cc0d1 /src
parentUpdate name list (diff)
downloadinkscape-4315349e3ef79fe6d7ceeefc1e9c2da8299a76aa.tar.gz
inkscape-4315349e3ef79fe6d7ceeefc1e9c2da8299a76aa.zip
add "Reset missing glyph" button to svgfonts dialog
(bzr r7819)
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/svg-fonts-dialog.cpp25
-rw-r--r--src/ui/dialog/svg-fonts-dialog.h2
2 files changed, 26 insertions, 1 deletions
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp
index 98b59d790..a662ff1d1 100644
--- a/src/ui/dialog/svg-fonts-dialog.cpp
+++ b/src/ui/dialog/svg-fonts-dialog.cpp
@@ -555,6 +555,25 @@ void SvgFontsDialog::missing_glyph_description_from_selected_path(){
update_glyphs();
}
+void SvgFontsDialog::reset_missing_glyph_description(){
+ SPDesktop* desktop = this->getDesktop();
+ if (!desktop) {
+ g_warning("SvgFontsDialog: No active desktop");
+ return;
+ }
+
+ SPDocument* doc = sp_desktop_document(desktop);
+ SPObject* obj;
+ for (obj = get_selected_spfont()->children; obj; obj=obj->next){
+ if (SP_IS_MISSING_GLYPH(obj)){
+ obj->repr->setAttribute("d", (char*) "M0,0h1000v1024h-1000z");
+ sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Reset missing-glyph"));
+ }
+ }
+
+ update_glyphs();
+}
+
void SvgFontsDialog::glyph_name_edit(const Glib::ustring&, const Glib::ustring& str){
Gtk::TreeModel::iterator i = _GlyphsList.get_selection()->get_selected();
if (!i) return;
@@ -629,8 +648,12 @@ Gtk::VBox* SvgFontsDialog::glyphs_tab(){
Gtk::Label* missing_glyph_label = Gtk::manage(new Gtk::Label(_("Missing Glyph:")));
missing_glyph_hbox->pack_start(*missing_glyph_label, false,false);
missing_glyph_hbox->pack_start(missing_glyph_button, false,false);
+ missing_glyph_hbox->pack_start(missing_glyph_reset_button, false,false);
missing_glyph_button.set_label(_("From selection..."));
missing_glyph_button.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::missing_glyph_description_from_selected_path));
+ missing_glyph_reset_button.set_label(_("Reset"));
+ missing_glyph_reset_button.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::reset_missing_glyph_description));
+
glyphs_vbox.pack_start(*missing_glyph_hbox, false,false);
glyphs_vbox.add(_GlyphsListScroller);
@@ -771,7 +794,7 @@ SPFont *new_font(SPDocument *document)
//create a missing glyph
Inkscape::XML::Node *mg;
mg = xml_doc->createElement("svg:missing-glyph");
- mg->setAttribute("d", "M0,0h1020v1024h-1020z");
+ mg->setAttribute("d", "M0,0h1000v1024h-1000z");
repr->appendChild(mg);
// get corresponding object
diff --git a/src/ui/dialog/svg-fonts-dialog.h b/src/ui/dialog/svg-fonts-dialog.h
index 83851de91..e6042ed42 100644
--- a/src/ui/dialog/svg-fonts-dialog.h
+++ b/src/ui/dialog/svg-fonts-dialog.h
@@ -99,6 +99,7 @@ private:
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&);
@@ -131,6 +132,7 @@ private:
Gtk::Button add_glyph_button;
Gtk::Button glyph_from_path_button;
Gtk::Button missing_glyph_button;
+ Gtk::Button missing_glyph_reset_button;
class Columns : public Gtk::TreeModel::ColumnRecord
{