Skip to content

Commit a02acfd

Browse files
authored
Merge pull request #736 from h2bagel/screen-toolkit-control-center-widget
2 parents cad358c + 74a47d0 commit a02acfd

2 files changed

Lines changed: 12 additions & 33 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
}

screen-toolkit/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "screen-toolkit",
33
"name": "Screen Toolkit",
4-
"version": "1.1.3",
4+
"version": "1.1.4",
55
"minNoctaliaVersion": "4.5.0",
66
"author": "ycf-anon",
77
"license": "MIT",

0 commit comments

Comments
 (0)