[gimp/gtk3-port: 448/451] app: undeprecate GimpDeviceStatus. don't use gtk_widget_set_state()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 448/451] app: undeprecate GimpDeviceStatus. don't use gtk_widget_set_state()
- Date: Wed, 16 May 2018 01:41:57 +0000 (UTC)
commit 814972db43f244788f37a470d36aece2e8f3d227
Author: Michael Natterer <mitch gimp org>
Date: Mon May 14 12:22:57 2018 +0200
app: undeprecate GimpDeviceStatus. don't use gtk_widget_set_state()
Use the same code as GimpPrefsBox to make the active device look like
a selected list item.
app/widgets/gimpdevicestatus.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/app/widgets/gimpdevicestatus.c b/app/widgets/gimpdevicestatus.c
index c615c3a..140f63f 100644
--- a/app/widgets/gimpdevicestatus.c
+++ b/app/widgets/gimpdevicestatus.c
@@ -455,11 +455,20 @@ gimp_device_status_notify_device (GimpDeviceManager *manager,
for (list = status->devices; list; list = list->next)
{
- GimpDeviceStatusEntry *entry = list->data;
+ GimpDeviceStatusEntry *entry = list->data;
+ GtkWidget *widget = entry->ebox;
+ GtkStyleContext *style = gtk_widget_get_style_context (widget);
- gtk_widget_set_state (entry->ebox,
- entry->device_info == status->current_device ?
- GTK_STATE_SELECTED : GTK_STATE_NORMAL);
+ if (entry->device_info == status->current_device)
+ {
+ gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_SELECTED, TRUE);
+ gtk_style_context_add_class (style, GTK_STYLE_CLASS_VIEW);
+ }
+ else
+ {
+ gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_NORMAL, TRUE);
+ gtk_style_context_remove_class (style, GTK_STYLE_CLASS_VIEW);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]