[libadwaita/wip/exalm/tab-overview: 12/15] tab-list-base: Simplify click scrolling check
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/tab-overview: 12/15] tab-list-base: Simplify click scrolling check
- Date: Tue, 12 Oct 2021 08:51:31 +0000 (UTC)
commit 5ba13f4f602839f4c763d3e4fea54c1fc8a19534
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sat Aug 21 19:28:13 2021 +0500
tab-list-base: Simplify click scrolling check
src/adw-tab-list-base.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/src/adw-tab-list-base.c b/src/adw-tab-list-base.c
index 5b01cc90..198e2a46 100644
--- a/src/adw-tab-list-base.c
+++ b/src/adw-tab-list-base.c
@@ -2831,24 +2831,16 @@ handle_click (AdwTabListBase *self,
AdwTabListBasePrivate *priv = adw_tab_list_base_get_instance_private (self);
gboolean can_grab_focus;
- if (priv->adjustment) {
- int pos = get_tab_position (self, info);
- double value = gtk_adjustment_get_value (priv->adjustment);
- double page_size = gtk_adjustment_get_page_size (priv->adjustment);
-
- if (pos + OVERLAP < value ||
- pos + info->width - OVERLAP > value + page_size) {
- gtk_gesture_set_state (gesture, GTK_EVENT_SEQUENCE_CLAIMED);
+ if (!adw_tab_item_get_fully_visible (info->tab)) {
+ gtk_gesture_set_state (gesture, GTK_EVENT_SEQUENCE_CLAIMED);
- scroll_to_tab (self, info, SCROLL_ANIMATION_DURATION);
+ scroll_to_tab (self, info, SCROLL_ANIMATION_DURATION);
- return;
- }
+ return;
}
can_grab_focus = ADW_TAB_LIST_BASE_GET_CLASS (self)->tabs_have_visible_focus (self);
-
if (info == priv->selected_tab)
can_grab_focus = TRUE;
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]