Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions dcc-network/qml/PageDetails.qml
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,42 @@ DccObject {
text: dccObj.displayName
elide: Text.ElideMiddle
}
D.IconLabel {
D.ActionButton {
property bool clipboard: false
Layout.alignment: Qt.AlignRight
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.preferredWidth: 30
Layout.preferredHeight: 30
icon {
name: "copy"
palette: D.DTK.makeIconPalette(palette)
width: 16
height: 16
}
D.ToolTip {
id: tip
palette: parent.palette
}
MouseArea {
hoverEnabled: true
background: Rectangle {
anchors.fill: parent
acceptedButtons: Qt.LeftButton
onClicked: {
let text = [infoItem.name]
for (let i in infoItem.details) {
text.push(infoItem.details[i][0] + "\t" + infoItem.details[i][1])
}
dccData.setClipboard(text.join("\n"))
tip.show(qsTr("Details has been copied"), 2000)
property D.Palette pressedColor: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.2)
normalDark: Qt.rgba(1, 1, 1, 0.25)
}
property D.Palette hoveredColor: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.1)
normalDark: Qt.rgba(1, 1, 1, 0.1)
}
radius: 6
color: parent.pressed ? D.ColorSelector.pressedColor : (parent.hovered ? D.ColorSelector.hoveredColor : "transparent")
Comment on lines +80 to +89

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Rectangle color binding ignores the local pressed/hovered palettes and may use the wrong type/value.

pressedColor and hoveredColor are declared as D.Palette, but the color binding uses D.ColorSelector.pressedColor/hoveredColor instead, leaving the local palettes unused and risking a type mismatch if D.ColorSelector.* isn’t a plain color. Bind color to the local palettes instead, e.g. color: parent.pressed ? pressedColor.normal : parent.hovered ? hoveredColor.normal : "transparent", or whichever variant matches your theme API.

}
focusPolicy: Qt.StrongFocus
onClicked: {
let text = [infoItem.name]
for (let i in infoItem.details) {
text.push(infoItem.details[i][0] + "\t" + infoItem.details[i][1])
}
dccData.setClipboard(text.join("\n"))
tip.show(qsTr("Details has been copied"), 2000)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (typo): Tooltip text is slightly ungrammatical and might be clearer as plural.

Minor wording nit: consider changing qsTr("Details has been copied") to something like qsTr("Details have been copied") or qsTr("Details copied to clipboard") for more natural, grammatical text.

Suggested change
tip.show(qsTr("Details has been copied"), 2000)
tip.show(qsTr("Details copied to clipboard"), 2000)

}
}
}
Expand All @@ -107,6 +121,7 @@ DccObject {
delegate: ItemDelegate {
implicitHeight: 36
text: modelData[0]
font: D.DTK.fontManager.t6
checked: false
backgroundVisible: true
corners: getCornersForBackground(index, repeater.count)
Expand All @@ -118,6 +133,7 @@ DccObject {
id: textInput
text: modelData[1]
color: palette.text
font: D.DTK.fontManager.t7
selectedTextColor: palette.highlightedText
selectionColor: palette.highlight
readOnly: true
Expand Down
Binary file modified net-view/window/qrc/built-in-icons/copy.dci
100644 → 100755
Binary file not shown.
Loading