From c343379128c0fed3e7bc71637efbcce6a67776a4 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 1 Apr 2010 02:36:46 -0700 Subject: [PATCH] Initial cut of glyph selector dialog is in. Fixes bug #343186. --- src/menus-skeleton.h | 1 + src/ui/dialog/Makefile_insert | 2 ++ src/ui/dialog/dialog-manager.cpp | 7 +++++-- src/ui/widget/panel.cpp | 12 ++++++------ src/verbs.cpp | 6 ++++++ src/verbs.h | 1 + 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h index 581b8b39c..978b555b0 100644 --- a/src/menus-skeleton.h +++ b/src/menus-skeleton.h @@ -228,6 +228,7 @@ static char const menus_skeleton[] = #ifdef ENABLE_SVG_FONTS " \n" #endif // ENABLE_SVG_FONTS +" \n" " \n" " \n" " \n" diff --git a/src/ui/dialog/Makefile_insert b/src/ui/dialog/Makefile_insert index 033bec875..7546bc195 100644 --- a/src/ui/dialog/Makefile_insert +++ b/src/ui/dialog/Makefile_insert @@ -50,6 +50,8 @@ ink_common_sources += \ ui/dialog/find.h \ ui/dialog/floating-behavior.cpp \ ui/dialog/floating-behavior.h \ + ui/dialog/glyphs.cpp \ + ui/dialog/glyphs.h \ ui/dialog/guides.cpp \ ui/dialog/guides.h \ ui/dialog/icon-preview.cpp \ diff --git a/src/ui/dialog/dialog-manager.cpp b/src/ui/dialog/dialog-manager.cpp index 30cbed649..6d3bc817e 100644 --- a/src/ui/dialog/dialog-manager.cpp +++ b/src/ui/dialog/dialog-manager.cpp @@ -25,6 +25,7 @@ #include "ui/dialog/fill-and-stroke.h" #include "ui/dialog/filter-effects-dialog.h" #include "ui/dialog/find.h" +#include "ui/dialog/glyphs.h" #include "ui/dialog/inkscape-preferences.h" #include "ui/dialog/input.h" #include "ui/dialog/livepatheffect-editor.h" @@ -96,6 +97,7 @@ DialogManager::DialogManager() { registerFactory("FillAndStroke", &create); registerFactory("FilterEffectsDialog", &create); registerFactory("Find", &create); + registerFactory("Glyphs", &create); registerFactory("IconPreviewPanel", &create); registerFactory("InkscapePreferences", &create); registerFactory("LayersPanel", &create); @@ -123,6 +125,7 @@ DialogManager::DialogManager() { registerFactory("FillAndStroke", &create); registerFactory("FilterEffectsDialog", &create); registerFactory("Find", &create); + registerFactory("Glyphs", &create); registerFactory("IconPreviewPanel", &create); registerFactory("InkscapePreferences", &create); registerFactory("LayersPanel", &create); @@ -159,11 +162,11 @@ DialogManager &DialogManager::getInstance() /* Use singleton behavior for floating dialogs */ if (dialogs_type == FLOATING) { static DialogManager *instance = 0; - + if (!instance) instance = new DialogManager(); return *instance; - } + } return *new DialogManager(); } diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp index 93a950d1a..4b806afb5 100644 --- a/src/ui/widget/panel.cpp +++ b/src/ui/widget/panel.cpp @@ -133,9 +133,9 @@ void Panel::_init() { //TRANSLATORS: only translate "string" in "context|string". // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS - Glib::ustring heightItemLabel(Q_("swatches|Size")); + Glib::ustring heightItemLabel(Q_("swatches|Size")); - //TRANSLATORS: Indicates size of colour swatches + //TRANSLATORS: Indicates size of colour swatches const gchar *heightLabels[] = { N_("tiny"), N_("small"), @@ -157,7 +157,7 @@ void Panel::_init() Gtk::RadioMenuItem* _item = manage(new Gtk::RadioMenuItem(heightGroup, _label)); sizeMenu->append(*_item); if (i == panel_size) { - _item->set_active(true); + _item->set_active(true); } _item->signal_activate().connect(sigc::bind(sigc::mem_fun(*this, &Panel::_bounceCall), PANEL_SETTING_SIZE, i)); } @@ -198,11 +198,11 @@ void Panel::_init() } } for ( guint i = 0; i < G_N_ELEMENTS(widthLabels); ++i ) { - Glib::ustring _label(Q_(widthLabels[i])); + Glib::ustring _label(Q_(widthLabels[i])); Gtk::RadioMenuItem *_item = manage(new Gtk::RadioMenuItem(widthGroup, _label)); type_menu->append(*_item); if ( i <= hot_index ) { - _item->set_active(true); + _item->set_active(true); } _item->signal_activate().connect(sigc::bind(sigc::mem_fun(*this, &Panel::_bounceCall), PANEL_SETTING_SHAPE, values[i])); } @@ -212,7 +212,7 @@ void Panel::_init() //TRANSLATORS: only translate "string" in "context|string". // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS // "Wrap" indicates how colour swatches are displayed - Glib::ustring wrap_label(Q_("swatches|Wrap")); + Glib::ustring wrap_label(Q_("swatches|Wrap")); Gtk::CheckMenuItem *check = manage(new Gtk::CheckMenuItem(wrap_label)); check->set_active(panel_wrap); _menu->append(*check); diff --git a/src/verbs.cpp b/src/verbs.cpp index dc1116953..66b6140b4 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -73,6 +73,7 @@ #include "ui/dialog/dialog-manager.h" #include "ui/dialog/document-properties.h" #include "ui/dialog/extensions.h" +#include "ui/dialog/glyphs.h" #include "ui/dialog/icon-preview.h" #include "ui/dialog/inkscape-preferences.h" #include "ui/dialog/layer-properties.h" @@ -1731,6 +1732,9 @@ DialogVerb::perform(SPAction *action, void *data, void */*pdata*/) case SP_VERB_DIALOG_FILL_STROKE: dt->_dlg_mgr->showDialog("FillAndStroke"); break; + case SP_VERB_DIALOG_GLYPHS: + dt->_dlg_mgr->showDialog("Glyphs"); + break; case SP_VERB_DIALOG_SWATCHES: dt->_dlg_mgr->showDialog("Swatches"); break; @@ -2597,6 +2601,8 @@ Verb *Verb::_base_verbs[] = { N_("Edit document metadata (to be saved with the document)"), INKSCAPE_ICON_DOCUMENT_METADATA ), new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke..."), N_("Edit objects' colors, gradients, stroke width, arrowheads, dash patterns..."), INKSCAPE_ICON_DIALOG_FILL_AND_STROKE), + new DialogVerb(SP_VERB_DIALOG_GLYPHS, "DialogGlyphs", N_("Glyphs..."), + N_("Select characters from a glyphs palette"), GTK_STOCK_SELECT_FONT), // TRANSLATORS: "Swatches" means: color samples new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches..."), N_("Select colors from a swatches palette"), GTK_STOCK_SELECT_COLOR), diff --git a/src/verbs.h b/src/verbs.h index 7cc580f26..eea6042c0 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -227,6 +227,7 @@ enum { SP_VERB_DIALOG_NAMEDVIEW, SP_VERB_DIALOG_METADATA, SP_VERB_DIALOG_FILL_STROKE, + SP_VERB_DIALOG_GLYPHS, SP_VERB_DIALOG_SWATCHES, SP_VERB_DIALOG_TRANSFORM, SP_VERB_DIALOG_ALIGN_DISTRIBUTE, -- 2.30.2