- Refactored TimerPage component to improve layout and user experience. - Updated theme configuration to utilize design tokens for better maintainability. - Introduced new tokens for colors and typography to align with design principles. - Simplified state management and improved timer functionality. - Enhanced accessibility and responsiveness of UI elements.
40 lines
863 B
QML
40 lines
863 B
QML
// Transient messages, bottom centre, on an ink slab.
|
|
import QtQuick
|
|
import QtQuick.Controls
|
|
|
|
import ".."
|
|
|
|
Popup {
|
|
id: snackbar
|
|
property string message: ""
|
|
|
|
function show(text) {
|
|
message = text
|
|
open()
|
|
timer.restart()
|
|
}
|
|
|
|
x: Math.round((parent.width - width) / 2)
|
|
y: parent.height - height - 28
|
|
width: Math.min(parent.width - 48, Math.max(240, label.implicitWidth + 36))
|
|
padding: 14
|
|
modal: false
|
|
focus: false
|
|
closePolicy: Popup.NoAutoClose
|
|
|
|
background: Rectangle {
|
|
color: Theme.ink
|
|
radius: 10
|
|
}
|
|
contentItem: Label {
|
|
id: label
|
|
text: snackbar.message
|
|
color: Theme.paper
|
|
font.pixelSize: 13
|
|
font.family: Theme.sansFamily
|
|
wrapMode: Text.WordWrap
|
|
}
|
|
|
|
Timer { id: timer; interval: 5000; onTriggered: snackbar.close() }
|
|
}
|