Use dark/light specification from system

This commit is contained in:
Yuri Becker
2025-03-20 14:03:40 +01:00
parent dc1ea604f7
commit 83f64f9af8
6 changed files with 16 additions and 6 deletions

View File

@@ -16,6 +16,8 @@ ApplicationWindow
property string confile: ""
property alias settingsFileDialog: settingsFiledialog
palette.text: Colors.foreground
TopBar
{

View File

@@ -7,7 +7,7 @@ T.Button {
id: control
icon.color: Colors.foreground
icon.color: Colors.primaryContrast
icon.height: 21
icon.width: 21
implicitHeight: Math.max(
@@ -32,7 +32,7 @@ T.Button {
icon: control.icon
text: control.text
font: control.font
color: Colors.foreground
color: Colors.primaryContrast
}
onIconChanged: () => {

View File

@@ -6,10 +6,11 @@ QtObject {
readonly property int dark: 0
readonly property int light: 1
property int theme: dark
property int theme: Application.styleHints.colorScheme === Qt.ColorScheme.Light ? light : dark
readonly property color primary: "#b81a34"
readonly property color foreground: theme === dark ? "#fdfdfd" : "#110b0c"
property color primary: "#b81a34"
property color primaryContrast: "#fdfdfd"
property color foreground: theme === dark ? "#fdfdfd" : "#110b0c"
readonly property color background: theme === dark ? "#303136" : "#eff1f5"
readonly property color mantle: theme === dark ? "#1e1f22" : "#e7e9ef"
readonly property color interactive: theme === dark ? "#878b97" : "#d9d9da"

5
TeroStyle/Label.qml Normal file
View File

@@ -0,0 +1,5 @@
import QtQuick.Controls
Label {
color: Colors.foreground
}

View File

@@ -5,4 +5,5 @@ singleton Typography Typography.qml
Button Button.qml
ComboBox ComboBox.qml
Field Field.qml
Label Label.qml
TextField TextField.qml

View File

@@ -52,8 +52,9 @@
<file>TeroStyle/Button.qml</file>
<file>TeroStyle/Colors.qml</file>
<file>TeroStyle/ComboBox.qml</file>
<file>TeroStyle/Field.qml</file>
<file>TeroStyle/Dimensions.qml</file>
<file>TeroStyle/Field.qml</file>
<file>TeroStyle/Label.qml</file>
<file>TeroStyle/qmldir</file>
<file>TeroStyle/TextField.qml</file>
<file>TeroStyle/Typography.qml</file>