Skip to content

Commit 86ed191

Browse files
authored
Merge pull request #634 from ycf-anon/screen-toolkit
Screen toolkit rework: UI, fixes, and improvements
2 parents d4e1c8e + 302fd03 commit 86ed191

13 files changed

Lines changed: 3380 additions & 2051 deletions

File tree

screen-toolkit/Annotate.qml

Lines changed: 891 additions & 471 deletions
Large diffs are not rendered by default.

screen-toolkit/BarWidget.qml

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,55 @@
11
import QtQuick
22
import Quickshell
3-
import qs.Widgets
43
import qs.Commons
4+
import qs.Widgets
5+
import qs.Modules.Bar.Extras
56
import qs.Services.UI
67

7-
NIconButton {
8+
Item {
89
id: root
910
property ShellScreen screen
1011
property string widgetId: ""
1112
property string section: ""
1213
property int sectionWidgetIndex: -1
1314
property int sectionWidgetsCount: 0
1415
property var pluginApi: null
15-
icon: "crosshair"
16-
tooltipText: pluginApi?.tr("widget.tooltip")
17-
tooltipDirection: BarService.getTooltipDirection(screen?.name)
18-
colorBg: Style.capsuleColor
19-
colorBorder: "transparent"
20-
colorBorderHover: "transparent"
21-
border.color: Style.capsuleBorderColor
22-
border.width: Style.capsuleBorderWidth
23-
onClicked: {
24-
if (pluginApi) pluginApi.togglePanel(screen, this)
16+
17+
implicitWidth: pill.width
18+
implicitHeight: pill.height
19+
20+
BarPill {
21+
id: pill
22+
screen: root.screen
23+
oppositeDirection: BarService.getPillDirection(root)
24+
forceClose: true
25+
26+
icon: "crosshair"
27+
tooltipText: pluginApi?.tr("widget.tooltip")
28+
29+
onClicked: {
30+
if (pluginApi) pluginApi.togglePanel(root.screen, pill)
31+
}
32+
33+
onRightClicked: {
34+
PanelService.showContextMenu(contextMenu, pill, root.screen)
35+
}
36+
}
37+
38+
NPopupContextMenu {
39+
id: contextMenu
40+
model: [
41+
{
42+
"label": pluginApi?.tr("settings.widgetSettings"),
43+
"action": "widget-settings",
44+
"icon": "settings",
45+
"enabled": true
46+
}
47+
]
48+
onTriggered: action => {
49+
contextMenu.close()
50+
PanelService.closeContextMenu(root.screen)
51+
if (action === "widget-settings")
52+
BarService.openPluginSettings(screen, pluginApi.manifest)
53+
}
2554
}
2655
}

0 commit comments

Comments
 (0)