diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2025-07-15 23:46:48 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-15 23:46:48 +0900 |
| commit | 71f1bc6920920f2a9337f18ceba6ebc12b276a6f (patch) | |
| tree | 34431efa13460f9e716ed162355fd08c535aedc0 /config/quickshell/modules/common/widgets/DialogButton.qml | |
| parent | 7a3bd4f9fe48aad02ef8b13d3677b3bd8358252c (diff) | |
| parent | 3aadb2106a26988346f34afafe8393b0ba6bdf79 (diff) | |
Merge branch 'development' into fix-slow-brightness
Diffstat (limited to 'config/quickshell/modules/common/widgets/DialogButton.qml')
| -rw-r--r-- | config/quickshell/modules/common/widgets/DialogButton.qml | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/config/quickshell/modules/common/widgets/DialogButton.qml b/config/quickshell/modules/common/widgets/DialogButton.qml new file mode 100644 index 00000000..b799336a --- /dev/null +++ b/config/quickshell/modules/common/widgets/DialogButton.qml @@ -0,0 +1,38 @@ +import "root:/modules/common" +import "root:/modules/common/functions/color_utils.js" as ColorUtils +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Quickshell +import Quickshell.Io + +/** + * Material 3 dialog button. See https://m3.material.io/components/dialogs/overview + */ +RippleButton { + id: button + + property string buttonText + implicitHeight: 30 + implicitWidth: buttonTextWidget.implicitWidth + 15 * 2 + buttonRadius: Appearance?.rounding.full ?? 9999 + + property color colEnabled: Appearance?.colors.colPrimary + property color colDisabled: Appearance?.m3colors.m3borderPrimary + + contentItem: StyledText { + id: buttonTextWidget + anchors.fill: parent + anchors.leftMargin: 15 + anchors.rightMargin: 15 + text: buttonText + horizontalAlignment: Text.AlignHCenter + font.pixelSize: Appearance?.font.pixelSize.textBase ?? 12 + color: button.enabled ? button.colEnabled : button.colDisabled + + Behavior on color { + animation: Appearance.animation.elementMoveFast.colorAnimation.createObject(this) + } + } + +} |
