[gnome-photos/wip/rishi/collection: 23/44] source-notification: ...
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/collection: 23/44] source-notification: ...
- Date: Fri, 2 Feb 2018 12:33:14 +0000 (UTC)
commit ed9071e84f16a1c033578dc9dd1d837f96a01f46
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Feb 2 13:14:12 2018 +0100
source-notification: ...
src/photos-source-notification.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
---
diff --git a/src/photos-source-notification.c b/src/photos-source-notification.c
index ad11899f..26b87c56 100644
--- a/src/photos-source-notification.c
+++ b/src/photos-source-notification.c
@@ -62,6 +62,24 @@ photos_source_notification_close (PhotosSourceNotification *self)
}
+static void
+photos_source_notification_import_notify_sensitive (GObject *object)
+{
+ GtkStyleContext *context;
+ gboolean sensitive;
+ const gchar *class_name;
+ const gchar *invert_class_name;
+
+ sensitive = gtk_widget_get_sensitive (GTK_WIDGET (object));
+ class_name = sensitive ? "photos-fade-in" : "photos-fade-out";
+ invert_class_name = !sensitive ? "photos-fade-in" : "photos-fade-out";
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (object));
+ gtk_style_context_remove_class (context, invert_class_name);
+ gtk_style_context_add_class (context, class_name);
+}
+
+
static void
photos_source_notification_settings_clicked (PhotosSourceNotification *self)
{
@@ -164,6 +182,10 @@ photos_source_notification_constructed (GObject *object)
id = photos_filterable_get_id (PHOTOS_FILTERABLE (self->source));
gtk_actionable_set_action_target (GTK_ACTIONABLE (import), "s", id);
gtk_container_add (GTK_CONTAINER (self), import);
+ g_signal_connect (import,
+ "notify::sensitive",
+ G_CALLBACK (photos_source_notification_import_notify_sensitive),
+ NULL);
}
else if (goa_object != NULL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]