Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust combobox item height to the default font size #5615

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/compiler/widgets/cosmic-base/combobox.slint
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 86,7 @@ export component ComboBox {
// Ideally it should be so that the current element is over the popup.
y: root.height 4px;
width: root.width;
height: root.visible-items * CosmicSizeSettings.item-height 2 * root.popup-padding;
height: root.visible-items * (1rem CosmicSizeSettings.item-height) 2 * root.popup-padding;

MenuBorder {
ScrollView {
Expand Down
2 changes: 1 addition & 1 deletion internal/compiler/widgets/cosmic-base/components.slint
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 99,7 @@ export component ListItem {
in property <length> pressed-y;

min-width: layout.min-width;
min-height: max(CosmicSizeSettings.item-height, layout.min-height);
min-height: max(CosmicSizeSettings.item-height 1rem, layout.min-height);
vertical-stretch: 0;
horizontal-stretch: 1;

Expand Down
2 changes: 1 addition & 1 deletion internal/compiler/widgets/cosmic-base/styling.slint
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 83,5 @@ export global Icons {
}

export global CosmicSizeSettings {
out property <length> item-height: 40px;
out property <length> item-height: 28px; // 40px with default font size 12px added at use-site
}
2 changes: 1 addition & 1 deletion internal/compiler/widgets/cupertino-base/combobox.slint
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 151,7 @@ export component ComboBox {
x: 0;
y: parent.height 6px;
width: root.width;
height: root.visible-items * CupertinoSizeSettings.item-height 2 * root.popup-padding;
height: root.visible-items * (CupertinoSizeSettings.item-height 1rem) 2 * root.popup-padding;

MenuBorder {
ScrollView {
Expand Down
2 changes: 1 addition & 1 deletion internal/compiler/widgets/cupertino-base/components.slint
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 55,7 @@ export component ListItem {
in property <length> pressed-y;

min-width: i-layout.min-width;
min-height: max(CupertinoSizeSettings.item-height, i-layout.min-height);
min-height: max(CupertinoSizeSettings.item-height 1rem, i-layout.min-height);
vertical-stretch: 0;
horizontal-stretch: 1;

Expand Down
2 changes: 1 addition & 1 deletion internal/compiler/widgets/cupertino-base/styling.slint
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 102,5 @@ export global Icons {
}

export global CupertinoSizeSettings {
out property <length> item-height: 22px;
out property <length> item-height: 10px; // 22px with default font size 12px added at use-site
}
2 changes: 1 addition & 1 deletion internal/compiler/widgets/fluent-base/combobox.slint
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 97,7 @@ export component ComboBox {
// Ideally it should be so that the current element is over the popup.
y: -4px;
width: root.width;
height: root.visible-items * FluentSizeSettings.item-height 2 * root.popup-padding;
height: root.visible-items * (1rem FluentSizeSettings.item-height) 2 * root.popup-padding;

MenuBorder {
ScrollView {
Expand Down
2 changes: 1 addition & 1 deletion internal/compiler/widgets/fluent-base/components.slint
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 43,7 @@ export component ListItem {
in property <length> pressed-y;

min-width: i-layout.min-width;
min-height: max(FluentSizeSettings.item-height, i-layout.min-height);
min-height: max(FluentSizeSettings.item-height 1rem, i-layout.min-height);
vertical-stretch: 0;
horizontal-stretch: 1;

Expand Down
2 changes: 1 addition & 1 deletion internal/compiler/widgets/fluent-base/styling.slint
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 113,5 @@ export global Icons {
}

export global FluentSizeSettings {
out property <length> item-height: 40px;
out property <length> item-height: 28px; // 40px with default font size 12px added at use-site
}
2 changes: 1 addition & 1 deletion internal/compiler/widgets/material-base/combobox.slint
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 85,7 @@ export component ComboBox {
x: 0;
y: root.height;
width: root.width;
height: root.visible-items * MaterialSizeSettings.item-height;
height: root.visible-items * (1rem MaterialSizeSettings.item-height);

popup-container := Rectangle {
background: MaterialPalette.alternate-background;
Expand Down
2 changes: 1 addition & 1 deletion internal/compiler/widgets/material-base/components.slint
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 101,7 @@ export component ListItem {
in property <length> pressed-y;

min-width: i-layout.min-width;
min-height: max(MaterialSizeSettings.item-height, i-layout.min-height);
min-height: max(MaterialSizeSettings.item-height 1rem, i-layout.min-height);
vertical-stretch: 0;
horizontal-stretch: 1;

Expand Down
2 changes: 1 addition & 1 deletion internal/compiler/widgets/material-base/styling.slint
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 85,5 @@ export global Icons {
}

export global MaterialSizeSettings {
out property <length> item-height: 48px;
out property <length> item-height: 36px; // 48px with default font size 12px added at use-site
}
Loading