Commit 224541aa authored by Pawel's avatar Pawel Committed by Bruno Coudoin

bar: added the keyboard shortcut ctrl-b do hide/show the GCompris control bar.

parent a2e2e110
......@@ -438,6 +438,7 @@ bar_set (const GComprisBarFlags flags)
static void
bar_hide (gboolean hide)
{
GcomprisProperties *properties = gc_prop_get();
/* Non yet initialized : Something Wrong */
if ( ! rootitem )
return;
......@@ -451,7 +452,8 @@ bar_hide (gboolean hide)
}
else
{
g_object_set(rootitem,
if(!properties->bar_hidden)
g_object_set(rootitem,
"visibility", GOO_CANVAS_ITEM_VISIBLE, NULL);
}
......
......@@ -328,6 +328,21 @@ board_widget_key_press_callback (GtkWidget *widget,
{
int kv = event->keyval;
if(event->state & GDK_CONTROL_MASK && ((event->keyval == GDK_b)
|| (event->keyval == GDK_B))) {
if(properties->bar_hidden){
g_message("Restoring the control bar\n");
properties->bar_hidden=FALSE;
gc_bar_hide(properties->bar_hidden);
}
else{
g_message("Hidding the control bar\n");
properties->bar_hidden=TRUE;
gc_bar_hide(properties->bar_hidden);
};
goo_canvas_update(GOO_CANVAS(canvas));
return TRUE;
}
if(event->state & GDK_CONTROL_MASK && ((event->keyval == GDK_r)
|| (event->keyval == GDK_R))) {
g_message("Refreshing the canvas\n");
......
......@@ -185,7 +185,7 @@ gc_prop_new ()
tmp->config_dir = gc_prop_default_config_directory_get();
tmp->user_dir = gc_prop_default_user_directory_get();
tmp->database = NULL;
tmp->bar_hidden = FALSE;
return (tmp);
}
......
......@@ -68,6 +68,8 @@ typedef struct {
gchar *server;
gint drag_mode;
gint zoom;
gboolean bar_hidden; /* Is the bar hiden */
} GcomprisProperties;
GcomprisProperties *gc_prop_get (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment