Let the tray icon really be useful (showing and hiding)
This commit is contained in:
parent
12b63cf046
commit
f90aa0a790
|
@ -123,6 +123,9 @@ void on_view_hide(gpointer data)
|
|||
void on_systray_activate(gpointer data)
|
||||
{
|
||||
Keyboard * keyboard = data;
|
||||
gboolean visible;
|
||||
|
||||
keyboard_show(keyboard, TRUE);
|
||||
/* toggle visibility */
|
||||
visible = keyboard_is_visible(keyboard);
|
||||
keyboard_show(keyboard, visible ? FALSE : TRUE);
|
||||
}
|
||||
|
|
|
@ -537,6 +537,13 @@ void keyboard_delete(Keyboard * keyboard)
|
|||
|
||||
|
||||
/* accessors */
|
||||
/* keyboard_is_visible */
|
||||
gboolean keyboard_is_visible(Keyboard * keyboard)
|
||||
{
|
||||
return gtk_widget_get_visible(keyboard->window);
|
||||
}
|
||||
|
||||
|
||||
/* keyboard_set_layout */
|
||||
void keyboard_set_layout(Keyboard * keyboard, unsigned int which)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* $Id$ */
|
||||
/* Copyright (c) 2010 Pierre Pronchery <khorben@defora.org> */
|
||||
/* Copyright (c) 2010-2012 Pierre Pronchery <khorben@defora.org> */
|
||||
/* This file is part of DeforaOS Desktop Keyboard */
|
||||
/* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -48,6 +48,8 @@ Keyboard * keyboard_new(KeyboardPrefs * prefs);
|
|||
void keyboard_delete(Keyboard * keyboard);
|
||||
|
||||
/* accessors */
|
||||
gboolean keyboard_is_visible(Keyboard * keyboard);
|
||||
|
||||
/* XXX be more explicit */
|
||||
void keyboard_set_layout(Keyboard * keyboard, unsigned int which);
|
||||
void keyboard_set_page(Keyboard * keyboard, KeyboardPage page);
|
||||
|
|
Loading…
Reference in New Issue
Block a user