mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-05 06:59:50 -05:00
Initial commit
This commit is contained in:
commit
05cd51b54e
148 changed files with 10112 additions and 0 deletions
52
widgets/IconButton.qml
Normal file
52
widgets/IconButton.qml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
import QtQuick
|
||||
import Quickshell.Widgets
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property string source
|
||||
property var implicitSize: 24
|
||||
property var padding: 0
|
||||
property var radius: 20
|
||||
property var activeRectangle: true
|
||||
property var color: ShellSettings.settings.colors["inverse_surface"]
|
||||
property var activeColor: ShellSettings.settings.colors["inverse_primary"]
|
||||
signal clicked
|
||||
|
||||
implicitWidth: implicitSize
|
||||
implicitHeight: implicitSize
|
||||
|
||||
Rectangle {
|
||||
id: iconBackground
|
||||
color: ShellSettings.settings.colors["primary"]
|
||||
radius: root.radius
|
||||
visible: iconButton.containsMouse && root.activeRectangle
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
// Figure out a way to color images better
|
||||
IconImage {
|
||||
id: iconImage
|
||||
source: root.source
|
||||
visible: true
|
||||
// color: {
|
||||
// if (!activeRectangle)
|
||||
// return root.color;
|
||||
//
|
||||
// return iconButton.containsMouse ? root.activeColor : root.color;
|
||||
// }
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: root.padding
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: iconButton
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onPressed: root.clicked()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue