Skip to content

Commit 9e439ef

Browse files
committed
Update screen toolkit control center widget
Makes the widget use NIconButtonHot instead of Item for consistent styling.
1 parent be878f0 commit 9e439ef

1 file changed

Lines changed: 11 additions & 32 deletions

File tree

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,25 @@
11
import QtQuick
2-
import QtQuick.Layouts
32
import Quickshell
43
import qs.Commons
54
import qs.Widgets
65
import qs.Services.UI
7-
Item {
6+
7+
NIconButtonHot {
88
id: root
9+
910
property var pluginApi: null
1011
property ShellScreen screen
1112
property string widgetId: ""
1213
property string section: ""
14+
1315
readonly property string screenName: screen?.name ?? ""
14-
readonly property real capsuleHeight: Style.getCapsuleHeightForScreen(screenName)
15-
readonly property real contentWidth: capsuleHeight
16-
readonly property real contentHeight: capsuleHeight
17-
implicitWidth: contentWidth
18-
implicitHeight: contentHeight
19-
Rectangle {
20-
id: visualCapsule
21-
x: Style.pixelAlignCenter(parent.width, width)
22-
y: Style.pixelAlignCenter(parent.height, height)
23-
width: root.contentWidth
24-
height: root.contentHeight
25-
color: mouseArea.containsMouse ? Color.mHover : Style.capsuleColor
26-
radius: Style.radiusL
27-
border.color: Style.capsuleBorderColor
28-
border.width: Style.capsuleBorderWidth
29-
NIcon {
30-
anchors.centerIn: parent
31-
icon: "crosshair"
32-
color: Color.mPrimary
33-
}
34-
}
35-
MouseArea {
36-
id: mouseArea
37-
anchors.fill: parent
38-
hoverEnabled: true
39-
cursorShape: Qt.PointingHandCursor
40-
onEntered: TooltipService.show(root, "Screen Toolkit", BarService.getTooltipDirection())
41-
onExited: TooltipService.hide()
42-
onClicked: {
43-
if (pluginApi) pluginApi.togglePanel(root.screen, root)
16+
17+
icon: "crosshair"
18+
tooltipText: "Screen Toolkit"
19+
20+
onClicked: {
21+
if (pluginApi) {
22+
pluginApi.togglePanel(screen, root);
4423
}
4524
}
4625
}

0 commit comments

Comments
 (0)