From a5f45a4930e3fb2bf7180850909329c825907b5d Mon Sep 17 00:00:00 2001 From: Alice Mikhaylenko Date: Sat, 21 Dec 2024 18:46:21 +0400 Subject: [PATCH 1/4] adaptive-preview: Don't use toolbar view for content Otherwise we risk adding undershoots where we don't want them. Just implement this style manually, it's not difficult here: a custom style class for header bar (not .flat because deprecated but extending it so I'll get an error if I remove that one and forget to update inspector) and .undershoot-top. --- src/adw-adaptive-preview.ui | 18 ++++++++++++++---- src/stylesheet/widgets/_inspector.scss | 4 ++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/adw-adaptive-preview.ui b/src/adw-adaptive-preview.ui index 49a33d740..a39f6b9b1 100644 --- a/src/adw-adaptive-preview.ui +++ b/src/adw-adaptive-preview.ui @@ -141,10 +141,16 @@ - - + + + vertical + False + @@ -158,8 +164,12 @@ - + + True + 24 @@ -202,7 +212,7 @@ - + diff --git a/src/stylesheet/widgets/_inspector.scss b/src/stylesheet/widgets/_inspector.scss index 0fd8274e3..abfd2817a 100644 --- a/src/stylesheet/widgets/_inspector.scss +++ b/src/stylesheet/widgets/_inspector.scss @@ -12,6 +12,10 @@ adaptive-preview { background: var(--overview-bg-color); color: var(--overview-fg-color); + headerbar.adaptive-mode-flat { + @extend .flat; + } + .screen-view { box-shadow: 0 2px 8px 2px RGB(0 0 0 / 7%), 0 3px 20px 10px RGB(0 0 0 / 5%), -- GitLab From fa0c1bc9025ee5816413ea4589bf05eb8f995e12 Mon Sep 17 00:00:00 2001 From: Alice Mikhaylenko Date: Sat, 21 Dec 2024 18:51:58 +0400 Subject: [PATCH 2/4] adaptive-preview: Fix uninitialized memory use ... --- src/adw-adaptive-preview.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adw-adaptive-preview.c b/src/adw-adaptive-preview.c index 9599eb190..ec64d9e0a 100644 --- a/src/adw-adaptive-preview.c +++ b/src/adw-adaptive-preview.c @@ -361,6 +361,8 @@ allocate_screen_view (GtkWidget *widget, int child_width, child_height, available_height; GskTransform *transform; + available_height = height - top_bar_height - bottom_bar_height; + if (gtk_widget_get_request_mode (self->child_bin) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH) { gtk_widget_measure (self->child_bin, GTK_ORIENTATION_HORIZONTAL, -1, &child_width, NULL, NULL, NULL); @@ -373,8 +375,6 @@ allocate_screen_view (GtkWidget *widget, &child_height, NULL, NULL, NULL); } - available_height = height - top_bar_height - bottom_bar_height; - if (child_width > width || child_height > available_height) { g_warning ("Window contents don't fit: provided %d×%d, available %d×%d", child_width, child_height, width, available_height); -- GitLab From f7bd5c31802ac0433acad367ac37841eb54e668a Mon Sep 17 00:00:00 2001 From: Alice Mikhaylenko Date: Sat, 21 Dec 2024 18:55:54 +0400 Subject: [PATCH 3/4] adaptive-preview: Add toggle sidebar button --- src/adw-adaptive-preview.ui | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/adw-adaptive-preview.ui b/src/adw-adaptive-preview.ui index a39f6b9b1..e76225998 100644 --- a/src/adw-adaptive-preview.ui +++ b/src/adw-adaptive-preview.ui @@ -151,6 +151,13 @@ + + + sidebar-show-symbolic + Toggle Sidebar + + + -- GitLab From c3098032718551142a8ed83b1b4195fc1c9acbfa Mon Sep 17 00:00:00 2001 From: Alice Mikhaylenko Date: Sat, 21 Dec 2024 18:58:40 +0400 Subject: [PATCH 4/4] adaptive-preview: Add tooltips to rotate buttons --- src/adw-adaptive-preview.ui | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/adw-adaptive-preview.ui b/src/adw-adaptive-preview.ui index e76225998..f6f1fdd67 100644 --- a/src/adw-adaptive-preview.ui +++ b/src/adw-adaptive-preview.ui @@ -58,6 +58,7 @@ Rotate Left object-rotate-left-symbolic + Rotate Left center