switch: Add a delayed state capability

This commit makes it possible for GtkSwitch to indicate when
the underlying state changes with a delay, causing the switch
to temporarily go 'out of sync' with the underlying change.

https://bugzilla.gnome.org/show_bug.cgi?id=725648
This commit is contained in:
Matthias Clasen
2014-03-29 13:40:08 -04:00
parent 4ebd2d3f7e
commit 7b11f761b3
2 changed files with 149 additions and 13 deletions

View File

@ -72,6 +72,7 @@ struct _GtkSwitchClass
void (* activate) (GtkSwitch *sw);
gboolean (* state_set) (GtkSwitch *sw, gboolean state);
/*< private >*/
void (* _switch_padding_1) (void);
@ -79,7 +80,6 @@ struct _GtkSwitchClass
void (* _switch_padding_3) (void);
void (* _switch_padding_4) (void);
void (* _switch_padding_5) (void);
void (* _switch_padding_6) (void);
};
GDK_AVAILABLE_IN_ALL
@ -94,6 +94,12 @@ void gtk_switch_set_active (GtkSwitch *sw,
GDK_AVAILABLE_IN_ALL
gboolean gtk_switch_get_active (GtkSwitch *sw);
GDK_AVAILABLE_IN_3_14
void gtk_switch_set_state (GtkSwitch *sw,
gboolean state);
GDK_AVAILABLE_IN_3_14
gboolean gtk_switch_get_state (GtkSwitch *sw);
G_END_DECLS
#endif /* __GTK_SWITCH_H__ */