Widget style: simplify -light/-dark handling
Instead of having all style duplicated and re-using a base, we just hack into the funciton that queries the dark/light theme based on the style suffix known at compile time. This removes one of the problem that happens when trying to work on the widget style with the extension, as it relies on include path hacks
|
|
@ -88,15 +88,15 @@ Files: examples/*/esp-idf/*/partitions.csv examples/*/esp-idf/partitions.csv
|
|||
Copyright: Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
License: MIT
|
||||
|
||||
Files: internal/compiler/widgets/fluent-base/_*.svg
|
||||
Files: internal/compiler/widgets/fluent/_*.svg
|
||||
Copyright: Copyright © Microsoft Corporation <https://github.com/microsoft/fluentui-system-icons/blob/main/LICENSE>
|
||||
License: MIT
|
||||
|
||||
Files: internal/compiler/widgets/material-base/_*.svg
|
||||
Files: internal/compiler/widgets/material/_*.svg
|
||||
Copyright: Material Icons <https://github.com/material-icons/material-icons/blob/master/LICENSE>
|
||||
License: Apache-2.0
|
||||
|
||||
Files: internal/compiler/widgets/cupertino-base/_*.svg
|
||||
Files: internal/compiler/widgets/cupertino/_*.svg
|
||||
Copyright: Material Icons <https://github.com/material-icons/material-icons/blob/master/LICENSE>
|
||||
License: Apache-2.0
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ Files: examples/todo-mvc/assets/*.svg
|
|||
Copyright: Material Icons <https://github.com/material-icons/material-icons/blob/master/LICENSE>
|
||||
License: Apache-2.0
|
||||
|
||||
Files: internal/compiler/widgets/cosmic-base/_*.svg
|
||||
Files: internal/compiler/widgets/cosmic/_*.svg
|
||||
Copyright: "Cosmic Icons" by System76 <https://github.com/pop-os/cosmic-icons>
|
||||
License: CC-BY-SA-4.0
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,17 @@ mod builtin_library {
|
|||
|
||||
use super::VirtualFile;
|
||||
|
||||
const ALIASES: &[(&str, &str)] = &[
|
||||
("cosmic-light", "cosmic"),
|
||||
("cosmic-dark", "cosmic"),
|
||||
("fluent-light", "fluent"),
|
||||
("fluent-dark", "fluent"),
|
||||
("material-light", "material"),
|
||||
("material-dark", "material"),
|
||||
("cupertino-light", "cupertino"),
|
||||
("cupertino-dark", "cupertino"),
|
||||
];
|
||||
|
||||
pub(crate) fn styles() -> Vec<&'static str> {
|
||||
widget_library()
|
||||
.iter()
|
||||
|
|
@ -98,6 +109,7 @@ mod builtin_library {
|
|||
None
|
||||
}
|
||||
})
|
||||
.chain(ALIASES.iter().map(|x| x.0))
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
|
@ -110,6 +122,11 @@ mod builtin_library {
|
|||
components.push(part);
|
||||
}
|
||||
}
|
||||
if let Some(f) = components.first_mut() {
|
||||
if let Some((_, x)) = ALIASES.iter().find(|x| x.0 == *f) {
|
||||
*f = std::ffi::OsStr::new(x);
|
||||
}
|
||||
}
|
||||
if let &[folder, file] = components.as_slice() {
|
||||
let library = widget_library().iter().find(|x| x.0 == folder)?.1;
|
||||
library.iter().find_map(|builtin_file| {
|
||||
|
|
|
|||
|
|
@ -817,13 +817,22 @@ impl LookupObject for SlintInternal {
|
|||
use Expression::BuiltinFunctionReference as BFR;
|
||||
let sl = || ctx.current_token.as_ref().map(|t| t.to_source_location());
|
||||
None.or_else(|| {
|
||||
let style = ctx.type_loader.and_then(|tl| tl.compiler_config.style.as_ref());
|
||||
f(
|
||||
"color-scheme",
|
||||
if style.is_some_and(|s| s.ends_with("-light")) {
|
||||
let e = crate::typeregister::BUILTIN_ENUMS.with(|e| e.ColorScheme.clone());
|
||||
Expression::EnumerationValue(e.try_value_from_string("light").unwrap())
|
||||
} else if style.is_some_and(|s| s.ends_with("-dark")) {
|
||||
let e = crate::typeregister::BUILTIN_ENUMS.with(|e| e.ColorScheme.clone());
|
||||
Expression::EnumerationValue(e.try_value_from_string("dark").unwrap())
|
||||
} else {
|
||||
Expression::FunctionCall {
|
||||
function: BFR(BuiltinFunction::ColorScheme, None).into(),
|
||||
arguments: vec![],
|
||||
source_location: sl(),
|
||||
}
|
||||
}
|
||||
.into(),
|
||||
)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
// cSpell: ignore standardbutton
|
||||
|
||||
export { AboutSlint } from "../common/common.slint";
|
||||
export { StandardButton } from "../common/standardbutton.slint";
|
||||
export { StyleMetrics, ScrollView, Button, Palette } from "std-widgets-impl.slint";
|
||||
|
||||
export { CheckBox } from "checkbox.slint";
|
||||
export { ComboBox } from "combobox.slint";
|
||||
export { GroupBox } from "groupbox.slint";
|
||||
export { LineEdit } from "lineedit.slint";
|
||||
export { ListView, StandardListView } from "../common/listview.slint";
|
||||
export { ProgressIndicator } from "progressindicator.slint";
|
||||
export { Slider } from "slider.slint";
|
||||
export { SpinBox } from "spinbox.slint";
|
||||
export { Spinner } from "spinner.slint";
|
||||
export { TabWidgetImpl, TabImpl, TabBarImpl, TabWidget } from "tabwidget.slint";
|
||||
export { VerticalBox, HorizontalBox, GridBox } from "layouts.slint";
|
||||
export { Switch } from "switch.slint";
|
||||
export { TextEdit } from "textedit.slint";
|
||||
export { TimePickerPopup, Time } from "time-picker.slint";
|
||||
export { DatePickerPopup, Date } from "datepicker.slint";
|
||||
|
||||
export * from "tableview.slint";
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
|
||||
export { Button } from "button.slint";
|
||||
export { ScrollView } from "scrollview.slint";
|
||||
export { ListItem } from "components.slint";
|
||||
export { LineEdit } from "lineedit.slint";
|
||||
|
||||
import { CosmicPalette } from "styling.slint";
|
||||
|
||||
export global StyleMetrics {
|
||||
out property <length> layout-spacing: 8px;
|
||||
out property <length> layout-padding: 8px;
|
||||
out property <length> text-cursor-width: 1px;
|
||||
out property <color> window-background: CosmicPalette.background;
|
||||
out property <color> default-text-color: CosmicPalette.foreground;
|
||||
out property <color> textedit-background: CosmicPalette.background;
|
||||
out property <color> textedit-text-color: CosmicPalette.foreground;
|
||||
out property <color> textedit-background-disabled: CosmicPalette.control-disabled;
|
||||
out property <color> textedit-text-color-disabled: CosmicPalette.text-disabled;
|
||||
out property <bool> dark-color-scheme: Palette.color-scheme == ColorScheme.dark;
|
||||
}
|
||||
|
||||
export global Palette {
|
||||
out property <brush> background: CosmicPalette.background;
|
||||
out property <brush> foreground: CosmicPalette.foreground;
|
||||
out property <brush> alternate-background: CosmicPalette.alternate-background;
|
||||
out property <brush> alternate-foreground: CosmicPalette.alternate-foreground;
|
||||
out property <brush> control-background: CosmicPalette.control-background;
|
||||
out property <brush> control-foreground: CosmicPalette.control-foreground;
|
||||
out property <brush> accent-background: CosmicPalette.accent-background;
|
||||
out property <brush> accent-foreground: CosmicPalette.accent-foreground;
|
||||
out property <brush> selection-background: CosmicPalette.selection-background;
|
||||
out property <brush> selection-foreground: CosmicPalette.selection-foreground;
|
||||
out property <brush> border: CosmicPalette.border;
|
||||
in-out property <ColorScheme> color-scheme <=> CosmicPalette.color-scheme;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export global ColorSchemeSelector {
|
||||
in property <ColorScheme> color-scheme: ColorScheme.dark;
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export { StyleMetrics, ScrollView, Button, LineEdit, ListItem, Palette } from "../cosmic-base/std-widgets-impl.slint";
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export * from "../cosmic-base/std-widgets-base.slint";
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export global ColorSchemeSelector {
|
||||
in property <ColorScheme> color-scheme: ColorScheme.light;
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export { StyleMetrics, ScrollView, Button, LineEdit, ListItem, Palette } from "../cosmic-base/std-widgets-impl.slint";
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export * from "../cosmic-base/std-widgets-base.slint";
|
||||
|
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |
|
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 308 B |
|
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 426 B |
|
Before Width: | Height: | Size: 284 B After Width: | Height: | Size: 284 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 413 B After Width: | Height: | Size: 413 B |
|
Before Width: | Height: | Size: 800 B After Width: | Height: | Size: 800 B |
|
Before Width: | Height: | Size: 512 B After Width: | Height: | Size: 512 B |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 148 B |
|
|
@ -1,4 +1,38 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export { StyleMetrics, ScrollView, Button, LineEdit, ListItem, Palette } from "../cosmic-base/std-widgets-impl.slint";
|
||||
|
||||
export { Button } from "button.slint";
|
||||
export { ScrollView } from "scrollview.slint";
|
||||
export { ListItem } from "components.slint";
|
||||
export { LineEdit } from "lineedit.slint";
|
||||
|
||||
import { CosmicPalette } from "styling.slint";
|
||||
|
||||
export global StyleMetrics {
|
||||
out property <length> layout-spacing: 8px;
|
||||
out property <length> layout-padding: 8px;
|
||||
out property <length> text-cursor-width: 1px;
|
||||
out property <color> window-background: CosmicPalette.background;
|
||||
out property <color> default-text-color: CosmicPalette.foreground;
|
||||
out property <color> textedit-background: CosmicPalette.background;
|
||||
out property <color> textedit-text-color: CosmicPalette.foreground;
|
||||
out property <color> textedit-background-disabled: CosmicPalette.control-disabled;
|
||||
out property <color> textedit-text-color-disabled: CosmicPalette.text-disabled;
|
||||
out property <bool> dark-color-scheme: Palette.color-scheme == ColorScheme.dark;
|
||||
}
|
||||
|
||||
export global Palette {
|
||||
out property <brush> background: CosmicPalette.background;
|
||||
out property <brush> foreground: CosmicPalette.foreground;
|
||||
out property <brush> alternate-background: CosmicPalette.alternate-background;
|
||||
out property <brush> alternate-foreground: CosmicPalette.alternate-foreground;
|
||||
out property <brush> control-background: CosmicPalette.control-background;
|
||||
out property <brush> control-foreground: CosmicPalette.control-foreground;
|
||||
out property <brush> accent-background: CosmicPalette.accent-background;
|
||||
out property <brush> accent-foreground: CosmicPalette.accent-foreground;
|
||||
out property <brush> selection-background: CosmicPalette.selection-background;
|
||||
out property <brush> selection-foreground: CosmicPalette.selection-foreground;
|
||||
out property <brush> border: CosmicPalette.border;
|
||||
in-out property <ColorScheme> color-scheme <=> CosmicPalette.color-scheme;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,26 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export * from "../cosmic-base/std-widgets-base.slint";
|
||||
// cSpell: ignore standardbutton
|
||||
|
||||
export { AboutSlint } from "../common/common.slint";
|
||||
export { StandardButton } from "../common/standardbutton.slint";
|
||||
export { StyleMetrics, ScrollView, Button, Palette } from "std-widgets-impl.slint";
|
||||
|
||||
export { CheckBox } from "checkbox.slint";
|
||||
export { ComboBox } from "combobox.slint";
|
||||
export { GroupBox } from "groupbox.slint";
|
||||
export { LineEdit } from "lineedit.slint";
|
||||
export { ListView, StandardListView } from "../common/listview.slint";
|
||||
export { ProgressIndicator } from "progressindicator.slint";
|
||||
export { Slider } from "slider.slint";
|
||||
export { SpinBox } from "spinbox.slint";
|
||||
export { Spinner } from "spinner.slint";
|
||||
export { TabWidgetImpl, TabImpl, TabBarImpl, TabWidget } from "tabwidget.slint";
|
||||
export { VerticalBox, HorizontalBox, GridBox } from "layouts.slint";
|
||||
export { Switch } from "switch.slint";
|
||||
export { TextEdit } from "textedit.slint";
|
||||
export { TimePickerPopup, Time } from "time-picker.slint";
|
||||
export { DatePickerPopup, Date } from "datepicker.slint";
|
||||
|
||||
export * from "tableview.slint";
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
// cSpell: ignore standardbutton
|
||||
|
||||
export { AboutSlint } from "../common/common.slint";
|
||||
export { StandardButton } from "../common/standardbutton.slint";
|
||||
export { StyleMetrics, ScrollView, Button, Palette } from "std-widgets-impl.slint";
|
||||
|
||||
export { CheckBox } from "checkbox.slint";
|
||||
export { ComboBox } from "combobox.slint";
|
||||
export { GroupBox } from "groupbox.slint";
|
||||
export { LineEdit } from "lineedit.slint";
|
||||
export { ListView, StandardListView } from "../common/listview.slint";
|
||||
export { ProgressIndicator } from "progressindicator.slint";
|
||||
export { Slider } from "slider.slint";
|
||||
export { SpinBox } from "spinbox.slint";
|
||||
export { Spinner } from "spinner.slint";
|
||||
export { TabWidgetImpl, TabImpl, TabBarImpl, TabWidget } from "tabwidget.slint";
|
||||
export { VerticalBox, HorizontalBox, GridBox } from "layouts.slint";
|
||||
export { Switch } from "switch.slint";
|
||||
export { TextEdit } from "textedit.slint";
|
||||
export { TimePickerPopup, Time } from "time-picker.slint";
|
||||
export { DatePickerPopup, Date } from "./datepicker.slint";
|
||||
export * from "tableview.slint";
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export { Button } from "button.slint";
|
||||
export { ScrollView } from "scrollview.slint";
|
||||
export { ListItem } from "components.slint";
|
||||
export { LineEdit } from "lineedit.slint";
|
||||
import { CupertinoPalette } from "styling.slint";
|
||||
|
||||
export global StyleMetrics {
|
||||
out property <length> layout-spacing: 10px;
|
||||
out property <length> layout-padding: 12px;
|
||||
out property <length> text-cursor-width: 1px;
|
||||
out property <color> window-background: CupertinoPalette.background;
|
||||
out property <color> default-text-color: CupertinoPalette.foreground;
|
||||
out property <color> textedit-background: CupertinoPalette.alternate-background;
|
||||
out property <color> textedit-text-color: CupertinoPalette.foreground;
|
||||
out property <color> textedit-background-disabled: CupertinoPalette.tertiary-control-background;
|
||||
out property <color> textedit-text-color-disabled: CupertinoPalette.foreground-secondary;
|
||||
out property <bool> dark-color-scheme: Palette.color-scheme == ColorScheme.dark;
|
||||
}
|
||||
|
||||
export global Palette {
|
||||
out property <brush> background: CupertinoPalette.background;
|
||||
out property <brush> foreground: CupertinoPalette.foreground;
|
||||
out property <brush> alternate-background: CupertinoPalette.alternate-background;
|
||||
out property <brush> alternate-foreground: CupertinoPalette.alternate-foreground;
|
||||
out property <brush> control-background: CupertinoPalette.control-background;
|
||||
out property <brush> control-foreground: CupertinoPalette.control-foreground;
|
||||
out property <brush> accent-background: CupertinoPalette.accent-background;
|
||||
out property <brush> accent-foreground: CupertinoPalette.accent-foreground;
|
||||
out property <brush> selection-background: CupertinoPalette.selection-background;
|
||||
out property <brush> selection-foreground: CupertinoPalette.selection-foreground;
|
||||
out property <brush> border: CupertinoPalette.border;
|
||||
in-out property <ColorScheme> color-scheme <=> CupertinoPalette.color-scheme;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export global ColorSchemeSelector {
|
||||
in property <ColorScheme> color-scheme: ColorScheme.dark;
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export { StyleMetrics, ScrollView, Button, LineEdit, ListItem, Palette } from "../cupertino-base/std-widgets-impl.slint";
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export * from "../cupertino-base/std-widgets-base.slint";
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export global ColorSchemeSelector {
|
||||
in property <ColorScheme> color-scheme: ColorScheme.light;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export { StyleMetrics, ScrollView, Button, LineEdit, ListItem, Palette } from "../cupertino-base/std-widgets-impl.slint";
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export * from "../cupertino-base/std-widgets-base.slint";
|
||||
|
Before Width: | Height: | Size: 513 B After Width: | Height: | Size: 513 B |
|
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 507 B |
|
Before Width: | Height: | Size: 180 B After Width: | Height: | Size: 180 B |
|
Before Width: | Height: | Size: 181 B After Width: | Height: | Size: 181 B |
|
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
|
Before Width: | Height: | Size: 780 B After Width: | Height: | Size: 780 B |
|
Before Width: | Height: | Size: 623 B After Width: | Height: | Size: 623 B |
|
Before Width: | Height: | Size: 601 B After Width: | Height: | Size: 601 B |
|
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 478 B |
|
Before Width: | Height: | Size: 918 B After Width: | Height: | Size: 918 B |
|
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 489 B |
|
Before Width: | Height: | Size: 334 B After Width: | Height: | Size: 334 B |
|
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 502 B |
|
Before Width: | Height: | Size: 849 B After Width: | Height: | Size: 849 B |
|
Before Width: | Height: | Size: 815 B After Width: | Height: | Size: 815 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
|
@ -1,4 +1,36 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export { StyleMetrics, ScrollView, Button, LineEdit, ListItem, Palette } from "../cupertino-base/std-widgets-impl.slint";
|
||||
export { Button } from "button.slint";
|
||||
export { ScrollView } from "scrollview.slint";
|
||||
export { ListItem } from "components.slint";
|
||||
export { LineEdit } from "lineedit.slint";
|
||||
import { CupertinoPalette } from "styling.slint";
|
||||
|
||||
export global StyleMetrics {
|
||||
out property <length> layout-spacing: 10px;
|
||||
out property <length> layout-padding: 12px;
|
||||
out property <length> text-cursor-width: 1px;
|
||||
out property <color> window-background: CupertinoPalette.background;
|
||||
out property <color> default-text-color: CupertinoPalette.foreground;
|
||||
out property <color> textedit-background: CupertinoPalette.alternate-background;
|
||||
out property <color> textedit-text-color: CupertinoPalette.foreground;
|
||||
out property <color> textedit-background-disabled: CupertinoPalette.tertiary-control-background;
|
||||
out property <color> textedit-text-color-disabled: CupertinoPalette.foreground-secondary;
|
||||
out property <bool> dark-color-scheme: Palette.color-scheme == ColorScheme.dark;
|
||||
}
|
||||
|
||||
export global Palette {
|
||||
out property <brush> background: CupertinoPalette.background;
|
||||
out property <brush> foreground: CupertinoPalette.foreground;
|
||||
out property <brush> alternate-background: CupertinoPalette.alternate-background;
|
||||
out property <brush> alternate-foreground: CupertinoPalette.alternate-foreground;
|
||||
out property <brush> control-background: CupertinoPalette.control-background;
|
||||
out property <brush> control-foreground: CupertinoPalette.control-foreground;
|
||||
out property <brush> accent-background: CupertinoPalette.accent-background;
|
||||
out property <brush> accent-foreground: CupertinoPalette.accent-foreground;
|
||||
out property <brush> selection-background: CupertinoPalette.selection-background;
|
||||
out property <brush> selection-foreground: CupertinoPalette.selection-foreground;
|
||||
out property <brush> border: CupertinoPalette.border;
|
||||
in-out property <ColorScheme> color-scheme <=> CupertinoPalette.color-scheme;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,25 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export * from "../cupertino-base/std-widgets-base.slint";
|
||||
// cSpell: ignore standardbutton
|
||||
|
||||
export { AboutSlint } from "../common/common.slint";
|
||||
export { StandardButton } from "../common/standardbutton.slint";
|
||||
export { StyleMetrics, ScrollView, Button, Palette } from "std-widgets-impl.slint";
|
||||
|
||||
export { CheckBox } from "checkbox.slint";
|
||||
export { ComboBox } from "combobox.slint";
|
||||
export { GroupBox } from "groupbox.slint";
|
||||
export { LineEdit } from "lineedit.slint";
|
||||
export { ListView, StandardListView } from "../common/listview.slint";
|
||||
export { ProgressIndicator } from "progressindicator.slint";
|
||||
export { Slider } from "slider.slint";
|
||||
export { SpinBox } from "spinbox.slint";
|
||||
export { Spinner } from "spinner.slint";
|
||||
export { TabWidgetImpl, TabImpl, TabBarImpl, TabWidget } from "tabwidget.slint";
|
||||
export { VerticalBox, HorizontalBox, GridBox } from "layouts.slint";
|
||||
export { Switch } from "switch.slint";
|
||||
export { TextEdit } from "textedit.slint";
|
||||
export { TimePickerPopup, Time } from "time-picker.slint";
|
||||
export { DatePickerPopup, Date } from "./datepicker.slint";
|
||||
export * from "tableview.slint";
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
// cSpell: ignore standardbutton
|
||||
|
||||
export { AboutSlint } from "../common/common.slint";
|
||||
export { StandardButton } from "../common/standardbutton.slint";
|
||||
export { StyleMetrics, ScrollView, Button, Palette } from "std-widgets-impl.slint";
|
||||
|
||||
export { CheckBox } from "checkbox.slint";
|
||||
export { ComboBox } from "combobox.slint";
|
||||
export { GroupBox } from "groupbox.slint";
|
||||
export { LineEdit } from "lineedit.slint";
|
||||
export { ListView, StandardListView } from "../common/listview.slint";
|
||||
export { ProgressIndicator } from "progressindicator.slint";
|
||||
export { Slider } from "slider.slint";
|
||||
export { SpinBox } from "spinbox.slint";
|
||||
export { Spinner } from "spinner.slint";
|
||||
export { TabWidgetImpl, TabImpl, TabBarImpl, TabWidget } from "tabwidget.slint";
|
||||
export { VerticalBox, HorizontalBox, GridBox } from "layouts.slint";
|
||||
export { Switch } from "switch.slint";
|
||||
export { TextEdit } from "textedit.slint";
|
||||
export { TimePickerPopup, Time } from "time-picker.slint";
|
||||
export { DatePickerPopup, Date } from "datepicker.slint";
|
||||
export * from "tableview.slint";
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export { Button } from "button.slint";
|
||||
export { ScrollView } from "scrollview.slint";
|
||||
export { ListItem } from "components.slint";
|
||||
export { LineEdit } from "lineedit.slint";
|
||||
import { FluentPalette } from "styling.slint";
|
||||
|
||||
export global StyleMetrics {
|
||||
out property <length> layout-spacing: 8px;
|
||||
out property <length> layout-padding: 8px;
|
||||
out property <length> text-cursor-width: 1px;
|
||||
out property <color> window-background: FluentPalette.background;
|
||||
out property <color> default-text-color: FluentPalette.foreground;
|
||||
out property <color> textedit-background: FluentPalette.background;
|
||||
out property <color> textedit-text-color: FluentPalette.foreground;
|
||||
out property <color> textedit-background-disabled: FluentPalette.control-disabled;
|
||||
out property <color> textedit-text-color-disabled: FluentPalette.text-disabled;
|
||||
out property <bool> dark-color-scheme: Palette.color-scheme == ColorScheme.dark;
|
||||
}
|
||||
|
||||
export global Palette {
|
||||
out property <brush> background: FluentPalette.background;
|
||||
out property <brush> foreground: FluentPalette.foreground;
|
||||
out property <brush> alternate-background: FluentPalette.alternate-background;
|
||||
out property <brush> alternate-foreground: FluentPalette.alternate-foreground;
|
||||
out property <brush> control-background: FluentPalette.control-background;
|
||||
out property <brush> control-foreground: FluentPalette.control-foreground;
|
||||
out property <brush> accent-background: FluentPalette.accent-background;
|
||||
out property <brush> accent-foreground: FluentPalette.accent-foreground;
|
||||
out property <brush> selection-background: FluentPalette.selection-background;
|
||||
out property <brush> selection-foreground: FluentPalette.selection-foreground;
|
||||
out property <brush> border: FluentPalette.border;
|
||||
in-out property <ColorScheme> color-scheme <=> FluentPalette.color-scheme;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export global ColorSchemeSelector {
|
||||
in property <ColorScheme> color-scheme: ColorScheme.dark;
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export { StyleMetrics, ScrollView, LineEdit, Button, ListItem, Palette } from "../fluent-base/std-widgets-impl.slint";
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export * from "../fluent-base/std-widgets-base.slint";
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export global ColorSchemeSelector {
|
||||
in property <ColorScheme> color-scheme: ColorScheme.light;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export { StyleMetrics, ScrollView, Button, LineEdit, ListItem, Palette } from "../fluent-base/std-widgets-impl.slint";
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
||||
|
||||
export * from "../fluent-base/std-widgets-base.slint";
|
||||
|
Before Width: | Height: | Size: 513 B After Width: | Height: | Size: 513 B |
|
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 507 B |
|
Before Width: | Height: | Size: 180 B After Width: | Height: | Size: 180 B |
|
Before Width: | Height: | Size: 181 B After Width: | Height: | Size: 181 B |
|
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |