summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFelipe Corr??a da Silva Sanches <juca@members.fsf.org>2008-12-29 13:12:07 +0000
committerJucaBlues <JucaBlues@users.sourceforge.net>2008-12-29 13:12:07 +0000
commit75f746828fcc5b0c018e2a2c61c4afc576c49a9a (patch)
treedd6c518034f5138029b6401e6f481015e0ee2c0d /src
parentfixing the upside-down glyph issue for the missing-glyph case (which I (diff)
downloadinkscape-75f746828fcc5b0c018e2a2c61c4afc576c49a9a.tar.gz
inkscape-75f746828fcc5b0c018e2a2c61c4afc576c49a9a.zip
added a "remove" context menu option for removing kerning pairs
(bzr r7038)
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/svg-fonts-dialog.cpp43
-rw-r--r--src/ui/dialog/svg-fonts-dialog.h5
2 files changed, 43 insertions, 5 deletions
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp
index e2a5c196a..a29a01510 100644
--- a/src/ui/dialog/svg-fonts-dialog.cpp
+++ b/src/ui/dialog/svg-fonts-dialog.cpp
@@ -184,6 +184,20 @@ void SvgFontsDialog::glyphs_list_button_release(GdkEventButton* event)
}
}
+void SvgFontsDialog::kerning_pairs_list_button_release(GdkEventButton* event)
+{
+ if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) {
+ _KerningPairsContextMenu.popup(event->button, event->time);
+ }
+}
+
+void SvgFontsDialog::fonts_list_button_release(GdkEventButton* event)
+{
+ if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) {
+ _FontsContextMenu.popup(event->button, event->time);
+ }
+}
+
void SvgFontsDialog::create_glyphs_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem)
{
Gtk::MenuItem* mi = Gtk::manage(new Gtk::ImageMenuItem(Gtk::Stock::REMOVE));
@@ -193,12 +207,13 @@ void SvgFontsDialog::create_glyphs_popup_menu(Gtk::Widget& parent, sigc::slot<vo
_GlyphsContextMenu.accelerate(parent);
}
-
-void SvgFontsDialog::fonts_list_button_release(GdkEventButton* event)
+void SvgFontsDialog::create_kerning_pairs_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem)
{
- if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) {
- _FontsContextMenu.popup(event->button, event->time);
- }
+ Gtk::MenuItem* mi = Gtk::manage(new Gtk::ImageMenuItem(Gtk::Stock::REMOVE));
+ _KerningPairsContextMenu.append(*mi);
+ mi->signal_activate().connect(rem);
+ mi->show();
+ _KerningPairsContextMenu.accelerate(parent);
}
void SvgFontsDialog::create_fonts_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem)
@@ -547,6 +562,21 @@ void SvgFontsDialog::remove_selected_glyph(){
update_glyphs();
}
+void SvgFontsDialog::remove_selected_kerning_pair(){
+ if(!_KerningPairsList.get_selection()) return;
+
+ Gtk::TreeModel::iterator i = _KerningPairsList.get_selection()->get_selected();
+ if(!i) return;
+
+ SPGlyphKerning* pair = (*i)[_KerningPairsListColumns.spnode];
+ sp_repr_unparent(pair->repr);
+
+ SPDocument* doc = sp_desktop_document(this->getDesktop());
+ sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove kerning pair"));
+
+ update_glyphs();
+}
+
Gtk::VBox* SvgFontsDialog::glyphs_tab(){
_GlyphsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &SvgFontsDialog::glyphs_list_button_release));
create_glyphs_popup_menu(_GlyphsList, sigc::mem_fun(*this, &SvgFontsDialog::remove_selected_glyph));
@@ -630,6 +660,9 @@ void SvgFontsDialog::add_kerning_pair(){
}
Gtk::VBox* SvgFontsDialog::kerning_tab(){
+ _KerningPairsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &SvgFontsDialog::kerning_pairs_list_button_release));
+ create_kerning_pairs_popup_menu(_KerningPairsList, sigc::mem_fun(*this, &SvgFontsDialog::remove_selected_kerning_pair));
+
//Kerning Setup:
kerning_vbox.add(*Gtk::manage(new Gtk::Label(_("Kerning Setup:"))));
Gtk::HBox* kerning_selector = Gtk::manage(new Gtk::HBox());
diff --git a/src/ui/dialog/svg-fonts-dialog.h b/src/ui/dialog/svg-fonts-dialog.h
index d1d6b440d..83851de91 100644
--- a/src/ui/dialog/svg-fonts-dialog.h
+++ b/src/ui/dialog/svg-fonts-dialog.h
@@ -104,6 +104,7 @@ private:
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();
@@ -113,6 +114,9 @@ private:
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);
+
Inkscape::XML::SignalObserver _defs_observer; //in order to update fonts
Inkscape::XML::SignalObserver _glyphs_observer;
@@ -195,6 +199,7 @@ private:
Gtk::Menu _FontsContextMenu;
Gtk::Menu _GlyphsContextMenu;
+ Gtk::Menu _KerningPairsContextMenu;
SvgFontDrawingArea _font_da, kerning_preview;
GlyphComboBox first_glyph, second_glyph;