[vlc-commits] qml: position context button outside the row content in KeyNavigableTableView
Prince Gupta
git at videolan.org
Thu Dec 17 14:57:14 UTC 2020
vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Fri Dec 4 19:31:54 2020 +0530| [e96cec48b1893ce9d413f341b8938045fc6f2998] | committer: Pierre Lamot
qml: position context button outside the row content in KeyNavigableTableView
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e96cec48b1893ce9d413f341b8938045fc6f2998
---
modules/gui/qt/widgets/qml/KeyNavigableTableView.qml | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml b/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
index 0a5a5129b9..6cdd5cfe39 100644
--- a/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
+++ b/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
@@ -69,8 +69,10 @@ NavigableFocusScope {
property var selectionDelegateModel
property real rowHeight: VLCStyle.tableRow_height
+ readonly property int _contextButtonHorizontalSpace: VLCStyle.icon_normal + VLCStyle.margin_xxsmall * 2
readonly property real availableRowWidth: width
- ( !!section.property ? VLCStyle.table_section_width * 2 : 0 )
+ - _contextButtonHorizontalSpace
property alias spacing: view.spacing
property int horizontalSpacing: VLCStyle.column_margin_width
@@ -140,6 +142,7 @@ NavigableFocusScope {
leftMargin: VLCStyle.margin_xxxsmall
rightMargin: VLCStyle.margin_xxxsmall
horizontalCenter: parent.horizontalCenter
+ horizontalCenterOffset: - root._contextButtonHorizontalSpace / 2
}
height: implicitHeight
topPadding: root.headerTopPadding
@@ -264,6 +267,7 @@ NavigableFocusScope {
leftMargin: VLCStyle.margin_xxxsmall
rightMargin: VLCStyle.margin_xxxsmall
horizontalCenter: parent.horizontalCenter
+ horizontalCenterOffset: - root._contextButtonHorizontalSpace / 2
top: parent.top
bottom: parent.bottom
}
@@ -299,9 +303,9 @@ NavigableFocusScope {
}
Widgets.ContextButton {
- anchors.right: content.right
- anchors.top: content.top
- anchors.bottom: content.bottom
+ anchors.left: content.right
+ anchors.leftMargin: VLCStyle.margin_xxsmall
+ anchors.verticalCenter: content.verticalCenter
backgroundColor: hovered || activeFocus ?
VLCStyle.colors.getBgColor( lineView.selected, hovered,
activeFocus ) : "transparent"
More information about the vlc-commits
mailing list