Skip to content

Commit

Permalink
Make the non-native TabWidget fill the parent size when not in layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ogoffart committed May 4, 2023
1 parent 0726d22 commit df2f76a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions internal/compiler/widgets/fluent-base/std-widgets-base.slint
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export component GroupBox {
}
}

export component TabWidgetImpl {
export component TabWidgetImpl inherits Rectangle {
out property <length> content-x: 0;
out property <length> content-y: root.tabbar-preferred-height;
out property <length> content-height: root.height - root.tabbar-preferred-height;
Expand Down Expand Up @@ -524,8 +524,8 @@ component StandardListViewBase inherits ListView {
width: parent.width;
height: parent.height;

clicked => {
set-current-item(idx);
clicked => {
set-current-item(idx);
}
}
}
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { md } from "md.slint";

export component TabWidgetImpl {
export component TabWidgetImpl inherits Rectangle {
out property <length> content-x: 0;
out property <length> content-y: root.tabbar-preferred-height;
out property <length> content-height: root.height - root.tabbar-preferred-height;
Expand Down

0 comments on commit df2f76a

Please sign in to comment.