[ui] flatten desktop surfaces and controls

This commit is contained in:
dijunkun
2026-10-26 14:53:09 +08:00
parent 38d0ce7728
commit c3ea4eb8fc
18 changed files with 337 additions and 428 deletions
+8 -8
View File
@@ -1,4 +1,4 @@
import { ShadowSeparator, ShadowSurface, UiShadow } from "ui_shadow.slint";
import { SurfaceSeparator, FlatSurface, UiSurface } from "ui_surface.slint";
import { ScrollView, TextEdit } from "std-widgets.slint";
import { SettingsDialog, SettingsButton } from "settings_controls.slint";
import { WorkbenchStyle } from "workbench_controls.slint";
@@ -27,11 +27,11 @@ export global AboutStrings {
out property <string> back: GalleryStrings.tr("返回", "Back", "Назад");
}
export component AboutNavigationGroup inherits ShadowSurface {
export component AboutNavigationGroup inherits FlatSurface {
height: rows.preferred-height + 2px;
background: WorkbenchStyle.surface;
border-radius: UiRadius.control;
shadow-color: UiShadow.edge;
outline-color: UiSurface.edge;
clip: true;
rows := VerticalLayout {
x: 1px; y: 1px; width: parent.width - 2px;
@@ -42,13 +42,13 @@ export component AboutNavigationGroup inherits ShadowSurface {
export component AboutRowSeparator inherits Rectangle {
height: 1px;
ShadowSeparator {
SurfaceSeparator {
x: 14px; width: parent.width - 30px; height: 1px;
shadow-color: UiShadow.separator;
outline-color: UiSurface.separator;
}
}
export component AboutNavigationRow inherits ShadowSurface {
export component AboutNavigationRow inherits FlatSurface {
in property <string> title;
in property <string> subtitle;
in property <string> icon;
@@ -61,7 +61,7 @@ export component AboutNavigationRow inherits ShadowSurface {
background: touch.pressed ? WorkbenchStyle.pressed-surface
: touch.has-hover ? WorkbenchStyle.hover-surface : WorkbenchStyle.surface;
border-radius: root.grouped ? 0px : UiRadius.control;
shadow-enabled: !root.grouped; shadow-color: UiShadow.edge;
outline-enabled: !root.grouped; outline-color: UiSurface.edge;
accessible-role: button;
accessible-label: root.title + (root.subtitle != "" ? ", " + root.subtitle : "")
+ (root.detail != "" ? ", " + root.detail : "");
@@ -227,7 +227,7 @@ export component AboutPanel inherits SettingsDialog {
footer := VerticalLayout {
x: 24px; y: parent.height - self.height - 24px;
width: parent.width - 48px; height: self.preferred-height; spacing: 12px;
ShadowSeparator { height: 1px; shadow-color: UiShadow.separator; }
SurfaceSeparator { height: 1px; outline-color: UiSurface.separator; }
HorizontalLayout {
alignment: end;
SettingsButton { text: AboutStrings.back; clicked => { root.back(); } }