Initial commit
This commit is contained in:
commit
a8c2f88654
53 changed files with 9269 additions and 0 deletions
66
Widgets/Sidebar/Button.qml
Normal file
66
Widgets/Sidebar/Button.qml
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Settings
|
||||
import qs.Widgets.Sidebar.Panel
|
||||
|
||||
Item {
|
||||
id: buttonRoot
|
||||
property Item barBackground
|
||||
property var screen
|
||||
width: iconText.implicitWidth + 0
|
||||
height: iconText.implicitHeight + 0
|
||||
|
||||
property color hoverColor: Theme.rippleEffect
|
||||
property real hoverOpacity: 0.0
|
||||
property bool isActive: mouseArea.containsMouse || (sidebarPopup && sidebarPopup.visible)
|
||||
|
||||
property var sidebarPopup
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
if (sidebarPopup.visible) {
|
||||
// Close all modals if open
|
||||
if (sidebarPopup.settingsModal && sidebarPopup.settingsModal.visible) {
|
||||
sidebarPopup.settingsModal.visible = false;
|
||||
}
|
||||
if (sidebarPopup.wallpaperManagerModal && sidebarPopup.wallpaperManagerModal.visible) {
|
||||
sidebarPopup.wallpaperManagerModal.visible = false;
|
||||
}
|
||||
sidebarPopup.hidePopup();
|
||||
} else {
|
||||
sidebarPopup.showAt();
|
||||
}
|
||||
}
|
||||
onEntered: buttonRoot.hoverOpacity = 0.18
|
||||
onExited: buttonRoot.hoverOpacity = 0.0
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: hoverColor
|
||||
opacity: isActive ? 0.18 : hoverOpacity
|
||||
radius: height / 2
|
||||
z: 0
|
||||
visible: (isActive ? 0.18 : hoverOpacity) > 0.01
|
||||
}
|
||||
|
||||
Text {
|
||||
id: iconText
|
||||
text: "dashboard"
|
||||
font.family: isActive ? "Material Symbols Rounded" : "Material Symbols Outlined"
|
||||
font.pixelSize: 16
|
||||
color: sidebarPopup.visible ? Theme.accentPrimary : Theme.textPrimary
|
||||
anchors.centerIn: parent
|
||||
z: 1
|
||||
}
|
||||
|
||||
Behavior on hoverOpacity {
|
||||
NumberAnimation {
|
||||
duration: 120
|
||||
easing.type: Easing.OutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue