summaryrefslogtreecommitdiff
path: root/plugins/gtkui
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-11-23 23:22:19 +0100
committerGravatar waker <wakeroid@gmail.com>2012-11-23 23:22:19 +0100
commit50861b90707678b0d06d31430f6bda7ba590febe (patch)
treef854ac0ebd33dfe83d61c98b9ecdef3fef7b36cc /plugins/gtkui
parentee555c9630cbc96107c7ed659be799042b2412a8 (diff)
gtkui: added toggle design mode hotkey
Diffstat (limited to 'plugins/gtkui')
-rw-r--r--plugins/gtkui/actionhandlers.c15
-rw-r--r--plugins/gtkui/actionhandlers.h6
-rw-r--r--plugins/gtkui/gtkui.c4
3 files changed, 23 insertions, 2 deletions
diff --git a/plugins/gtkui/actionhandlers.c b/plugins/gtkui/actionhandlers.c
index 2e3709ee..61468a31 100644
--- a/plugins/gtkui/actionhandlers.c
+++ b/plugins/gtkui/actionhandlers.c
@@ -807,4 +807,19 @@ action_toggle_statusbar_handler (DB_plugin_action_t *act, int ctx) {
return 0;
}
+gboolean
+action_toggle_designmode_handler_cb (void *data) {
+ GtkWidget *menuitem = lookup_widget (mainwin, "design_mode1");
+ gboolean act = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem));
+ act = !act;
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), act);
+ return FALSE;
+}
+
+int
+action_toggle_designmode_handler (DB_plugin_action_t *act, int ctx) {
+ g_idle_add (action_toggle_designmode_handler_cb, NULL);
+ return 0;
+}
+
diff --git a/plugins/gtkui/actionhandlers.h b/plugins/gtkui/actionhandlers.h
index 3973a4b1..6d549170 100644
--- a/plugins/gtkui/actionhandlers.h
+++ b/plugins/gtkui/actionhandlers.h
@@ -156,4 +156,10 @@ action_toggle_statusbar_handler_cb (void *data);
int
action_toggle_statusbar_handler (DB_plugin_action_t *act, int ctx);
+gboolean
+action_toggle_designmode_handler_cb (void *data);
+
+int
+action_toggle_designmode_handler (DB_plugin_action_t *act, int ctx);
+
#endif
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index cbc86cef..8600a886 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -1422,10 +1422,10 @@ static DB_plugin_action_t action_toggle_statusbar = {
};
static DB_plugin_action_t action_toggle_designmode = {
- .title = "Edit/[stub] Toggle design mode",
+ .title = "Edit/Toggle design mode",
.name = "toggle_design_mode",
.flags = DB_ACTION_COMMON,
- .callback = NULL,
+ .callback = action_toggle_designmode_handler,
.next = &action_toggle_statusbar
};