[gnome-flashback/wip/segeiger/gnome-3-18-inputmethods: 2/5] input-sources: add styles for hover states
- From: Sebastian Geiger <segeiger src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback/wip/segeiger/gnome-3-18-inputmethods: 2/5] input-sources: add styles for hover states
- Date: Sun, 17 Jan 2016 17:17:14 +0000 (UTC)
commit d84172a639cdf7c1acccc67a6973dabd65120ad2
Author: Sebastian Geiger <sbastig gmx net>
Date: Sun Jan 17 10:36:10 2016 +0100
input-sources: add styles for hover states
gnome-flashback/Adwaita.css | 4 ++
.../libinput-sources/gf-candidate-area.c | 30 ++++++++++++++++++++
2 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/gnome-flashback/Adwaita.css b/gnome-flashback/Adwaita.css
index b9f1085..cf5ff31 100644
--- a/gnome-flashback/Adwaita.css
+++ b/gnome-flashback/Adwaita.css
@@ -22,3 +22,7 @@ FlashbackLabelWindow
.selected .candidate-box {
background: #7b7b7b;
}
+
+.hover .candidate-box {
+ background: #8a8a8a;
+}
diff --git a/gnome-flashback/libinput-sources/gf-candidate-area.c
b/gnome-flashback/libinput-sources/gf-candidate-area.c
index ae60b17..ae603cc 100644
--- a/gnome-flashback/libinput-sources/gf-candidate-area.c
+++ b/gnome-flashback/libinput-sources/gf-candidate-area.c
@@ -88,6 +88,32 @@ next_button_clicked_cb (GtkButton *button,
return GDK_EVENT_PROPAGATE;
}
+static gboolean
+box_mouse_enter_cb (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_add_class (context, "hover");
+
+ return GDK_EVENT_PROPAGATE;
+}
+
+static gboolean
+box_mouse_leave_cb (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_remove_class (context, "hover");
+
+ return GDK_EVENT_PROPAGATE;
+}
+
void
gf_candidate_area_set_orientation (GfCandidateArea *area,
IBusOrientation orientation)
@@ -270,6 +296,10 @@ gf_candidate_area_init (GfCandidateArea *area)
g_signal_connect (event_box, "button-release-event",
G_CALLBACK (button_clicked_cb), area);
+ g_signal_connect (event_box, "enter-notify-event",
+ G_CALLBACK (box_mouse_enter_cb), area);
+ g_signal_connect (event_box, "leave-notify-event",
+ G_CALLBACK (box_mouse_leave_cb), area);
}
area->button_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]