port new components to greeter
This commit is contained in:
@@ -59,15 +59,15 @@ ColumnLayout {
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
root.toggleRequested();
|
||||
root.expanded = !root.expanded;
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
color: DynamicColors.palette.m3onSurface
|
||||
radius: Appearance.rounding.normal
|
||||
showHoverBackground: false
|
||||
|
||||
onClicked: {
|
||||
root.toggleRequested();
|
||||
root.expanded = !root.expanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,10 +23,10 @@ Button {
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
radius: control.radius
|
||||
|
||||
onClicked: {
|
||||
control.clicked();
|
||||
}
|
||||
|
||||
radius: control.radius
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,13 +33,13 @@ RadioButton {
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
root.click();
|
||||
}
|
||||
|
||||
anchors.margins: -7
|
||||
color: root.checked ? DynamicColors.palette.m3onSurface : DynamicColors.palette.m3primary
|
||||
z: -1
|
||||
|
||||
onClicked: {
|
||||
root.click();
|
||||
}
|
||||
}
|
||||
|
||||
CustomRect {
|
||||
|
||||
@@ -94,7 +94,9 @@ RowLayout {
|
||||
StateLayer {
|
||||
id: upState
|
||||
|
||||
function onClicked(): void {
|
||||
color: DynamicColors.palette.m3onPrimary
|
||||
|
||||
onClicked: {
|
||||
let newValue = Math.min(root.max, root.value + root.step);
|
||||
// Round to avoid floating point precision errors
|
||||
const decimals = root.step < 1 ? Math.max(1, Math.ceil(-Math.log10(root.step))) : 0;
|
||||
@@ -103,9 +105,6 @@ RowLayout {
|
||||
root.displayText = newValue.toString();
|
||||
root.valueModified(newValue);
|
||||
}
|
||||
|
||||
color: DynamicColors.palette.m3onPrimary
|
||||
|
||||
onPressAndHold: timer.start()
|
||||
onReleased: timer.stop()
|
||||
}
|
||||
@@ -128,7 +127,9 @@ RowLayout {
|
||||
StateLayer {
|
||||
id: downState
|
||||
|
||||
function onClicked(): void {
|
||||
color: DynamicColors.palette.m3onPrimary
|
||||
|
||||
onClicked: {
|
||||
let newValue = Math.max(root.min, root.value - root.step);
|
||||
// Round to avoid floating point precision errors
|
||||
const decimals = root.step < 1 ? Math.max(1, Math.ceil(-Math.log10(root.step))) : 0;
|
||||
@@ -137,9 +138,6 @@ RowLayout {
|
||||
root.displayText = newValue.toString();
|
||||
root.valueModified(newValue);
|
||||
}
|
||||
|
||||
color: DynamicColors.palette.m3onPrimary
|
||||
|
||||
onPressAndHold: timer.start()
|
||||
onReleased: timer.stop()
|
||||
}
|
||||
|
||||
@@ -54,14 +54,14 @@ CustomRect {
|
||||
StateLayer {
|
||||
id: stateLayer
|
||||
|
||||
function onClicked(): void {
|
||||
color: root.internalChecked ? root.activeOnColour : root.inactiveOnColour
|
||||
disabled: root.disabled
|
||||
|
||||
onClicked: {
|
||||
if (root.toggle)
|
||||
root.internalChecked = !root.internalChecked;
|
||||
root.clicked();
|
||||
}
|
||||
|
||||
color: root.internalChecked ? root.activeOnColour : root.inactiveOnColour
|
||||
disabled: root.disabled
|
||||
}
|
||||
|
||||
MaterialIcon {
|
||||
|
||||
Reference in New Issue
Block a user