-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCopyBox.qml
More file actions
58 lines (51 loc) · 1.49 KB
/
Copy pathCopyBox.qml
File metadata and controls
58 lines (51 loc) · 1.49 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
53
54
55
56
57
58
import QtQuick
import qs.Common
import qs.Widgets
import qs.Services
Column {
id: root
width: parent.width
spacing: 4
property string label: ""
property string text: ""
StyledText {
width: parent.width
text: root.label
font.pixelSize: Theme.fontSizeSmall
font.bold: true
color: Theme.surfaceVariantText
visible: text !== ""
}
Rectangle {
width: parent.width
height: Math.max(40, cmdRow.implicitHeight + 16)
color: Theme.surfaceContainer
radius: 4
Row {
id: cmdRow
width: Math.max(0, parent.width - 16)
anchors.centerIn: parent
spacing: 8
StyledText {
width: Math.max(0, parent.width - 32)
text: root.text
font.family: "Monospace"
font.pixelSize: Theme.fontSizeSmall
color: Theme.secondary
wrapMode: Text.Wrap
}
DankButton {
width: 24; height: 24
iconName: "content_copy"
backgroundColor: "transparent"
textColor: Theme.primary
anchors.verticalCenter: parent.verticalCenter
onClicked: {
Proc.runCommand("copy-ipc", ["wl-copy", "--", root.text], function() {
ToastService.showInfo("Copied to clipboard");
});
}
}
}
}
}