[gtk/gtk-3-24] emoji: Improve section scrolling
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24] emoji: Improve section scrolling
- Date: Sun, 3 Jun 2018 13:45:28 +0000 (UTC)
commit a628e03042a980a2d946e638b67d308a0762943d
Author: Matthias Clasen <mclasen redhat com>
Date: Thu May 17 16:37:26 2018 +0100
emoji: Improve section scrolling
Leave some space above the section heading when scrolling.
This is a part of https://gitlab.gnome.org/GNOME/gtk/merge_requests/143
by Julian Sperber.
gtk/gtkemojichooser.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c
index 9697dad4b6..b2e5b15d0f 100644
--- a/gtk/gtkemojichooser.c
+++ b/gtk/gtkemojichooser.c
@@ -35,6 +35,8 @@
#include "gtkintl.h"
#include "gtkprivate.h"
+#define BOX_SPACE 6
+
typedef struct {
GtkWidget *box;
GtkWidget *heading;
@@ -124,7 +126,7 @@ scroll_to_section (GtkButton *button,
if (section->heading)
gtk_widget_get_allocation (section->heading, &alloc);
- gtk_adjustment_animate_to_value (adj, alloc.y);
+ gtk_adjustment_animate_to_value (adj, alloc.y - BOX_SPACE);
}
static void
@@ -493,7 +495,7 @@ adj_value_changed (GtkAdjustment *adj,
else
gtk_widget_get_allocation (section->box, &alloc);
- if (value < alloc.y)
+ if (value < alloc.y - BOX_SPACE)
break;
select_section = section;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]