utilities: fix colours

Fix transparency + some button colours
This commit is contained in:
2 * r + 2 * t 2025-09-15 23:09:51 +10:00
parent 9c6520b879
commit debf99a5d9
7 changed files with 19 additions and 15 deletions

View file

@ -28,13 +28,13 @@ StyledRect {
property color inactiveColour: { property color inactiveColour: {
if (!toggle && type === IconButton.Filled) if (!toggle && type === IconButton.Filled)
return Colours.palette.m3primary; return Colours.palette.m3primary;
return type === IconButton.Filled ? Colours.palette.m3surfaceContainer : Colours.palette.m3secondaryContainer; return type === IconButton.Filled ? Colours.tPalette.m3surfaceContainer : Colours.palette.m3secondaryContainer;
} }
property color activeOnColour: type === IconButton.Filled ? Colours.palette.m3onPrimary : Colours.palette.m3onSecondary property color activeOnColour: type === IconButton.Filled ? Colours.palette.m3onPrimary : type === IconButton.Tonal ? Colours.palette.m3onSecondary : Colours.palette.m3primary
property color inactiveOnColour: { property color inactiveOnColour: {
if (!toggle && type === IconButton.Filled) if (!toggle && type === IconButton.Filled)
return Colours.palette.m3onPrimary; return Colours.palette.m3onPrimary;
return type === IconButton.Filled ? Colours.palette.m3onSurfaceVariant : Colours.palette.m3onSecondaryContainer; return type === IconButton.Tonal ? Colours.palette.m3onSecondaryContainer : Colours.palette.m3onSurfaceVariant;
} }
signal clicked signal clicked

View file

@ -27,7 +27,7 @@ StyledRect {
property bool internalChecked property bool internalChecked
property color activeColour: type === IconTextButton.Filled ? Colours.palette.m3primary : Colours.palette.m3secondary property color activeColour: type === IconTextButton.Filled ? Colours.palette.m3primary : Colours.palette.m3secondary
property color inactiveColour: type === IconTextButton.Filled ? Colours.palette.m3surfaceContainer : Colours.palette.m3secondaryContainer property color inactiveColour: type === IconTextButton.Filled ? Colours.tPalette.m3surfaceContainer : Colours.palette.m3secondaryContainer
property color activeOnColour: type === IconTextButton.Filled ? Colours.palette.m3onPrimary : Colours.palette.m3onSecondary property color activeOnColour: type === IconTextButton.Filled ? Colours.palette.m3onPrimary : Colours.palette.m3onSecondary
property color inactiveOnColour: type === IconTextButton.Filled ? Colours.palette.m3onSurface : Colours.palette.m3onSecondaryContainer property color inactiveOnColour: type === IconTextButton.Filled ? Colours.palette.m3onSurface : Colours.palette.m3onSecondaryContainer

View file

@ -25,9 +25,17 @@ StyledRect {
property bool internalChecked property bool internalChecked
property color activeColour: type === TextButton.Filled ? Colours.palette.m3primary : Colours.palette.m3secondary property color activeColour: type === TextButton.Filled ? Colours.palette.m3primary : Colours.palette.m3secondary
property color inactiveColour: type === TextButton.Filled ? Colours.palette.m3surfaceContainer : Colours.palette.m3secondaryContainer property color inactiveColour: type === TextButton.Filled ? Colours.tPalette.m3surfaceContainer : Colours.palette.m3secondaryContainer
property color activeOnColour: type === TextButton.Filled ? Colours.palette.m3onPrimary : Colours.palette.m3onSecondary property color activeOnColour: {
property color inactiveOnColour: type === TextButton.Filled ? Colours.palette.m3onSurface : Colours.palette.m3onSecondaryContainer if (type === TextButton.Text)
return Colours.palette.m3primary;
return type === TextButton.Filled ? Colours.palette.m3onPrimary : Colours.palette.m3onSecondary;
}
property color inactiveOnColour: {
if (type === TextButton.Text)
return Colours.palette.m3primary;
return type === TextButton.Filled ? Colours.palette.m3onSurface : Colours.palette.m3onSecondaryContainer;
}
signal clicked signal clicked

View file

@ -179,16 +179,12 @@ Loader {
TextButton { TextButton {
text: qsTr("Cancel") text: qsTr("Cancel")
type: TextButton.Text type: TextButton.Text
label.color: Colours.palette.m3primary
stateLayer.color: Colours.palette.m3primary
onClicked: root.props.recordingConfirmDelete = "" onClicked: root.props.recordingConfirmDelete = ""
} }
TextButton { TextButton {
text: qsTr("Delete") text: qsTr("Delete")
type: TextButton.Text type: TextButton.Text
label.color: Colours.palette.m3primary
stateLayer.color: Colours.palette.m3primary
onClicked: { onClicked: {
CUtils.deleteFile(Qt.resolvedUrl(root.props.recordingConfirmDelete)); CUtils.deleteFile(Qt.resolvedUrl(root.props.recordingConfirmDelete));
root.props.recordingConfirmDelete = ""; root.props.recordingConfirmDelete = "";

View file

@ -12,7 +12,7 @@ StyledRect {
implicitHeight: layout.implicitHeight + (IdleInhibitor.enabled ? activeChip.implicitHeight + activeChip.anchors.topMargin : 0) + Appearance.padding.large * 2 implicitHeight: layout.implicitHeight + (IdleInhibitor.enabled ? activeChip.implicitHeight + activeChip.anchors.topMargin : 0) + Appearance.padding.large * 2
radius: Appearance.rounding.normal radius: Appearance.rounding.normal
color: Colours.palette.m3surfaceContainer color: Colours.tPalette.m3surfaceContainer
clip: true clip: true
RowLayout { RowLayout {

View file

@ -17,7 +17,7 @@ StyledRect {
implicitHeight: layout.implicitHeight + layout.anchors.margins * 2 implicitHeight: layout.implicitHeight + layout.anchors.margins * 2
radius: Appearance.rounding.normal radius: Appearance.rounding.normal
color: Colours.palette.m3surfaceContainer color: Colours.tPalette.m3surfaceContainer
ColumnLayout { ColumnLayout {
id: layout id: layout

View file

@ -17,7 +17,7 @@ StyledRect {
implicitHeight: layout.implicitHeight + Appearance.padding.large * 2 implicitHeight: layout.implicitHeight + Appearance.padding.large * 2
radius: Appearance.rounding.normal radius: Appearance.rounding.normal
color: Colours.palette.m3surfaceContainer color: Colours.tPalette.m3surfaceContainer
ColumnLayout { ColumnLayout {
id: layout id: layout
@ -85,7 +85,7 @@ StyledRect {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredWidth: implicitWidth + (stateLayer.pressed ? Appearance.padding.large : internalChecked ? Appearance.padding.smaller : 0) Layout.preferredWidth: implicitWidth + (stateLayer.pressed ? Appearance.padding.large : internalChecked ? Appearance.padding.smaller : 0)
radius: stateLayer.pressed ? Appearance.rounding.small / 2 : internalChecked ? Appearance.rounding.small : Appearance.rounding.normal radius: stateLayer.pressed ? Appearance.rounding.small / 2 : internalChecked ? Appearance.rounding.small : Appearance.rounding.normal
inactiveColour: Colours.palette.m3surfaceContainerHighest inactiveColour: Colours.layer(Colours.palette.m3surfaceContainerHighest, 2)
toggle: true toggle: true
radiusAnim.duration: Appearance.anim.durations.expressiveFastSpatial radiusAnim.duration: Appearance.anim.durations.expressiveFastSpatial
radiusAnim.easing.bezierCurve: Appearance.anim.curves.expressiveFastSpatial radiusAnim.easing.bezierCurve: Appearance.anim.curves.expressiveFastSpatial