[vlc-commits] qml: fix focus background not visible in TextToolButton

Pierre Lamot git at videolan.org
Thu Feb 13 11:09:45 CET 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Tue Feb  4 13:33:22 2020 +0100| [6aab5b2f24adbd6035dfb21233f11559abd6e2dc] | committer: Jean-Baptiste Kempf

qml: fix focus background not visible in TextToolButton

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6aab5b2f24adbd6035dfb21233f11559abd6e2dc
---

 modules/gui/qt/widgets/qml/TextToolButton.qml | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/widgets/qml/TextToolButton.qml b/modules/gui/qt/widgets/qml/TextToolButton.qml
index 716f076685..e85355e2c0 100644
--- a/modules/gui/qt/widgets/qml/TextToolButton.qml
+++ b/modules/gui/qt/widgets/qml/TextToolButton.qml
@@ -17,14 +17,20 @@
  *****************************************************************************/
 import QtQuick 2.11
 import QtQuick.Controls 2.4
+import QtQuick.Templates 2.4 as T
 
 import "qrc:///style/"
 
-ToolButton {
+T.ToolButton {
     id: control
 
     font.pixelSize: VLCStyle.fontSize_normal
 
+    implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding
+    implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding
+
+    padding: VLCStyle.margin_xxsmall
+
     contentItem: Label {
         text: control.text
         font: control.font
@@ -51,5 +57,6 @@ ToolButton {
     }
 
     background: FocusBackground {
+        active: (control.activeFocus || control.hovered)
     }
 }



More information about the vlc-commits mailing list