Port the AGS widgets into the shell as plugins
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import QtQuick
|
||||
import qs.Commons
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
property string icon: ""
|
||||
property bool active: false
|
||||
signal activated()
|
||||
|
||||
implicitWidth: Style.spaceReal(26)
|
||||
implicitHeight: Style.spaceReal(24)
|
||||
radius: Style.cardRadius
|
||||
color: root.active
|
||||
? Color.accent
|
||||
: (hover.hovered ? Util.alpha(Color.blue, 0.25) : "transparent")
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: root.icon
|
||||
textFormat: Text.PlainText
|
||||
color: root.active ? Color.background : (hover.hovered ? Color.blue : Color.magenta)
|
||||
font.family: Style.font.family
|
||||
font.pixelSize: Style.font.bodySmall
|
||||
}
|
||||
|
||||
HoverHandler {
|
||||
id: hover
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
onTapped: root.activated()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user