mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
Rename stark-style to dark-color-scheme
That's the term used by CSS
This commit is contained in:
parent
0ba468c236
commit
6ee932883a
14 changed files with 43 additions and 43 deletions
|
@ -636,7 +636,7 @@ export global NativeStyleMetrics := {
|
|||
property <color> textedit-background-disabled : native_output;
|
||||
property <color> textedit-text-color-disabled : native_output;
|
||||
|
||||
property <bool> dark-style : native_output;
|
||||
property <bool> dark-color-scheme : native_output;
|
||||
|
||||
// specific to the Native one
|
||||
property <color> placeholder-color : native_output;
|
||||
|
|
|
@ -45,7 +45,7 @@ pub enum BuiltinFunction {
|
|||
ImageSize,
|
||||
ArrayLength,
|
||||
Rgb,
|
||||
DarkStyle,
|
||||
DarkColorScheme,
|
||||
ImplicitLayoutInfo(Orientation),
|
||||
RegisterCustomFontByPath,
|
||||
RegisterCustomFontByMemory,
|
||||
|
@ -151,7 +151,7 @@ impl BuiltinFunction {
|
|||
return_type: Box::new(Type::Color),
|
||||
args: vec![Type::Int32, Type::Int32, Type::Int32, Type::Float32],
|
||||
},
|
||||
BuiltinFunction::DarkStyle => {
|
||||
BuiltinFunction::DarkColorScheme => {
|
||||
Type::Function { return_type: Box::new(Type::Bool), args: vec![] }
|
||||
}
|
||||
BuiltinFunction::RegisterCustomFontByPath => {
|
||||
|
@ -171,7 +171,7 @@ impl BuiltinFunction {
|
|||
match self {
|
||||
BuiltinFunction::GetWindowScaleFactor => false,
|
||||
BuiltinFunction::AnimationTick => false,
|
||||
BuiltinFunction::DarkStyle => false,
|
||||
BuiltinFunction::DarkColorScheme => false,
|
||||
// Even if it is not pure, we optimize it away anyway
|
||||
BuiltinFunction::Debug => true,
|
||||
BuiltinFunction::Mod
|
||||
|
|
|
@ -2422,8 +2422,8 @@ fn compile_builtin_function_call(
|
|||
a = a.next().unwrap(),
|
||||
)
|
||||
}
|
||||
BuiltinFunction::DarkStyle => {
|
||||
format!("{}.dark_style()", access_window_field(ctx))
|
||||
BuiltinFunction::DarkColorScheme => {
|
||||
format!("{}.dark_color_scheme()", access_window_field(ctx))
|
||||
}
|
||||
BuiltinFunction::ShowPopupWindow => {
|
||||
if let [llr::Expression::NumberLiteral(popup_index), x, y, llr::Expression::PropertyReference(parent_ref)] =
|
||||
|
|
|
@ -2132,9 +2132,9 @@ fn compile_builtin_function_call(
|
|||
slint::private_unstable_api::re_exports::Color::from_argb_u8(a, r, g, b)
|
||||
})
|
||||
}
|
||||
BuiltinFunction::DarkStyle => {
|
||||
BuiltinFunction::DarkColorScheme => {
|
||||
let window_adapter_tokens = access_window_adapter_field(ctx);
|
||||
quote!(#window_adapter_tokens.dark_style())
|
||||
quote!(#window_adapter_tokens.dark_color_scheme())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ fn builtin_function_cost(function: BuiltinFunction) -> isize {
|
|||
BuiltinFunction::RegisterCustomFontByPath => isize::MAX,
|
||||
BuiltinFunction::RegisterCustomFontByMemory => isize::MAX,
|
||||
BuiltinFunction::RegisterBitmapFont => isize::MAX,
|
||||
BuiltinFunction::DarkStyle => isize::MAX,
|
||||
BuiltinFunction::DarkColorScheme => isize::MAX,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -588,9 +588,9 @@ impl LookupObject for BuiltinFunctionLookup {
|
|||
})
|
||||
.or_else(|| {
|
||||
f(
|
||||
"dark-style",
|
||||
"dark-color-scheme",
|
||||
Expression::BuiltinFunctionReference(
|
||||
BuiltinFunction::DarkStyle,
|
||||
BuiltinFunction::DarkColorScheme,
|
||||
ctx.current_token.as_ref().map(|t| t.to_source_location()),
|
||||
)
|
||||
.into(),
|
||||
|
|
|
@ -99,7 +99,7 @@ export AboutSlint := Rectangle {
|
|||
horizontal-alignment: center;
|
||||
}
|
||||
Image {
|
||||
source: StyleMetrics.dark-style ? @image-url("slint-logo-dark.svg") : @image-url("slint-logo-light.svg");
|
||||
source: StyleMetrics.dark-color-scheme ? @image-url("slint-logo-dark.svg") : @image-url("slint-logo-light.svg");
|
||||
preferred-width: 256px;
|
||||
}
|
||||
Text {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
export global Palette := {
|
||||
property<bool> _dark-style: dark-style();
|
||||
property<bool> _dark-color-scheme: dark-color-scheme();
|
||||
|
||||
// The colors in light mode are default palette. In the
|
||||
// Fluent UI Theme Designer they match the colors produced
|
||||
|
@ -21,22 +21,22 @@ export global Palette := {
|
|||
property<color> themeLight: #c7e0f4;
|
||||
property<color> themeLighter: #deecf9;
|
||||
property<color> themeLighterAlt: #eff6fc;
|
||||
property<color> black: !_dark-style ? #000000 : #f8f8f8;
|
||||
property<color> black: !_dark-color-scheme ? #000000 : #f8f8f8;
|
||||
property<color> blackTranslucent40: rgba(0,0,0,0.4);
|
||||
property<color> neutralDark: !_dark-style ? #201f1e : #f4f4f4;
|
||||
property<color> neutralPrimary: !_dark-style ? #323130 : #ffffff;
|
||||
property<color> neutralPrimaryAlt: !_dark-style ? #3b3a39 : #dadada;
|
||||
property<color> neutralSecondary: !_dark-style ? #605e5c : #d0d0d0;
|
||||
property<color> neutralDark: !_dark-color-scheme ? #201f1e : #f4f4f4;
|
||||
property<color> neutralPrimary: !_dark-color-scheme ? #323130 : #ffffff;
|
||||
property<color> neutralPrimaryAlt: !_dark-color-scheme ? #3b3a39 : #dadada;
|
||||
property<color> neutralSecondary: !_dark-color-scheme ? #605e5c : #d0d0d0;
|
||||
property<color> neutralSecondaryAlt: #8a8886;
|
||||
property<color> neutralTertiary: !_dark-style ? #a19f9d : #c8c8c8;
|
||||
property<color> neutralTertiaryAlt: !_dark-style ? #c8c6c4 : #6d6d6d;
|
||||
property<color> neutralTertiary: !_dark-color-scheme ? #a19f9d : #c8c8c8;
|
||||
property<color> neutralTertiaryAlt: !_dark-color-scheme ? #c8c6c4 : #6d6d6d;
|
||||
property<color> neutralQuaternary: #d2d0ce;
|
||||
property<color> neutralQuaternaryAlt: !_dark-style ? #e1dfdd : #484848;
|
||||
property<color> neutralLight: !_dark-style ? #edebe9 : #3f3f3f;
|
||||
property<color> neutralLighter: !_dark-style ? #f3f2f1 : #313131;
|
||||
property<color> neutralLighterAlt: !_dark-style ? #faf9f8 : #282828;
|
||||
property<color> neutralQuaternaryAlt: !_dark-color-scheme ? #e1dfdd : #484848;
|
||||
property<color> neutralLight: !_dark-color-scheme ? #edebe9 : #3f3f3f;
|
||||
property<color> neutralLighter: !_dark-color-scheme ? #f3f2f1 : #313131;
|
||||
property<color> neutralLighterAlt: !_dark-color-scheme ? #faf9f8 : #282828;
|
||||
property<color> accent: #0078d4;
|
||||
property<color> white: !_dark-style ? #ffffff : #1f1f1f;
|
||||
property<color> white: !_dark-color-scheme ? #ffffff : #1f1f1f;
|
||||
property<color> whiteTranslucent40: rgba(255,255,255,0.4);
|
||||
property<color> yellowDark: #d29200;
|
||||
property<color> yellow: #ffb900;
|
||||
|
@ -75,7 +75,7 @@ export global StyleMetrics := {
|
|||
property<color> textedit-text-color: Palette.neutralPrimary;
|
||||
property<brush> textedit-background-disabled: Palette.neutralLighter;
|
||||
property<color> textedit-text-color-disabled: Palette.neutralTertiary;
|
||||
property<bool> dark-style: Palette._dark-style;
|
||||
property<bool> dark-color-scheme: Palette._dark-color-scheme;
|
||||
}
|
||||
|
||||
export Button := Rectangle {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue