[vlc-devel] [PATCH 15/30] qml: position context button outside the row content in KeyNavigableTableView

Prince Gupta guptaprince8832 at gmail.com
Mon Dec 14 14:27:53 CET 2020


---
 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 c9cd24338a..58dc2d287f 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
 
@@ -139,6 +141,7 @@ NavigableFocusScope {
                         leftMargin: VLCStyle.margin_xxxsmall
                         rightMargin: VLCStyle.margin_xxxsmall
                         horizontalCenter: parent.horizontalCenter
+                        horizontalCenterOffset: - root._contextButtonHorizontalSpace / 2
                     }
                     height: implicitHeight
                     topPadding: root.headerTopPadding
@@ -240,6 +243,7 @@ NavigableFocusScope {
                         leftMargin: VLCStyle.margin_xxxsmall
                         rightMargin: VLCStyle.margin_xxxsmall
                         horizontalCenter: parent.horizontalCenter
+                        horizontalCenterOffset: - root._contextButtonHorizontalSpace / 2
                         top: parent.top
                         bottom: parent.bottom
                     }
@@ -275,9 +279,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"
-- 
2.25.1



More information about the vlc-devel mailing list