summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-11-23 23:18:37 +0100
committerGravatar waker <wakeroid@gmail.com>2012-11-23 23:18:37 +0100
commitee555c9630cbc96107c7ed659be799042b2412a8 (patch)
tree807c6dc748382dace226f34219d6851c3b106af5
parent8290c8efd930711e087f273ffeaa436921476c4e (diff)
gtkui: toggle statusbar hotkey
-rw-r--r--plugins/gtkui/actionhandlers.c20
-rw-r--r--plugins/gtkui/actionhandlers.h6
-rw-r--r--plugins/gtkui/gtkui.c14
3 files changed, 29 insertions, 11 deletions
diff --git a/plugins/gtkui/actionhandlers.c b/plugins/gtkui/actionhandlers.c
index a662cba9..2e3709ee 100644
--- a/plugins/gtkui/actionhandlers.c
+++ b/plugins/gtkui/actionhandlers.c
@@ -788,3 +788,23 @@ action_toggle_menu_handler (DB_plugin_action_t *act, int ctx) {
return 0;
}
+gboolean
+action_toggle_statusbar_handler_cb (void *data) {
+ GtkWidget *sb = lookup_widget (mainwin, "statusbar");
+ if (sb) {
+ int val = 1 - deadbeef->conf_get_int ("gtkui.statusbar.visible", 1);
+ deadbeef->conf_set_int ("gtkui.statusbar.visible", val);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "view_status_bar")), val);
+ val ? gtk_widget_show (sb) : gtk_widget_hide (sb);
+ deadbeef->conf_save ();
+ }
+ return FALSE;
+}
+
+int
+action_toggle_statusbar_handler (DB_plugin_action_t *act, int ctx) {
+ g_idle_add (action_toggle_statusbar_handler_cb, NULL);
+ return 0;
+}
+
+
diff --git a/plugins/gtkui/actionhandlers.h b/plugins/gtkui/actionhandlers.h
index 5ed9520a..3973a4b1 100644
--- a/plugins/gtkui/actionhandlers.h
+++ b/plugins/gtkui/actionhandlers.h
@@ -150,4 +150,10 @@ action_toggle_menu_handler_cb (void *data);
int
action_toggle_menu_handler (DB_plugin_action_t *act, int ctx);
+gboolean
+action_toggle_statusbar_handler_cb (void *data);
+
+int
+action_toggle_statusbar_handler (DB_plugin_action_t *act, int ctx);
+
#endif
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index f3fc357c..cbc86cef 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -1413,20 +1413,12 @@ static DB_plugin_action_t action_toggle_menu = {
.next = &action_scroll_follows_playback
};
-static DB_plugin_action_t action_toggle_column_headers = {
- .title = "View/[stub] Show\\/Hide playlist column headers",
- .name = "toggle_headers",
- .flags = DB_ACTION_COMMON,
- .callback = NULL,
- .next = &action_toggle_menu
-};
-
static DB_plugin_action_t action_toggle_statusbar = {
- .title = "View/[stub] Show\\/Hide statusbar",
+ .title = "View/Show\\/Hide statusbar",
.name = "toggle_statusbar",
.flags = DB_ACTION_COMMON,
- .callback = NULL,
- .next = &action_toggle_column_headers
+ .callback = action_toggle_statusbar_handler,
+ .next = &action_toggle_menu
};
static DB_plugin_action_t action_toggle_designmode = {