From df2f76a65b1235a73edcd85d40b725eeed47d7ef Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 4 May 2023 07:20:44 +0200 Subject: [PATCH] Make the non-native TabWidget fill the parent size when not in layout Fix #2683 --- CHANGELOG.md | 1 + .../compiler/widgets/fluent-base/std-widgets-base.slint | 8 ++++---- .../compiler/widgets/material-base/widget-tabwidget.slint | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6848ced2276..9c9c54166d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project are documented in this file. - Fixed missing items compilation error in the generated code related to public functions (#2655). - Added support for Window transparency on supported platform + - Fixed TabWidget not filling the parent in non-native style ### Slint Language diff --git a/internal/compiler/widgets/fluent-base/std-widgets-base.slint b/internal/compiler/widgets/fluent-base/std-widgets-base.slint index eb1ce08c712..256141c268a 100644 --- a/internal/compiler/widgets/fluent-base/std-widgets-base.slint +++ b/internal/compiler/widgets/fluent-base/std-widgets-base.slint @@ -337,7 +337,7 @@ export component GroupBox { } } -export component TabWidgetImpl { +export component TabWidgetImpl inherits Rectangle { out property content-x: 0; out property content-y: root.tabbar-preferred-height; out property content-height: root.height - root.tabbar-preferred-height; @@ -524,8 +524,8 @@ component StandardListViewBase inherits ListView { width: parent.width; height: parent.height; - clicked => { - set-current-item(idx); + clicked => { + set-current-item(idx); } } } @@ -540,7 +540,7 @@ component StandardListViewBase inherits ListView { if(current-item-y < 0) { self.viewport-y += 0 - current-item-y; } - + if(current-item-y + item-height > self.visible-height) { self.viewport-y -= current-item-y + item-height - self.visible-height; } diff --git a/internal/compiler/widgets/material-base/widget-tabwidget.slint b/internal/compiler/widgets/material-base/widget-tabwidget.slint index f32deb18962..dc08c2fc6b1 100644 --- a/internal/compiler/widgets/material-base/widget-tabwidget.slint +++ b/internal/compiler/widgets/material-base/widget-tabwidget.slint @@ -4,7 +4,7 @@ import { md } from "md.slint"; -export component TabWidgetImpl { +export component TabWidgetImpl inherits Rectangle { out property content-x: 0; out property content-y: root.tabbar-preferred-height; out property content-height: root.height - root.tabbar-preferred-height;