[libadwaita/wip/exalm/tabs2] tab-box: Use final positions for reordering
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/tabs2] tab-box: Use final positions for reordering
- Date: Tue, 2 Aug 2022 08:39:46 +0000 (UTC)
commit 58e3f8d5ab3e2e1d41dd3849d0b5bd6b4f89a698
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Aug 2 11:57:33 2022 +0400
tab-box: Use final positions for reordering
Make this slightly less janky. There's still jank from how the tab width
change is animated though, but a lot less at least - and actually none with
with expand-tabs=false.
src/adw-tab-box.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/adw-tab-box.c b/src/adw-tab-box.c
index 01e70354..ae11239c 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -1321,7 +1321,7 @@ update_drag_reodering (AdwTabBox *self)
for (l = self->tabs; l; l = l->next) {
TabInfo *info = l->data;
- int center = info->unshifted_pos + info->width / 2;
+ int center = info->unshifted_pos + info->final_width / 2;
if (info == self->reordered_tab)
old_index = i;
@@ -3189,7 +3189,7 @@ adw_tab_box_size_allocate (GtkWidget *widget,
for (l = self->tabs; l; l = l->next) {
TabInfo *info = l->data;
- info->unshifted_pos = pos;
+ info->unshifted_pos = final_pos;
info->pos = pos + calculate_tab_offset (self, info, FALSE);
info->final_pos = final_pos + calculate_tab_offset (self, info, TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]