chiark
/
gitweb
/
~mdw
/
disorder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
06f35dd
)
Inverst sense of pause menu item.
author
Richard Kettlewell
<rjk@greenend.org.uk>
Wed, 9 Jun 2010 18:44:59 +0000
(19:44 +0100)
committer
Richard Kettlewell
<rjk@greenend.org.uk>
Wed, 9 Jun 2010 18:44:59 +0000
(19:44 +0100)
disobedience/control.c
patch
|
blob
|
blame
|
history
diff --git
a/disobedience/control.c
b/disobedience/control.c
index b2dfce0da5f883e22ac57327efc350a380469771..f45492f1e191ed767f273fe452d3f18c26721462 100644
(file)
--- a/
disobedience/control.c
+++ b/
disobedience/control.c
@@
-128,6
+128,9
@@
struct icon {
* Can be NULL for always sensitive.
*/
int (*sensitive)(void);
* Can be NULL for always sensitive.
*/
int (*sensitive)(void);
+
+ /** @brief True if the menu item has inverse sense to the button */
+ gboolean menu_invert;
/** @brief Pointer to button */
GtkWidget *button;
/** @brief Pointer to button */
GtkWidget *button;
@@
-192,6
+195,7
@@
static struct icon icons[] = {
action_go_on: disorder_eclient_pause,
action_go_off: disorder_eclient_resume,
events: "pause-changed playing-changed rights-changed playing-track-changed",
action_go_on: disorder_eclient_pause,
action_go_off: disorder_eclient_resume,
events: "pause-changed playing-changed rights-changed playing-track-changed",
+ menu_invert: TRUE,
},
{
stock: TRUE,
},
{
stock: TRUE,
@@
-418,7
+422,8
@@
static void icon_changed(const char attribute((unused)) *event,
/* Icons with an associated menu item */
if(icon->item) {
if(icon->toggle)
/* Icons with an associated menu item */
if(icon->item) {
if(icon->toggle)
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(icon->item), on);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(icon->item),
+ !!icon->menu_invert ^ !!on);
gtk_widget_set_sensitive(icon->item, sensitive);
}
--suppress_actions;
gtk_widget_set_sensitive(icon->item, sensitive);
}
--suppress_actions;