aboutsummaryrefslogtreecommitdiffstats
path: root/config/quickshell/modules/common/widgets/DialogButton.qml
diff options
context:
space:
mode:
authorJa.KooLit <85185940+JaKooLit@users.noreply.github.com>2025-07-25 21:31:54 +0900
committerGitHub <noreply@github.com>2025-07-25 21:31:54 +0900
commitdd889d3aac40075ee73f76290c69ccc698673817 (patch)
tree67dc1026bc09a93cb5250e1c28adda15c592aff4 /config/quickshell/modules/common/widgets/DialogButton.qml
parent637025eeb60391e5cc17c883aa6ee95799acac76 (diff)
parentaa3c94f1ad44038d6a71ee8e12a704e6089e31f6 (diff)
Merge pull request #775 from JaKooLit/development
Development to main
Diffstat (limited to 'config/quickshell/modules/common/widgets/DialogButton.qml')
-rw-r--r--config/quickshell/modules/common/widgets/DialogButton.qml38
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)
+ }
+ }
+
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage