Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
}

Expand Down
3 changes: 2 additions & 1 deletion app/qml/StandaloneShell.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Dialogs
import qs.Commons
import qs.Commons as Commons

QtObject {
id: root
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/qml/imports/Quickshell/FloatingWindow.qml
Original file line number Diff line number Diff line change
@@ -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
}
9 changes: 5 additions & 4 deletions app/qml/imports/qs/Commons/Style.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pragma Singleton
import QtQuick
import qs.Commons as Commons

QtObject {
id: root
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/qml/imports/qs/Ui/BarIconButton.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Controls as QQC
import qs.Commons
import qs.Commons as Commons

Item {
id: root
Expand All @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion app/qml/imports/qs/Ui/BorderSurface.qml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions app/qml/imports/qs/Ui/Button.qml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 5 additions & 4 deletions app/qml/imports/qs/Ui/Dropdown.qml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import QtQuick
import QtQuick.Controls as QQC
import qs.Commons
import qs.Commons as Commons

Item {
id: root

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
Expand Down
7 changes: 4 additions & 3 deletions app/qml/imports/qs/Ui/NumberField.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Controls as QQC
import qs.Commons
import qs.Commons as Commons

Item {
id: root
Expand All @@ -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)
Expand Down Expand Up @@ -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: {
Expand Down
3 changes: 2 additions & 1 deletion app/qml/imports/qs/Ui/PanelActionButton.qml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/qml/imports/qs/Ui/PanelSectionHeader.qml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions app/qml/imports/qs/Ui/PanelSeparator.qml
Original file line number Diff line number Diff line change
@@ -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)
}
}
5 changes: 3 additions & 2 deletions app/qml/imports/qs/Ui/PanelToolTip.qml
Original file line number Diff line number Diff line change
@@ -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
}
7 changes: 4 additions & 3 deletions app/qml/imports/qs/Ui/TextField.qml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 5 additions & 4 deletions app/qml/imports/qs/Ui/ToggleSwitch.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Controls as QQC
import qs.Commons
import qs.Commons as Commons

Item {
id: root
Expand All @@ -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: {
Expand All @@ -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: {
Expand All @@ -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
}
Expand Down
8 changes: 5 additions & 3 deletions app/qml/styles/Omamail/ComboBox.qml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -46,7 +48,7 @@ T.ComboBox {
}
Connections {
target: control
function onSemanticForegroundChanged() { parent.requestPaint() }
function onSemanticForegroundChanged() { chevron.requestPaint() }
}
}

Expand Down Expand Up @@ -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
}
}
Expand Down
9 changes: 5 additions & 4 deletions app/qml/styles/Omamail/ScrollBar.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Templates as T
import qs.Commons
import qs.Commons as Commons

T.ScrollBar {
id: control
Expand All @@ -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

Expand All @@ -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)
}
}
7 changes: 4 additions & 3 deletions app/qml/styles/Omamail/ToolTip.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Templates as T
import qs.Commons
import qs.Commons as Commons

T.ToolTip {
id: control
Expand Down Expand Up @@ -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
}
}
Loading
Loading