mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
9cb6613308
N*Widgets: show NSettingsIndicator if settings are not default
49 lines
958 B
QML
49 lines
958 B
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import qs.Commons
|
|
import qs.Services.UI
|
|
|
|
Rectangle {
|
|
id: root
|
|
|
|
property bool show: false
|
|
property string tooltipText: ""
|
|
|
|
implicitWidth: root.show ? 6 * Style.uiScaleRatio : 0
|
|
implicitHeight: root.show ? 6 * Style.uiScaleRatio : 0
|
|
width: root.show ? 6 * Style.uiScaleRatio : 0
|
|
height: root.show ? 6 * Style.uiScaleRatio : 0
|
|
radius: width / 2
|
|
color: Color.mOnSurfaceVariant
|
|
opacity: 0.6
|
|
|
|
visible: root.show
|
|
|
|
Behavior on opacity {
|
|
NumberAnimation {
|
|
duration: Style.animationFast
|
|
}
|
|
}
|
|
|
|
MouseArea {
|
|
enabled: root.show && root.tooltipText !== ""
|
|
anchors.fill: parent
|
|
hoverEnabled: true
|
|
acceptedButtons: Qt.NoButton
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onEntered: {
|
|
if (root.tooltipText) {
|
|
TooltipService.show(root, root.tooltipText);
|
|
}
|
|
}
|
|
|
|
onExited: {
|
|
if (root.tooltipText) {
|
|
TooltipService.hide();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|