fix: browser item style

This commit is contained in:
2026-08-25 19:49:44 +05:00
parent 8d3a6dcc79
commit 08a1739f44
4 changed files with 49 additions and 27 deletions
+7 -14
View File
@@ -81,29 +81,22 @@ export component BrowserItem inherits Rectangle {
}
}
Rectangle {
width: 24px;
border-radius: 12px;
background: root.selected ? #3b82f6 : Theme.surface-elevated;
VerticalLayout {
width: 20px;
alignment: center;
Image {
x: (parent.width - self.width) / 2;
y: (parent.height - self.height) / 2;
width: 12px;
height: 12px;
width: 16px;
height: 16px;
source: @image-url("../icons/check.svg");
colorize: #ffffff;
colorize: #3b82f6;
visible: root.selected;
}
Text {
width: 100%;
height: 100%;
horizontal-alignment: center;
vertical-alignment: center;
text: "";
color: Theme.text-muted;
font-size: 14px;
font-size: 16px;
visible: !root.selected;
}
}
+15 -10
View File
@@ -62,7 +62,7 @@ export component MainWindow inherits Window {
in-out property <bool> always-ask: true;
in property <int> selected-index: 0;
callback browser-selected(BrowserConfig);
callback launch-browser(BrowserConfig);
callback toggle-remember(bool);
callback toggle-always-ask(bool);
callback settings-clicked();
@@ -112,16 +112,21 @@ export component MainWindow inherits Window {
request-drag => root.request-drag();
}
ListView {
vertical-stretch: 1;
HorizontalLayout {
padding-left: 12px;
padding-right: 12px;
for browser[i] in root.browser-model: BrowserItem {
browser-icon: browser.icon;
browser-name: browser.name;
is-default: browser.is-default;
selected: i == root.selected-index;
clicked => {
root.browser-selected(browser);
ListView {
vertical-stretch: 1;
for browser[i] in root.browser-model: BrowserItem {
browser-icon: browser.icon;
browser-name: browser.name;
is-default: browser.is-default;
selected: i == root.selected-index;
clicked => {
root.launch-browser(browser);
}
}
}
}