[vlc-commits] qml: introduce CaptionLabel

jagannatharjun git at videolan.org
Wed Jun 3 12:07:05 CEST 2020


vlc | branch: master | jagannatharjun <guptaprince8832 at gmail.com> | Mon May 18 11:01:41 2020 +0530| [b9c45409cb16a06b431daa0a0c9263ae419badd0] | committer: Pierre Lamot

qml: introduce CaptionLabel

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

 modules/gui/qt/Makefile.am                  |  1 +
 modules/gui/qt/style/VLCColors.qml          |  2 ++
 modules/gui/qt/vlc.qrc                      |  1 +
 modules/gui/qt/widgets/qml/CaptionLabel.qml | 26 ++++++++++++++++++++++++++
 4 files changed, 30 insertions(+)

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index 88b71246b0..27ded2a21f 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -646,6 +646,7 @@ libqt_plugin_la_QML = \
 	gui/qt/util/qml/KeyHelper.js \
 	gui/qt/util/qml/SelectableDelegateModel.qml \
 	gui/qt/widgets/qml/BusyIndicatorExt.qml \
+	gui/qt/widgets/qml/CaptionLabel.qml \
 	gui/qt/widgets/qml/ComboBoxExt.qml \
 	gui/qt/widgets/qml/ContextButton.qml \
 	gui/qt/widgets/qml/DNDLabel.qml \
diff --git a/modules/gui/qt/style/VLCColors.qml b/modules/gui/qt/style/VLCColors.qml
index 714d323530..d6cf356a5c 100644
--- a/modules/gui/qt/style/VLCColors.qml
+++ b/modules/gui/qt/style/VLCColors.qml
@@ -48,6 +48,8 @@ Item {
     property color textInactive: systemPalette.textInactive;
     property color textDisabled: systemPalette.textDisabled;
 
+    property color caption: setColorAlpha(text, .4)
+
     property color bg: systemPalette.base;
     property color bgInactive: systemPalette.baseInactive;
 
diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc
index 08b8d403da..e77665e892 100644
--- a/modules/gui/qt/vlc.qrc
+++ b/modules/gui/qt/vlc.qrc
@@ -209,6 +209,7 @@
         <file alias="NavigableRow.qml">widgets/qml/NavigableRow.qml</file>
         <file alias="TabButtonExt.qml">widgets/qml/TabButtonExt.qml</file>
         <file alias="ScrollingText.qml">widgets/qml/ScrollingText.qml</file>
+        <file alias="CaptionLabel.qml">widgets/qml/CaptionLabel.qml</file>
     </qresource>
     <qresource prefix="/util">
         <file alias="SelectableDelegateModel.qml">util/qml/SelectableDelegateModel.qml</file>
diff --git a/modules/gui/qt/widgets/qml/CaptionLabel.qml b/modules/gui/qt/widgets/qml/CaptionLabel.qml
new file mode 100644
index 0000000000..a4fe7b6509
--- /dev/null
+++ b/modules/gui/qt/widgets/qml/CaptionLabel.qml
@@ -0,0 +1,26 @@
+/*****************************************************************************
+ * Copyright (C) 2020 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+import QtQuick 2.11
+import QtQuick.Controls 2.4
+import "qrc:///style/"
+
+Label {
+    elide: Text.ElideRight
+    font.pixelSize: VLCStyle.fontSize_normal
+    color: VLCStyle.colors.caption
+}



More information about the vlc-commits mailing list