-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBarWidget.qml
More file actions
52 lines (45 loc) · 1.23 KB
/
Copy pathBarWidget.qml
File metadata and controls
52 lines (45 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Ui
BarWidget {
id: root
moduleName: "io.github.monomyth.meshpeek"
readonly property bool showIcon: setting("showIcon", false) === true
readonly property string upAxis: String(setting("upAxis", "+Z"))
readonly property string watchDirs: String(setting("watchDirs", ""))
readonly property string pluginDir: {
var url = Qt.resolvedUrl(".")
return url.toString().replace(/^file:\/\//, "").replace(/\/$/, "")
}
readonly property string openScript: pluginDir + "/scripts/open.sh"
implicitWidth: showIcon ? button.implicitWidth : 0
implicitHeight: showIcon ? button.implicitHeight : 0
visible: showIcon
function launch() {
runner.command = [
"env",
"MODELVIEW_UP=" + upAxis,
"MODELVIEW_WATCH_DIRS=" + watchDirs,
"bash", openScript, "view"
]
runner.running = true
}
Process {
id: runner
running: false
}
BarIconButton {
id: button
anchors.fill: parent
bar: root.bar
visible: root.showIcon
text: ""
slotSize: Style.bar.statusSlot
tooltipText: "Mesh Peek — Files selection, or newest + confirm"
onPressed: function(mouseButton) {
root.launch()
}
}
}