From 78837a8959c79864102f9d36058b50b1dbf840b7 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Tue, 19 Oct 2010 19:01:11 +0200 Subject: Context menu. Fix for Bug #170806 (Add Fill&stroke to right-click menu for texts). Fixed bugs: - https://launchpad.net/bugs/170806 (bzr r9835) --- src/ui/context-menu.cpp | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) (limited to 'src/ui/context-menu.cpp') diff --git a/src/ui/context-menu.cpp b/src/ui/context-menu.cpp index 98ad9dc7b..43de518c6 100644 --- a/src/ui/context-menu.cpp +++ b/src/ui/context-menu.cpp @@ -46,6 +46,7 @@ sp_object_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu) #include "sp-anchor.h" #include "sp-image.h" +#include "sp-text.h" #include "document.h" #include "desktop-handles.h" @@ -64,6 +65,7 @@ static void sp_group_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu); static void sp_anchor_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu); static void sp_image_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu); static void sp_shape_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu); +static void sp_text_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu); static void sp_object_type_menu(GType type, SPObject *object, SPDesktop *desktop, GtkMenu *menu) @@ -77,6 +79,7 @@ sp_object_type_menu(GType type, SPObject *object, SPDesktop *desktop, GtkMenu *m g_hash_table_insert(t2m, GUINT_TO_POINTER(SP_TYPE_ANCHOR), (void*)sp_anchor_menu); g_hash_table_insert(t2m, GUINT_TO_POINTER(SP_TYPE_IMAGE), (void*)sp_image_menu); g_hash_table_insert(t2m, GUINT_TO_POINTER(SP_TYPE_SHAPE), (void*)sp_shape_menu); + g_hash_table_insert(t2m, GUINT_TO_POINTER(SP_TYPE_TEXT), (void*)sp_text_menu); } handler = (void (*)(SPObject*, SPDesktop*, GtkMenu*))g_hash_table_lookup(t2m, GUINT_TO_POINTER(type)); if (handler) handler(object, desktop, menu); @@ -102,7 +105,7 @@ sp_item_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) item = (SPItem *) object; /* Item dialog */ - w = gtk_menu_item_new_with_mnemonic(_("Object _Properties")); + w = gtk_menu_item_new_with_mnemonic(_("_Object Properties...")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_item_properties), item); gtk_widget_show(w); @@ -343,7 +346,7 @@ sp_anchor_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) item = (SPItem *) object; /* Link dialog */ - w = gtk_menu_item_new_with_mnemonic(_("Link _Properties")); + w = gtk_menu_item_new_with_mnemonic(_("Link _Properties...")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_anchor_link_properties), item); gtk_widget_show(w); @@ -402,7 +405,7 @@ sp_image_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) GtkWidget *w; /* Link dialog */ - w = gtk_menu_item_new_with_mnemonic(_("Image _Properties")); + w = gtk_menu_item_new_with_mnemonic(_("Image _Properties...")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_image_image_properties), item); gtk_widget_show(w); @@ -473,10 +476,10 @@ static void sp_image_image_edit(GtkMenuItem *menuitem, SPAnchor *anchor) g_free(editorBin); } -/* SPShape */ +/* Fill and Stroke entry */ static void -sp_shape_fill_settings(GtkMenuItem *menuitem, SPItem *item) +sp_fill_settings(GtkMenuItem *menuitem, SPItem *item) { SPDesktop *desktop; @@ -492,6 +495,8 @@ sp_shape_fill_settings(GtkMenuItem *menuitem, SPItem *item) desktop->_dlg_mgr->showDialog("FillAndStroke"); } +/* SPShape */ + static void sp_shape_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) { @@ -501,14 +506,32 @@ sp_shape_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) item = (SPItem *) object; /* Item dialog */ - w = gtk_menu_item_new_with_mnemonic(_("_Fill and Stroke")); + w = gtk_menu_item_new_with_mnemonic(_("_Fill and Stroke...")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); - gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_shape_fill_settings), item); + gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_fill_settings), item); gtk_widget_show(w); gtk_menu_append(GTK_MENU(m), w); } +/* SPText */ + +static void +sp_text_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) +{ + SPItem *item; + GtkWidget *w; + item = (SPItem *) object; + + /* Fill and Stroke dialog */ + w = gtk_menu_item_new_with_mnemonic(_("_Fill and Stroke...")); + gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); + gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_fill_settings), item); + gtk_widget_show(w); + gtk_menu_append(GTK_MENU(m), w); + + +} /* Local Variables: mode:c++ -- cgit v1.2.3 From 0cafe59f8496b8cceb2886a66c4ce0cda84680ad Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sun, 24 Oct 2010 15:15:25 +0200 Subject: Adding spellchecker and T&F dialogs to the text context (right click) menu. (bzr r9849) --- src/ui/context-menu.cpp | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'src/ui/context-menu.cpp') diff --git a/src/ui/context-menu.cpp b/src/ui/context-menu.cpp index 43de518c6..85eb9c638 100644 --- a/src/ui/context-menu.cpp +++ b/src/ui/context-menu.cpp @@ -54,6 +54,8 @@ sp_object_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu) #include "selection-chemistry.h" #include "dialogs/item-properties.h" #include "dialogs/object-attributes.h" +#include "dialogs/text-edit.h" +#include "dialogs/spellcheck.h" #include "sp-path.h" #include "sp-clippath.h" @@ -513,6 +515,44 @@ sp_shape_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) gtk_menu_append(GTK_MENU(m), w); } +/* Edit Text entry */ + +static void +sp_text_settings(GtkMenuItem *menuitem, SPItem *item) +{ + SPDesktop *desktop; + + g_assert(SP_IS_ITEM(item)); + + desktop = (SPDesktop*)gtk_object_get_data(GTK_OBJECT(menuitem), "desktop"); + g_return_if_fail(desktop != NULL); + + if (sp_desktop_selection(desktop)->isEmpty()) { + sp_desktop_selection(desktop)->set(item); + } + + sp_text_edit_dialog(); +} + +/* Spellcheck entry */ + +static void +sp_spellcheck_settings(GtkMenuItem *menuitem, SPItem *item) +{ + SPDesktop *desktop; + + g_assert(SP_IS_ITEM(item)); + + desktop = (SPDesktop*)gtk_object_get_data(GTK_OBJECT(menuitem), "desktop"); + g_return_if_fail(desktop != NULL); + + if (sp_desktop_selection(desktop)->isEmpty()) { + sp_desktop_selection(desktop)->set(item); + } + + sp_spellcheck_dialog(); +} + /* SPText */ static void @@ -530,7 +570,19 @@ sp_text_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) gtk_widget_show(w); gtk_menu_append(GTK_MENU(m), w); + /* Edit Text dialog */ + w = gtk_menu_item_new_with_mnemonic(_("_Text and Font...")); + gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); + gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_text_settings), item); + gtk_widget_show(w); + gtk_menu_append(GTK_MENU(m), w); + /* Spellcheck dialog */ + w = gtk_menu_item_new_with_mnemonic(_("Check Spellin_g...")); + gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); + gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_spellcheck_settings), item); + gtk_widget_show(w); + gtk_menu_append(GTK_MENU(m), w); } /* Local Variables: -- cgit v1.2.3 From 2e76284350f91635e7d82e4e5b300f4cb4da71ca Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Mon, 25 Oct 2010 10:10:59 +0200 Subject: UI fixes (punctuation, units, accelerator keys) (a. o. Bug #560751 ) (bzr r9851) --- src/ui/context-menu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui/context-menu.cpp') diff --git a/src/ui/context-menu.cpp b/src/ui/context-menu.cpp index 85eb9c638..96b3f591a 100644 --- a/src/ui/context-menu.cpp +++ b/src/ui/context-menu.cpp @@ -156,7 +156,7 @@ sp_item_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) gtk_widget_show(w); gtk_menu_append(GTK_MENU(m), w); /* Set Clip */ - w = gtk_menu_item_new_with_mnemonic(_("Set Clip")); + w = gtk_menu_item_new_with_mnemonic(_("Set _Clip")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_set_clip), item); if ((item && item->mask_ref && item->mask_ref->getObject()) || (item->clip_ref && item->clip_ref->getObject())) { @@ -167,7 +167,7 @@ sp_item_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) gtk_widget_show(w); gtk_menu_append(GTK_MENU(m), w); /* Release Clip */ - w = gtk_menu_item_new_with_mnemonic(_("Release Clip")); + w = gtk_menu_item_new_with_mnemonic(_("Release C_lip")); gtk_object_set_data(GTK_OBJECT(w), "desktop", desktop); gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_release_clip), item); if (item && item->clip_ref && item->clip_ref->getObject()) { -- cgit v1.2.3 From 144819c918dc761641c3cb5a490205fb73194ee3 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Wed, 17 Nov 2010 13:12:56 +1100 Subject: Super duper mega (fun!) commit: replaced encoding=utf-8 with fileencoding=utf-8 in all 1074 Vim modelines. The reason for this is that (a) setting the encoding isn't nice, and (b) Vim 7.3 (with modeline enabled) disallows it and pops up an error whenever you open any file with it ("invalid modeline"). Also corrected five deviant modestrings: * src/ui/widget/dock.cpp and src/ui/widget/dock.h: missing colon at the end * src/ui/dialog/tile.cpp: removed gratuitous second colon at the end * src/helper/units-test.h: removed gratuitous space before a colon * share/extensions/export_gimp_palette.py: missing textwidth=99 That's my geekiest commit yet. (bzr r9900) --- src/ui/context-menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/context-menu.cpp') diff --git a/src/ui/context-menu.cpp b/src/ui/context-menu.cpp index 96b3f591a..262fdcf32 100644 --- a/src/ui/context-menu.cpp +++ b/src/ui/context-menu.cpp @@ -593,4 +593,4 @@ sp_text_menu(SPObject *object, SPDesktop *desktop, GtkMenu *m) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3