diff --git a/app/qml/Main.qml b/app/qml/Main.qml index e93c847..9dcc2b1 100644 --- a/app/qml/Main.qml +++ b/app/qml/Main.qml @@ -4,6 +4,7 @@ import QtQuick.Window import Quickshell import Omamail.Native import qs.Commons +import qs.Commons as Commons import "../../ui" as Omamail import "../../ui/settings/Appearance.js" as Appearance @@ -140,7 +141,7 @@ ApplicationWindow { Binding { target: Quickshell; property: "nativeHost"; value: root.nativeHost } Binding { target: Quickshell; property: "fileStore"; value: root.nativeFileStore } Binding { - target: Color + target: Commons.Color property: "preferredAppearance" value: Appearance.paletteFor(mailService.appearance) } @@ -211,7 +212,7 @@ ApplicationWindow { // The palette's own border role rather than the control border: a // control's edge is the foreground at 40%, which on a light palette is a // dark line around the whole window. - border.color: Color.border + border.color: Commons.Color.border antialiasing: false } diff --git a/app/qml/StandaloneShell.qml b/app/qml/StandaloneShell.qml index 25020d8..888f461 100644 --- a/app/qml/StandaloneShell.qml +++ b/app/qml/StandaloneShell.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Dialogs import qs.Commons +import qs.Commons as Commons QtObject { id: root @@ -24,7 +25,7 @@ QtObject { reopen: !!host && !!host.capabilities && host.capabilities.reopen === true, // An installed Omarchy theme is the palette; the appearance setting only // has something to decide where the fallback palettes are in use. - appearance: !Color.hasOmarchyTheme + appearance: !Commons.Color.hasOmarchyTheme }) property var fileCallback: null diff --git a/app/qml/imports/Quickshell/FloatingWindow.qml b/app/qml/imports/Quickshell/FloatingWindow.qml index 59546ff..53fe420 100644 --- a/app/qml/imports/Quickshell/FloatingWindow.qml +++ b/app/qml/imports/Quickshell/FloatingWindow.qml @@ -1,10 +1,11 @@ import QtQuick import qs.Commons +import qs.Commons as Commons Item { property size minimumSize: Qt.size(0, 0) property string title: "" - property color color: Color.background + property color color: Commons.Color.background width: parent ? parent.width : implicitWidth height: parent ? parent.height : implicitHeight } diff --git a/app/qml/imports/qs/Commons/Style.qml b/app/qml/imports/qs/Commons/Style.qml index 6868551..fc1b417 100644 --- a/app/qml/imports/qs/Commons/Style.qml +++ b/app/qml/imports/qs/Commons/Style.qml @@ -1,5 +1,6 @@ pragma Singleton import QtQuick +import qs.Commons as Commons QtObject { id: root @@ -30,8 +31,8 @@ QtObject { // standalone tooltip the same pause, including controls that use the // platform style directly. readonly property int tooltipDelay: 400 - readonly property color normalBorderColor: normalBorderFor(Color.foreground, Color.accent) - readonly property color selectedAccentFill: selectedFillFor(Color.foreground, Color.accent) + readonly property color normalBorderColor: normalBorderFor(Commons.Color.foreground, Commons.Color.accent) + readonly property color selectedAccentFill: selectedFillFor(Commons.Color.foreground, Commons.Color.accent) readonly property var font: ({ family: metrics.font.family, iconFamily: iconFont.status === FontLoader.Ready ? iconFont.name : metrics.font.family, @@ -88,8 +89,8 @@ QtObject { var role = token.toLowerCase() if (role === "foreground" || role === "text") return foreground if (role === "accent") return accent - if (role === "urgent") return Color.urgent - if (role === "background") return Color.background + if (role === "urgent") return Commons.Color.urgent + if (role === "background") return Commons.Color.background if (role === "transparent") return Qt.rgba(0, 0, 0, 0) if (role === "hover" || role === "hover-cursor" || role === "inherit") return fallback return token.charAt(0) === "#" ? token : fallback diff --git a/app/qml/imports/qs/Ui/BarIconButton.qml b/app/qml/imports/qs/Ui/BarIconButton.qml index 62a01b9..4dafcc5 100644 --- a/app/qml/imports/qs/Ui/BarIconButton.qml +++ b/app/qml/imports/qs/Ui/BarIconButton.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Controls as QQC import qs.Commons +import qs.Commons as Commons Item { id: root @@ -11,7 +12,7 @@ Item { property real slotSize: Style.space(24) property real opticalSize: Style.space(20) property bool active: false - property color foreground: Color.foreground + property color foreground: Commons.Color.foreground signal pressed(int button) signal wheelMoved(int delta) diff --git a/app/qml/imports/qs/Ui/BorderSurface.qml b/app/qml/imports/qs/Ui/BorderSurface.qml index 336c9f5..1c3e2a9 100644 --- a/app/qml/imports/qs/Ui/BorderSurface.qml +++ b/app/qml/imports/qs/Ui/BorderSurface.qml @@ -1,9 +1,10 @@ import QtQuick import qs.Commons +import qs.Commons as Commons Rectangle { property var borderSpec: Border.flat(Style.normalBorderColor, Style.normalBorderWidth) - color: Style.withAlpha(Color.background, 0) + color: Style.withAlpha(Commons.Color.background, 0) border.color: borderSpec && borderSpec.color !== undefined ? borderSpec.color : Style.normalBorderColor border.width: borderSpec && borderSpec.width !== undefined diff --git a/app/qml/imports/qs/Ui/Button.qml b/app/qml/imports/qs/Ui/Button.qml index cda7908..c45f509 100644 --- a/app/qml/imports/qs/Ui/Button.qml +++ b/app/qml/imports/qs/Ui/Button.qml @@ -1,14 +1,15 @@ import QtQuick import QtQuick.Controls.Basic as QQC import qs.Commons +import qs.Commons as Commons Rectangle { id: root property string text: "" property string tooltipText: "" - property color foreground: Color.foreground - property color accent: Color.accent + property color foreground: Commons.Color.foreground + property color accent: Commons.Color.accent property color background: Style.normalFillFor(foreground, accent) property bool bordered: false property bool selected: false diff --git a/app/qml/imports/qs/Ui/Dropdown.qml b/app/qml/imports/qs/Ui/Dropdown.qml index a64fd01..3e7be8c 100644 --- a/app/qml/imports/qs/Ui/Dropdown.qml +++ b/app/qml/imports/qs/Ui/Dropdown.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Controls as QQC import qs.Commons +import qs.Commons as Commons Item { id: root @@ -8,10 +9,10 @@ Item { property string label: "" property string value: "" property var options: [] - property color foreground: Color.foreground - property color background: Color.background - property color popupBorder: Color.popups.border - property color accent: Color.accent + property color foreground: Commons.Color.foreground + property color background: Commons.Color.background + property color popupBorder: Commons.Color.popups.border + property color accent: Commons.Color.accent property string fontFamily: Style.font.family property int rowHeight: Style.spacing.controlHeight property int popupRowHeight: Style.spacing.popupRowHeight diff --git a/app/qml/imports/qs/Ui/NumberField.qml b/app/qml/imports/qs/Ui/NumberField.qml index 890b7b6..7f295da 100644 --- a/app/qml/imports/qs/Ui/NumberField.qml +++ b/app/qml/imports/qs/Ui/NumberField.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Controls as QQC import qs.Commons +import qs.Commons as Commons Item { id: root @@ -10,8 +11,8 @@ Item { property int from: 0 property int to: 100 property int stepSize: 1 - property color foreground: Color.foreground - property color accent: Color.accent + property color foreground: Commons.Color.foreground + property color accent: Commons.Color.accent property string fontFamily: Style.font.family property real fontSize: Style.font.bodySmall property real fieldWidth: Style.space(80) @@ -48,7 +49,7 @@ Item { editable: true font.family: root.fontFamily font.pixelSize: root.fontSize - palette.window: Color.background + palette.window: Commons.Color.background palette.windowText: root.foreground palette.highlight: root.accent onValueModified: { diff --git a/app/qml/imports/qs/Ui/PanelActionButton.qml b/app/qml/imports/qs/Ui/PanelActionButton.qml index ce3abdf..23197c2 100644 --- a/app/qml/imports/qs/Ui/PanelActionButton.qml +++ b/app/qml/imports/qs/Ui/PanelActionButton.qml @@ -1,13 +1,14 @@ import QtQuick import QtQuick.Controls.Basic as QQC import qs.Commons +import qs.Commons as Commons Item { id: root property string iconText: "" property string tooltipText: "" - property color foreground: Color.foreground + property color foreground: Commons.Color.foreground property color hoverColor: foreground property string fontFamily: Style.font.family property real fontSize: Style.font.bodySmall diff --git a/app/qml/imports/qs/Ui/PanelSectionHeader.qml b/app/qml/imports/qs/Ui/PanelSectionHeader.qml index 2728caa..33ff8fd 100644 --- a/app/qml/imports/qs/Ui/PanelSectionHeader.qml +++ b/app/qml/imports/qs/Ui/PanelSectionHeader.qml @@ -1,8 +1,9 @@ import QtQuick import qs.Commons +import qs.Commons as Commons Text { - property color foreground: Color.foreground + property color foreground: Commons.Color.foreground property string fontFamily: Style.font.family color: foreground font.family: fontFamily diff --git a/app/qml/imports/qs/Ui/PanelSeparator.qml b/app/qml/imports/qs/Ui/PanelSeparator.qml index 59e8b67..42be822 100644 --- a/app/qml/imports/qs/Ui/PanelSeparator.qml +++ b/app/qml/imports/qs/Ui/PanelSeparator.qml @@ -1,11 +1,12 @@ import QtQuick import qs.Commons +import qs.Commons as Commons Item { - property color foreground: Color.foreground + property color foreground: Commons.Color.foreground implicitHeight: Math.max(1, Style.normalBorderWidth) Rectangle { anchors.fill: parent - color: Style.normalBorderFor(parent.foreground, Color.accent) + color: Style.normalBorderFor(parent.foreground, Commons.Color.accent) } } diff --git a/app/qml/imports/qs/Ui/PanelToolTip.qml b/app/qml/imports/qs/Ui/PanelToolTip.qml index 8107d0e..c2bd099 100644 --- a/app/qml/imports/qs/Ui/PanelToolTip.qml +++ b/app/qml/imports/qs/Ui/PanelToolTip.qml @@ -1,12 +1,13 @@ import QtQuick import QtQuick.Controls as QQC import qs.Commons +import qs.Commons as Commons QQC.ToolTip { property string fontFamily: Style.font.family delay: Style.tooltipDelay font.family: fontFamily font.pixelSize: Style.font.caption - palette.window: Color.popups.background - palette.windowText: Color.popups.text + palette.window: Commons.Color.popups.background + palette.windowText: Commons.Color.popups.text } diff --git a/app/qml/imports/qs/Ui/TextField.qml b/app/qml/imports/qs/Ui/TextField.qml index dce663e..afdd0dc 100644 --- a/app/qml/imports/qs/Ui/TextField.qml +++ b/app/qml/imports/qs/Ui/TextField.qml @@ -1,20 +1,21 @@ import QtQuick import QtQuick.Controls.Basic as QQC import qs.Commons +import qs.Commons as Commons QQC.TextField { id: root property bool password: false - property color foreground: Color.foreground - property color accent: Color.accent + property color foreground: Commons.Color.foreground + property color accent: Commons.Color.accent property real verticalPadding: Style.spacing.inputPaddingY property real horizontalPadding: Style.spacing.controlPaddingX color: foreground selectionColor: Style.selectionFillFor(foreground, accent) selectedTextColor: foreground - placeholderTextColor: Style.mutedColorFor(foreground, Color.background) + placeholderTextColor: Style.mutedColorFor(foreground, Commons.Color.background) echoMode: password ? TextInput.Password : TextInput.Normal topPadding: verticalPadding bottomPadding: verticalPadding diff --git a/app/qml/imports/qs/Ui/ToggleSwitch.qml b/app/qml/imports/qs/Ui/ToggleSwitch.qml index 4362b5b..7600461 100644 --- a/app/qml/imports/qs/Ui/ToggleSwitch.qml +++ b/app/qml/imports/qs/Ui/ToggleSwitch.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Controls as QQC import qs.Commons +import qs.Commons as Commons Item { id: root @@ -10,8 +11,8 @@ Item { property bool interactive: true property bool cursorRing: false property bool hasCursor: false - property color foreground: Color.foreground - property color accent: Color.accent + property color foreground: Commons.Color.foreground + property color accent: Commons.Color.accent signal toggled() onCheckedChanged: { @@ -28,7 +29,7 @@ Item { checked: root.checked enabled: root.interactive && !root.busy focusPolicy: root.interactive ? Qt.StrongFocus : Qt.NoFocus - palette.window: Color.background + palette.window: Commons.Color.background palette.windowText: root.foreground palette.highlight: root.accent onToggled: { @@ -53,7 +54,7 @@ Item { height: parent.height running: root.busy visible: running - palette.window: Color.background + palette.window: Commons.Color.background palette.windowText: root.foreground palette.highlight: root.accent } diff --git a/app/qml/styles/Omamail/ComboBox.qml b/app/qml/styles/Omamail/ComboBox.qml index c18278d..3e7a50f 100644 --- a/app/qml/styles/Omamail/ComboBox.qml +++ b/app/qml/styles/Omamail/ComboBox.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Templates as T import qs.Commons +import qs.Commons as Commons // The shell's Dropdown, drawn here: a platform ComboBox brings its own // up/down arrows and its own type size, which read as a foreign control in a @@ -28,6 +29,7 @@ T.ComboBox { } indicator: Canvas { + id: chevron objectName: "omamail-combobox-chevron" x: control.width - width - Style.spacing.controlPaddingX y: (control.height - height) / 2 @@ -46,7 +48,7 @@ T.ComboBox { } Connections { target: control - function onSemanticForegroundChanged() { parent.requestPaint() } + function onSemanticForegroundChanged() { chevron.requestPaint() } } } @@ -87,9 +89,9 @@ T.ComboBox { } background: Rectangle { - color: Color.popups.background + color: Commons.Color.popups.background border.width: 1 - border.color: Color.popups.border + border.color: Commons.Color.popups.border radius: Style.cornerRadius } } diff --git a/app/qml/styles/Omamail/ScrollBar.qml b/app/qml/styles/Omamail/ScrollBar.qml index 9ffeaad..8201519 100644 --- a/app/qml/styles/Omamail/ScrollBar.qml +++ b/app/qml/styles/Omamail/ScrollBar.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Templates as T import qs.Commons +import qs.Commons as Commons T.ScrollBar { id: control @@ -19,10 +20,10 @@ T.ScrollBar { implicitHeight: control.interactive ? Style.space(8) : Style.space(3) radius: Style.cornerRadius color: control.pressed - ? Style.pressedFillFor(Color.foreground, Color.accent) + ? Style.pressedFillFor(Commons.Color.foreground, Commons.Color.accent) : (control.hovered - ? Style.selectedFillFor(Color.foreground, Color.accent) - : Style.hoverFillFor(Color.foreground, Color.accent)) + ? Style.selectedFillFor(Commons.Color.foreground, Commons.Color.accent) + : Style.hoverFillFor(Commons.Color.foreground, Commons.Color.accent)) opacity: control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0) ? 1 : 0 @@ -33,6 +34,6 @@ T.ScrollBar { visible: control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0) radius: Style.cornerRadius - color: Style.normalFillFor(Color.foreground, Color.accent) + color: Style.normalFillFor(Commons.Color.foreground, Commons.Color.accent) } } diff --git a/app/qml/styles/Omamail/ToolTip.qml b/app/qml/styles/Omamail/ToolTip.qml index 33fb2b7..5fffc53 100644 --- a/app/qml/styles/Omamail/ToolTip.qml +++ b/app/qml/styles/Omamail/ToolTip.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Templates as T import qs.Commons +import qs.Commons as Commons T.ToolTip { id: control @@ -45,16 +46,16 @@ T.ToolTip { contentItem: Text { objectName: "omamail-tooltip-label" text: control.text - color: Color.popups.text + color: Commons.Color.popups.text font.family: Style.font.family font.pixelSize: Style.font.caption } background: Rectangle { objectName: "omamail-tooltip-background" - color: Color.popups.background + color: Commons.Color.popups.background radius: Style.cornerRadius border.width: Style.normalBorderWidth - border.color: Color.popups.border + border.color: Commons.Color.popups.border } } diff --git a/app/tests/qml/tst_host_contract.qml b/app/tests/qml/tst_host_contract.qml index 50b1a87..d5f4d72 100644 --- a/app/tests/qml/tst_host_contract.qml +++ b/app/tests/qml/tst_host_contract.qml @@ -3,6 +3,7 @@ import QtTest import Quickshell import Quickshell.Io import qs.Commons +import qs.Commons as Commons import qs.Ui import "../../../ui" as Omamail import "../../../ui/components" as Components @@ -99,7 +100,7 @@ TestCase { visible: false Button { id: button; text: "Save"; tooltipText: "Save help" } TextField { id: textField; password: true } - BorderSurface { id: surface; borderSpec: Border.controlSpec("normal", Color.foreground, Color.accent) } + BorderSurface { id: surface; borderSpec: Border.controlSpec("normal", Commons.Color.foreground, Commons.Color.accent) } NumberField { id: numberField; label: "Count"; from: 1; to: 10; value: 4 } PanelActionButton { id: actionButton; iconText: "+" } PanelSeparator { id: separator } @@ -113,17 +114,17 @@ TestCase { host.reset() Quickshell.nativeHost = host Quickshell.fileStore = host - Color.reload() + Commons.Color.reload() } function test_panel_tooltip_uses_shared_hover_delay() { compare(toolTip.delay, Style.tooltipDelay) - compare(String(toolTip.palette.window), String(Color.popups.background)) - compare(String(toolTip.palette.windowText), String(Color.popups.text)) + compare(String(toolTip.palette.window), String(Commons.Color.popups.background)) + compare(String(toolTip.palette.windowText), String(Commons.Color.popups.text)) } function test_tooltip_draws_an_opaque_nonzero_surface_behind_its_text() { - Color.applySystemAppearance("light") + Commons.Color.applySystemAppearance("light") toolTip.visible = true tryCompare(toolTip, "opened", true, Style.tooltipDelay + 1000) verify(toolTip.width > toolTip.contentItem.implicitWidth) @@ -134,8 +135,8 @@ TestCase { compare(toolTip.background.opacity, 1) compare(toolTip.background.color.a, 1) verify(toolTip.background.z < toolTip.contentItem.z) - compare(String(toolTip.background.color), String(Color.popups.background)) - compare(String(toolTip.background.color), String(Color.background)) + compare(String(toolTip.background.color), String(Commons.Color.popups.background)) + compare(String(toolTip.background.color), String(Commons.Color.background)) toolTip.visible = false tryCompare(toolTip, "opened", false) } @@ -169,17 +170,17 @@ TestCase { } function test_semantic_theme_comes_from_a_valid_system_palette() { - verify(Color.foreground.valid) - verify(Color.background.valid) - verify(Color.accent.valid) - verify(Color.urgent.valid) - verify(Color.popups.background.valid) - compare(String(Color.popups.background), String(Color.background)) - verify(Color.popups.border.valid) + verify(Commons.Color.foreground.valid) + verify(Commons.Color.background.valid) + verify(Commons.Color.accent.valid) + verify(Commons.Color.urgent.valid) + verify(Commons.Color.popups.background.valid) + compare(String(Commons.Color.popups.background), String(Commons.Color.background)) + verify(Commons.Color.popups.border.valid) verify(Style.normalBorderColor.valid) verify(Style.selectedAccentFill.valid) verify(Style.space(8) > 0) - verify(Style.mutedColorFor(Color.foreground, Color.background).valid) + verify(Style.mutedColorFor(Commons.Color.foreground, Commons.Color.background).valid) compare(Style.cornerRadius, 0) compare(Style.font.body, 12) compare(Style.font.caption, 10) @@ -211,9 +212,9 @@ TestCase { "/fixture/home/.config/omarchy/current/theme/colors.toml": "background='#ffffff'\nforeground='#000000'\naccent='#abcdef'\nred='#990000'\nyellow='#996600'\ngreen='#006600'" }) - verify(Color.reload()) - compare(String(Color.background), "#111111") - compare(String(Color.accent), "#123456") + verify(Commons.Color.reload()) + compare(String(Commons.Color.background), "#111111") + compare(String(Commons.Color.accent), "#123456") } function test_legacy_theme_is_used_only_without_state_current() { @@ -221,9 +222,9 @@ TestCase { "/fixture/home/.config/omarchy/current/theme/colors.toml": "background='#ffffff'\nforeground='#000000'\naccent='#205ea6'\nred='#af3029'\nyellow='#855b00'\ngreen='#526600'" }) - verify(Color.reload()) - compare(String(Color.background), "#ffffff") - compare(String(Color.accent), "#205ea6") + verify(Commons.Color.reload()) + compare(String(Commons.Color.background), "#ffffff") + compare(String(Commons.Color.accent), "#205ea6") } function test_invalid_current_theme_falls_back_atomically() { @@ -233,70 +234,70 @@ TestCase { "/fixture/home/.config/omarchy/current/theme/colors.toml": "background='#ffffff'\nforeground='#000000'\naccent='#abcdef'\nred='#990000'\nyellow='#996600'\ngreen='#006600'" }) - Color.applySystemAppearance("dark") - verify(!Color.reload()) - compare(String(Color.background), "#1a1b26") - compare(String(Color.foreground), "#a9b1d6") - compare(String(Color.accent), "#7aa2f7") - compare(String(Color.urgent), "#f7768e") + Commons.Color.applySystemAppearance("dark") + verify(!Commons.Color.reload()) + compare(String(Commons.Color.background), "#1a1b26") + compare(String(Commons.Color.foreground), "#a9b1d6") + compare(String(Commons.Color.accent), "#7aa2f7") + compare(String(Commons.Color.urgent), "#f7768e") } function test_system_scheme_switches_complete_fallback_but_not_omarchy_theme() { host.files = ({}) - Color.reload() - verify(!Color.hasOmarchyTheme) - verify(Color.applySystemAppearance("light")) - compare(Color.dark, false) - compare(String(Color.background), "#fffcf0") - compare(String(Color.foreground), "#100f0f") - compare(String(Color.accent), "#205ea6") - compare(String(Color.surface), "#f2f0e5") - compare(String(Color.inset), "#e6e4d9") - compare(String(Color.border), "#b7b5ac") - - verify(Color.applySystemAppearance("dark")) - compare(Color.dark, true) - compare(String(Color.background), "#1a1b26") + Commons.Color.reload() + verify(!Commons.Color.hasOmarchyTheme) + verify(Commons.Color.applySystemAppearance("light")) + compare(Commons.Color.dark, false) + compare(String(Commons.Color.background), "#fffcf0") + compare(String(Commons.Color.foreground), "#100f0f") + compare(String(Commons.Color.accent), "#205ea6") + compare(String(Commons.Color.surface), "#f2f0e5") + compare(String(Commons.Color.inset), "#e6e4d9") + compare(String(Commons.Color.border), "#b7b5ac") + + verify(Commons.Color.applySystemAppearance("dark")) + compare(Commons.Color.dark, true) + compare(String(Commons.Color.background), "#1a1b26") var path = "/fixture/home/.local/state/omarchy/current/theme/colors.toml" host.files[path] = "mode='light'\nbackground='#ffffff'\nforeground='#111111'\naccent='#123456'\nred='#990000'\nyellow='#996600'\ngreen='#006600'" - verify(Color.reload()) - verify(Color.hasOmarchyTheme) - compare(String(Color.accent), "#123456") - verify(!Color.applySystemAppearance("dark")) - compare(String(Color.accent), "#123456") - compare(Color.dark, false) + verify(Commons.Color.reload()) + verify(Commons.Color.hasOmarchyTheme) + compare(String(Commons.Color.accent), "#123456") + verify(!Commons.Color.applySystemAppearance("dark")) + compare(String(Commons.Color.accent), "#123456") + compare(Commons.Color.dark, false) } function test_preferred_appearance_overrides_the_desktop_but_not_omarchy() { host.files = ({}) - Color.preferredAppearance = "" - Color.reload() - verify(!Color.hasOmarchyTheme) - Color.preferredAppearance = "dark" - compare(Color.dark, true) - compare(String(Color.background), "#1a1b26") - Color.preferredAppearance = "light" - compare(Color.dark, false) - compare(String(Color.background), "#fffcf0") + Commons.Color.preferredAppearance = "" + Commons.Color.reload() + verify(!Commons.Color.hasOmarchyTheme) + Commons.Color.preferredAppearance = "dark" + compare(Commons.Color.dark, true) + compare(String(Commons.Color.background), "#1a1b26") + Commons.Color.preferredAppearance = "light" + compare(Commons.Color.dark, false) + compare(String(Commons.Color.background), "#fffcf0") // The desktop's scheme only decides when nothing is preferred. - verify(Color.applySystemAppearance("dark")) - compare(Color.dark, true) - compare(Color.fallbackAppearance(), "light") - Color.reload() - compare(Color.dark, false) + verify(Commons.Color.applySystemAppearance("dark")) + compare(Commons.Color.dark, true) + compare(Commons.Color.fallbackAppearance(), "light") + Commons.Color.reload() + compare(Commons.Color.dark, false) var path = "/fixture/home/.local/state/omarchy/current/theme/colors.toml" host.files[path] = "mode='dark'\nbackground='#010203'\nforeground='#fefefe'\naccent='#123456'\nred='#990000'\nyellow='#996600'\ngreen='#006600'" - verify(Color.reload()) - verify(Color.hasOmarchyTheme) - Color.preferredAppearance = "light" - compare(Color.dark, true) - compare(String(Color.background), "#010203") - Color.preferredAppearance = "" + verify(Commons.Color.reload()) + verify(Commons.Color.hasOmarchyTheme) + Commons.Color.preferredAppearance = "light" + compare(Commons.Color.dark, true) + compare(String(Commons.Color.background), "#010203") + Commons.Color.preferredAppearance = "" } function test_theme_change_reloads_the_active_palette() { @@ -304,14 +305,14 @@ TestCase { host.files = ({}) host.files[path] = "background='#111111'\nforeground='#eeeeee'\naccent='#123456'\nred='#cc3333'\nyellow='#cccc33'\ngreen='#33cc33'" - verify(Color.reload()) + verify(Commons.Color.reload()) verify(host.watched[path]) host.files[path] = "background='#222222'\nforeground='#ffffff'\naccent='#654321'\nred='#dd4444'\nyellow='#dddd44'\ngreen='#44dd44'" host.changed(path) - compare(String(Color.background), "#222222") - compare(String(Color.accent), "#654321") + compare(String(Commons.Color.background), "#222222") + compare(String(Commons.Color.accent), "#654321") } function test_shell_theme_and_user_override_apply_atomically() { @@ -329,16 +330,16 @@ TestCase { "[font]\nbase-size=16\n[spacing]\ncontrol-height=38\n" + "[controls]\nnormal-fill-alpha=0.2" - verify(Color.reload()) + verify(Commons.Color.reload()) compare(Style.font.body, 17) compare(Style.font.caption, 13) compare(Style.spacing.controlHeight, 38) compare(Style.space(10), 15) - fuzzyCompare(Style.normalFillFor(Color.foreground, Color.accent).a, 0.2, 0.001) - compare(String(Style.selectedStateColor(Color.foreground, Color.accent)), "#336699") - compare(String(Color.popups.text), "#336699") - fuzzyCompare(Color.popups.background.a, 0.8, 0.001) - fuzzyCompare(Color.popups.border.a, 0.3, 0.001) + fuzzyCompare(Style.normalFillFor(Commons.Color.foreground, Commons.Color.accent).a, 0.2, 0.001) + compare(String(Style.selectedStateColor(Commons.Color.foreground, Commons.Color.accent)), "#336699") + compare(String(Commons.Color.popups.text), "#336699") + fuzzyCompare(Commons.Color.popups.background.a, 0.8, 0.001) + fuzzyCompare(Commons.Color.popups.border.a, 0.3, 0.001) verify(host.watched[themeRoot + "/shell.toml"]) verify(host.watched[userShell]) } @@ -351,7 +352,7 @@ TestCase { "background='#101010'\nforeground='#eeeeee'\naccent='#336699'\nred='#cc3333'\nyellow='#cccc33'\ngreen='#33cc33'" host.files[themeRoot + "/shell.toml"] = "[font]\nbase-size=14\n[spacing]\ncontrol-height=30" host.files[userShell] = "[font]\nbase-size=18\n[spacing]\ncontrol-height=44" - verify(Color.reload()) + verify(Commons.Color.reload()) compare(Style.font.body, 18) compare(Style.spacing.controlHeight, 44) diff --git a/app/tests/qml/tst_standalone_composition.qml b/app/tests/qml/tst_standalone_composition.qml index d09ba48..5f7ed13 100644 --- a/app/tests/qml/tst_standalone_composition.qml +++ b/app/tests/qml/tst_standalone_composition.qml @@ -3,6 +3,7 @@ import QtQuick.Controls import QtTest import Quickshell import qs.Commons +import qs.Commons as Commons import "../../qml" as Standalone import "../../../ui/providers" as Providers import "../../../ui/components" as Components @@ -47,10 +48,10 @@ TestCase { Components.CalendarSettings { service: calendarFixture controller: calendarFixture - textColor: Color.foreground - dimColor: Style.mutedColorFor(Color.foreground, Color.background) - accentColor: Color.accent - urgentColor: Color.accent + textColor: Commons.Color.foreground + dimColor: Style.mutedColorFor(Commons.Color.foreground, Commons.Color.background) + accentColor: Commons.Color.accent + urgentColor: Commons.Color.accent panelFontFamily: Style.font.family } } @@ -59,18 +60,18 @@ TestCase { id: styledSwitch visible: false checked: true - palette.window: Color.background - palette.windowText: Color.foreground - palette.highlight: Color.accent + palette.window: Commons.Color.background + palette.windowText: Commons.Color.foreground + palette.highlight: Commons.Color.accent } SpinBox { id: styledSpinBox visible: false editable: true - palette.window: Color.background - palette.windowText: Color.foreground - palette.highlight: Color.accent + palette.window: Commons.Color.background + palette.windowText: Commons.Color.foreground + palette.highlight: Commons.Color.accent } ToolTip { @@ -206,15 +207,15 @@ TestCase { verify(findChild(styledSpinBox, "omamail-spinbox-decrement")) verify(findChild(styledSpinBox, "omamail-spinbox-increment")) compare(background.radius, Style.cornerRadius) - compare(String(styledSpinBox.palette.windowText), String(Color.foreground)) + compare(String(styledSpinBox.palette.windowText), String(Commons.Color.foreground)) compare(styledToolTip.delay, Style.tooltipDelay) var tooltipLabel = findChild(styledToolTip, "omamail-tooltip-label") var tooltipBackground = findChild(styledToolTip, "omamail-tooltip-background") verify(tooltipLabel) verify(tooltipBackground) - compare(String(tooltipLabel.color), String(Color.popups.text)) - compare(String(tooltipBackground.color), String(Color.popups.background)) - compare(String(tooltipBackground.border.color), String(Color.popups.border)) + compare(String(tooltipLabel.color), String(Commons.Color.popups.text)) + compare(String(tooltipBackground.color), String(Commons.Color.popups.background)) + compare(String(tooltipBackground.border.color), String(Commons.Color.popups.border)) compare(tooltipBackground.radius, Style.cornerRadius) } @@ -257,8 +258,8 @@ TestCase { verify(composition.app.standaloneWindowChrome) var windowBorder = findChild(composition, "standalone-window-border") verify(windowBorder) - compare(String(windowBorder.border.color), String(Color.border)) - verify(String(Color.border) !== String(composition.app.borderColor)) + compare(String(windowBorder.border.color), String(Commons.Color.border)) + verify(String(Commons.Color.border) !== String(composition.app.borderColor)) compare(windowBorder.border.width, composition.app.borderWidth / Math.max(1, Screen.devicePixelRatio)) verify(windowBorder.visible) @@ -317,13 +318,13 @@ TestCase { findChild(composition, "appearance-dark").clicked() compare(host.settings.appearance, "Dark") compare(composition.service.appearance, "Dark") - compare(Color.dark, true) - compare(String(Color.preferredAppearance), "dark") + compare(Commons.Color.dark, true) + compare(String(Commons.Color.preferredAppearance), "dark") findChild(composition, "appearance-light").clicked() - compare(Color.dark, false) - compare(String(Color.background), "#fffcf0") + compare(Commons.Color.dark, false) + compare(String(Commons.Color.background), "#fffcf0") findChild(composition, "appearance-system").clicked() - compare(String(Color.preferredAppearance), "") + compare(String(Commons.Color.preferredAppearance), "") var appMenu = findChild(composition, "app-menu") verify(appMenu) compare(appMenu.canQuit, true) diff --git a/tests/test_source.sh b/tests/test_source.sh index 9d790f6..4e5a4d9 100755 --- a/tests/test_source.sh +++ b/tests/test_source.sh @@ -241,7 +241,7 @@ grep -q 'bar ? bar\.barForeground' BarWidget.qml \ || fail "the bar icon must follow bar.barForeground in transparent mode" grep -q 'markColor: root.accent' App.qml \ || fail "the Omamail header M must use the active theme accent" -grep -q 'markColor: Color.accent' BarWidget.qml \ +grep -q 'markColor: Commons.Color.accent' BarWidget.qml \ || fail "the bar M must use the active theme accent" # IconTextButton has no separate hover glyph colour. Assigning one makes the diff --git a/ui/App.qml b/ui/App.qml index 3a01abd..d960385 100644 --- a/ui/App.qml +++ b/ui/App.qml @@ -4,6 +4,7 @@ import QtQuick.Window import Quickshell import Quickshell.Io import qs.Commons +import qs.Commons as Commons import qs.Ui import "account/Model.js" as Model @@ -107,13 +108,13 @@ Item { onTriggered: root.saveComposeRecovery() } - readonly property color foreground: Color.foreground - readonly property color background: Color.background - readonly property color accent: Color.accent - readonly property color urgent: Color.urgent - readonly property color danger: Color.urgent - readonly property color popupBackground: Color.popups.background - readonly property color popupBorder: Color.popups.border + readonly property color foreground: Commons.Color.foreground + readonly property color background: Commons.Color.background + readonly property color accent: Commons.Color.accent + readonly property color urgent: Commons.Color.urgent + readonly property color danger: Commons.Color.urgent + readonly property color popupBackground: Commons.Color.popups.background + readonly property color popupBorder: Commons.Color.popups.border // Shared themed border for mail and standalone window chrome. readonly property color borderColor: Style.normalBorderColor readonly property int borderWidth: Style.normalBorderWidth diff --git a/ui/BarWidget.qml b/ui/BarWidget.qml index 808707d..1bfe934 100644 --- a/ui/BarWidget.qml +++ b/ui/BarWidget.qml @@ -1,6 +1,7 @@ import QtQuick import Quickshell import qs.Commons +import qs.Commons as Commons import qs.Ui import "components" import "bar" @@ -70,7 +71,7 @@ BarWidget { // `barForeground` belongs to qs.Ui.Panel, not to BarWidget: reading it here // yields undefined, and assigning undefined to a colour leaves the icon // unpainted. The bar itself is the source. - readonly property color foreground: bar ? bar.barForeground : Color.foreground + readonly property color foreground: bar ? bar.barForeground : Commons.Color.foreground property bool previewOpen: false property bool popoutSwitchClosing: false @@ -168,7 +169,7 @@ BarWidget { anchors.centerIn: parent iconSize: Style.space(12) color: button.glyphColor - markColor: Color.accent + markColor: Commons.Color.accent // The dot is simply whether unread mail is waiting. It used to mean // "something arrived since you last looked", which was a different // question from the one anyone asks of a mail icon, and it could not @@ -204,7 +205,7 @@ BarWidget { id: openIndicator readonly property bool vertical: !!root.bar && root.bar.vertical visible: button.windowOpen - color: Color.accent + color: Commons.Color.accent radius: Math.min(width, height) / 2 width: vertical ? Style.space(2) : Style.space(10) height: vertical ? Style.space(10) : Style.space(2) @@ -231,11 +232,11 @@ BarWidget { width: parent ? parent.width : 0 messages: root.gmail ? root.gmail.barMessages : [] events: root.gmail ? root.gmail.barEvents : [] - textColor: Color.popups.text - backgroundColor: Color.popups.background - accentColor: Color.accent - dimColor: Qt.rgba(Color.popups.text.r, Color.popups.text.g, - Color.popups.text.b, 0.62) + textColor: Commons.Color.popups.text + backgroundColor: Commons.Color.popups.background + accentColor: Commons.Color.accent + dimColor: Qt.rgba(Commons.Color.popups.text.r, Commons.Color.popups.text.g, + Commons.Color.popups.text.b, 0.62) panelFontFamily: Style.font.family contentDirection: root.gmail ? root.gmail.contentDirection : "" onMessageRequested: function(accountId, messageId) { diff --git a/ui/Service.qml b/ui/Service.qml index 82f5151..6f0c762 100644 --- a/ui/Service.qml +++ b/ui/Service.qml @@ -3,6 +3,7 @@ import "compose/Recipients.js" as AgentRecipients import Quickshell import Quickshell.Io import qs.Commons +import qs.Commons as Commons import "account" import "calendar" import "agent" @@ -2600,8 +2601,8 @@ Item { CalendarReminders { service: root pluginDir: root.pluginDir - notificationForeground: Color.foreground - notificationAccent: Color.accent + notificationForeground: Commons.Color.foreground + notificationAccent: Commons.Color.accent } } } @@ -2631,8 +2632,8 @@ Item { return index < accounts.length ? accounts[index] : null } - notificationForeground: Color.foreground - notificationAccent: Color.accent + notificationForeground: Commons.Color.foreground + notificationAccent: Commons.Color.accent pluginDir: root.pluginDir accountId: entry ? entry.id : "" backend: root.backend diff --git a/ui/components/ActionIcon.qml b/ui/components/ActionIcon.qml index bee6338..cdd4dab 100644 --- a/ui/components/ActionIcon.qml +++ b/ui/components/ActionIcon.qml @@ -1,5 +1,6 @@ import QtQuick import qs.Commons +import qs.Commons as Commons import "Icons.js" as Icons // One of the app's icons, by name. @@ -16,7 +17,7 @@ Item { id: root property string name: "" - property color color: Color.foreground + property color color: Commons.Color.foreground // Omamail keeps the envelope in the foreground and gives its M the active // theme accent. Provider artwork uses ProviderLogo instead of this mark. property color markColor: color diff --git a/ui/components/EmlSavedToast.qml b/ui/components/EmlSavedToast.qml index 4e93c7c..2580706 100644 --- a/ui/components/EmlSavedToast.qml +++ b/ui/components/EmlSavedToast.qml @@ -1,6 +1,7 @@ import QtQuick import Quickshell import qs.Commons +import qs.Commons as Commons import qs.Ui import "../account/MessageActions.js" as MessageActions @@ -16,9 +17,9 @@ Rectangle { // seven, because App.qml sits against the repository's file-size ceiling. required property var app readonly property var service: app ? app.service : null - readonly property color textColor: app ? app.foreground : Color.foreground + readonly property color textColor: app ? app.foreground : Commons.Color.foreground readonly property color dimColor: app ? app.dim : textColor - readonly property color accentColor: app ? app.accent : Color.accent + readonly property color accentColor: app ? app.accent : Commons.Color.accent readonly property color popupBackgroundColor: app ? app.popupBackground : Qt.rgba(0, 0, 0, 1) readonly property color popupBorderColor: app ? app.popupBorder : textColor readonly property string panelFontFamily: app ? app.fontFamily : Style.font.family diff --git a/ui/components/GmailIcon.qml b/ui/components/GmailIcon.qml index c327f2f..430aa3b 100644 --- a/ui/components/GmailIcon.qml +++ b/ui/components/GmailIcon.qml @@ -1,5 +1,6 @@ import QtQuick import qs.Commons +import qs.Commons as Commons import qs.Ui // The mark, drawn rather than rasterised from an SVG: the bar slot is about @@ -12,9 +13,9 @@ Item { id: root property real iconSize: Style.font.icon - property color color: Color.foreground + property color color: Commons.Color.foreground property color markColor: color - property color badgeColor: Color.urgent + property color badgeColor: Commons.Color.urgent // A dot, not a count: the bar says "something arrived", the tooltip says // how much, and the window says what. property bool dot: false @@ -102,6 +103,6 @@ Item { anchors.rightMargin: -parent.width * 0.06 anchors.top: parent.top anchors.topMargin: -parent.height * 0.04 - borderSpec: Border.flat(Color.popups.background, 1) + borderSpec: Border.flat(Commons.Color.popups.background, 1) } } diff --git a/ui/components/IconButton.qml b/ui/components/IconButton.qml index 74f0f7e..dd4c1d6 100644 --- a/ui/components/IconButton.qml +++ b/ui/components/IconButton.qml @@ -1,5 +1,6 @@ import QtQuick import qs.Commons +import qs.Commons as Commons import qs.Ui // A drawn icon on the kit's shared hover/cursor surface. qs.Ui's @@ -10,9 +11,9 @@ Item { property string iconName: "" property string tooltipText: "" - property color foreground: Color.foreground + property color foreground: Commons.Color.foreground property color hoverColor: foreground - property color accent: Color.accent + property color accent: Commons.Color.accent property bool filled: false property bool hasCursor: false // Held down for as long as a menu this button opened is on screen. A trigger diff --git a/ui/components/IconTextButton.qml b/ui/components/IconTextButton.qml index 22156b7..5baed50 100644 --- a/ui/components/IconTextButton.qml +++ b/ui/components/IconTextButton.qml @@ -1,5 +1,6 @@ import QtQuick import qs.Commons +import qs.Commons as Commons import qs.Ui // A bordered button carrying a drawn icon beside its label. @@ -14,8 +15,8 @@ Rectangle { property string iconName: "" property string text: "" property string tooltipText: "" - property color foreground: Color.foreground - property color accent: Color.accent + property color foreground: Commons.Color.foreground + property color accent: Commons.Color.accent property bool bordered: true // Reserve the normal border but leave the field clear until interaction. property bool outline: false diff --git a/ui/components/ProviderLogo.qml b/ui/components/ProviderLogo.qml index 74148f0..4e21d98 100644 --- a/ui/components/ProviderLogo.qml +++ b/ui/components/ProviderLogo.qml @@ -1,5 +1,6 @@ import QtQuick import qs.Commons +import qs.Commons as Commons import qs.Ui // The mark of the service a setup page is about. @@ -29,7 +30,7 @@ Item { // and no brand this could put a name to. Left empty where a missing mark // should simply take no room. property string fallbackIcon: "" - property color fallbackColor: Color.foreground + property color fallbackColor: Commons.Color.foreground readonly property bool present: logo !== "" || fallbackIcon !== "" readonly property bool drawn: logo !== "" diff --git a/ui/tests/qml/tst_calendar_settings.qml b/ui/tests/qml/tst_calendar_settings.qml index cefa595..950e31d 100644 --- a/ui/tests/qml/tst_calendar_settings.qml +++ b/ui/tests/qml/tst_calendar_settings.qml @@ -1,6 +1,7 @@ import QtQuick 2.15 import QtTest 1.3 import qs.Commons +import qs.Commons as Commons import "../../components" as Omamail Item { @@ -74,10 +75,10 @@ Item { width: parent.width service: mailService calendarController: calendarController - textColor: Color.foreground - dimColor: Color.foreground - accentColor: Color.accent - urgentColor: Color.accent + textColor: Commons.Color.foreground + dimColor: Commons.Color.foreground + accentColor: Commons.Color.accent + urgentColor: Commons.Color.accent panelFontFamily: "monospace" } diff --git a/ui/tests/qml/tst_event_suggestions.qml b/ui/tests/qml/tst_event_suggestions.qml index 76924a3..5223fd4 100644 --- a/ui/tests/qml/tst_event_suggestions.qml +++ b/ui/tests/qml/tst_event_suggestions.qml @@ -1,6 +1,7 @@ import QtQuick 2.15 import QtTest 1.3 import qs.Commons +import qs.Commons as Commons import "../.." as Omamail import "../../components" as Mail import "../../account/Accounts.js" as Accounts @@ -66,10 +67,10 @@ Item { Mail.EventSuggestionCard { id: card width: 500 - textColor: Color.foreground - accentColor: Color.accent - dimColor: Color.foreground - dimmerColor: Color.foreground + textColor: Commons.Color.foreground + accentColor: Commons.Color.accent + dimColor: Commons.Color.foreground + dimmerColor: Commons.Color.foreground panelFontFamily: "monospace" } SignalSpy { id: added; target: card; signalName: "addRequested" } diff --git a/ui/tests/qml/tst_load_more.qml b/ui/tests/qml/tst_load_more.qml index f768bb6..409efb8 100644 --- a/ui/tests/qml/tst_load_more.qml +++ b/ui/tests/qml/tst_load_more.qml @@ -1,6 +1,7 @@ import QtQuick 2.15 import QtTest 1.3 import qs.Commons +import qs.Commons as Commons import "../../components" as Mail // The next page comes as the list is scrolled to its foot: once per foot, @@ -37,10 +38,10 @@ Item { scroller: flick width: flick.width service: fakeService - textColor: Color.foreground - accentColor: Color.accent - dimColor: Color.foreground - urgentColor: Color.accent + textColor: Commons.Color.foreground + accentColor: Commons.Color.accent + dimColor: Commons.Color.foreground + urgentColor: Commons.Color.accent panelFontFamily: "monospace" } } diff --git a/ui/tests/qml/tst_message_list_press.qml b/ui/tests/qml/tst_message_list_press.qml index 3af0b83..644db69 100644 --- a/ui/tests/qml/tst_message_list_press.qml +++ b/ui/tests/qml/tst_message_list_press.qml @@ -1,6 +1,7 @@ import QtQuick 2.15 import QtTest 1.3 import qs.Commons +import qs.Commons as Commons import "../../components" as Mail // A press on a row survives the list being told its messages again. @@ -33,10 +34,10 @@ Item { id: list width: parent.width service: fakeService - textColor: Color.foreground - accentColor: Color.accent - dimColor: Color.foreground - urgentColor: Color.accent + textColor: Commons.Color.foreground + accentColor: Commons.Color.accent + dimColor: Commons.Color.foreground + urgentColor: Commons.Color.accent panelFontFamily: "monospace" property var activated: [] onMessageActivated: function(id) { activated.push(id) } diff --git a/ui/tests/qml/tst_notification_open.qml b/ui/tests/qml/tst_notification_open.qml index 41163b4..9a20efc 100644 --- a/ui/tests/qml/tst_notification_open.qml +++ b/ui/tests/qml/tst_notification_open.qml @@ -2,6 +2,7 @@ import QtQuick import QtTest import Quickshell import qs.Commons +import qs.Commons as Commons import "../.." as Omamail import "../../account" as Account import "BackendFixture.js" as BackendFixture @@ -126,18 +127,18 @@ Item { function test_new_notifications_follow_theme_without_bar_foreground() { var account = service.findAccount(second) var firstNotice = notification(account, [{ id: "one" }]) - compare(firstNotice.command[2], String(Color.foreground)) - compare(firstNotice.command[3], String(Color.accent)) - var previous = Color.foreground + compare(firstNotice.command[2], String(Commons.Color.foreground)) + compare(firstNotice.command[3], String(Commons.Color.accent)) + var previous = Commons.Color.foreground try { - Color.foreground = Qt.rgba(0.1, 0.2, 0.3, 1) + Commons.Color.foreground = Qt.rgba(0.1, 0.2, 0.3, 1) var nextNotice = notification(account, [{ id: "two" }]) - compare(nextNotice.command[2], String(Color.foreground)) + compare(nextNotice.command[2], String(Commons.Color.foreground)) verify(firstNotice.command[2] !== nextNotice.command[2]) finish(firstNotice, "") finish(nextNotice, "") } finally { - Color.foreground = previous + Commons.Color.foreground = previous } } diff --git a/ui/tests/qml/tst_setup_name_field.qml b/ui/tests/qml/tst_setup_name_field.qml index a502132..0278cdc 100644 --- a/ui/tests/qml/tst_setup_name_field.qml +++ b/ui/tests/qml/tst_setup_name_field.qml @@ -1,6 +1,7 @@ import QtQuick 2.15 import QtTest 1.3 import qs.Commons +import qs.Commons as Commons import "../../components" as Mail import "../.." as Omamail import "../../account/Accounts.js" as Accounts @@ -69,10 +70,10 @@ Item { id: gmailPage width: 600 service: gmailService - textColor: Color.foreground - dimColor: Color.foreground - dangerColor: Color.accent - accentColor: Color.accent + textColor: Commons.Color.foreground + dimColor: Commons.Color.foreground + dangerColor: Commons.Color.accent + accentColor: Commons.Color.accent panelFontFamily: "monospace" } @@ -91,10 +92,10 @@ Item { id: page width: 600 service: fakeService - textColor: Color.foreground - dimColor: Color.foreground - dangerColor: Color.accent - accentColor: Color.accent + textColor: Commons.Color.foreground + dimColor: Commons.Color.foreground + dangerColor: Commons.Color.accent + accentColor: Commons.Color.accent panelFontFamily: "monospace" } diff --git a/ui/tests/qml/tst_sidebar_fold.qml b/ui/tests/qml/tst_sidebar_fold.qml index 2189d80..3312f90 100644 --- a/ui/tests/qml/tst_sidebar_fold.qml +++ b/ui/tests/qml/tst_sidebar_fold.qml @@ -1,6 +1,7 @@ import QtQuick 2.15 import QtTest 1.3 import qs.Commons +import qs.Commons as Commons import "../../components" as Mail // The chevron folds; it does not also open. Two tap handlers sit one inside @@ -25,9 +26,9 @@ Item { width: 220 height: 600 service: fake - textColor: Color.foreground - accentColor: Color.accent - dimColor: Color.foreground + textColor: Commons.Color.foreground + accentColor: Commons.Color.accent + dimColor: Commons.Color.foreground panelFontFamily: "monospace" slots: [{ kind: "mailbox", key: "inbox" }] } @@ -101,7 +102,7 @@ Item { verify(chip.y < chip.parent.height / 4, "hint stays at the top") verify(chip.height < chip.parent.height / 2, "hint is smaller than the row icon") verify(named(sidebar, "mailbox-entry-icon", [])[0].visible, "modifier preserves mailbox icon") - verify(chip.color.a < Style.selectedFillFor(Color.foreground, Color.accent).a, + verify(chip.color.a < Style.selectedFillFor(Commons.Color.foreground, Commons.Color.accent).a, "a shortcut hint must not use the much heavier selected-state fill") } }