aboutsummaryrefslogtreecommitdiff
path: root/quickshell/IconButton.qml
diff options
context:
space:
mode:
Diffstat (limited to 'quickshell/IconButton.qml')
-rw-r--r--quickshell/IconButton.qml41
1 files changed, 41 insertions, 0 deletions
diff --git a/quickshell/IconButton.qml b/quickshell/IconButton.qml
new file mode 100644
index 0000000..96c4c7f
--- /dev/null
+++ b/quickshell/IconButton.qml
@@ -0,0 +1,41 @@
+import QtQuick
+
+MouseArea {
+ id: iconButton
+
+ property string icon: ""
+ property string tooltip: ""
+
+ width: 32
+ height: 32
+
+ hoverEnabled: true
+ cursorShape: Qt.PointingHandCursor
+ enabled: true
+ z: 10
+
+ Rectangle {
+ anchors.fill: parent
+ color: "transparent"
+ radius: 6
+
+ Behavior on color {
+ ColorAnimation { duration: 200 }
+ }
+
+ Text {
+ id: iconText
+ anchors.centerIn: parent
+ text: iconButton.icon
+ font.family: shellRoot.fontFamily
+ font.pixelSize: 22
+ color: shellRoot.white
+
+ Component.onCompleted: {
+ console.log("IconButton text:", iconButton.icon, "length:", iconButton.icon.length)
+ }
+ }
+ }
+
+
+}