mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 10:30:44 +02:00
32 lines
582 B
QML
32 lines
582 B
QML
import QtQuick
|
|
import Quickshell
|
|
import QtQuick.Layouts
|
|
import "../"
|
|
|
|
MouseArea {
|
|
id: root
|
|
|
|
implicitWidth: 26
|
|
implicitHeight: 26
|
|
|
|
hoverEnabled: true
|
|
acceptedButtons: Qt.LeftButton
|
|
|
|
Image {
|
|
anchors.fill: parent
|
|
source: `../assets/${Globals.isDarkTheme ? "sun" : "moon"}.png`
|
|
smooth: false
|
|
|
|
scale: root.containsMouse ? 0.9 : 1
|
|
Behavior on scale {
|
|
NumberAnimation {
|
|
duration: 70
|
|
}
|
|
}
|
|
}
|
|
|
|
onPressed: () => {
|
|
Globals.isDarkTheme = !Globals.isDarkTheme;
|
|
}
|
|
}
|