[vlc-commits] qml: add LabelSeparator and RoundButton

Abel Tesfaye git at videolan.org
Tue Jul 30 17:57:13 CEST 2019


vlc | branch: master | Abel Tesfaye <Abeltesfaye45 at gmail.com> | Thu Jul 18 14:40:48 2019 +0300| [0499cb1a17ec1d31239e3ee6635ded6c2d4c1647] | committer: Jean-Baptiste Kempf

qml: add LabelSeparator and RoundButton

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

 modules/gui/qt/Makefile.am                  |  2 +
 modules/gui/qt/qml/style/VLCStyle.qml       |  2 +
 modules/gui/qt/qml/utils/LabelSeparator.qml | 61 +++++++++++++++++++++++++++++
 modules/gui/qt/qml/utils/RoundButton.qml    | 42 ++++++++++++++++++++
 modules/gui/qt/vlc.qrc                      |  2 +
 5 files changed, 109 insertions(+)

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index c57914da16..7391cebec1 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -577,6 +577,8 @@ libqt_plugin_la_QML = \
 	gui/qt/qml/utils/SpinBoxExt.qml \
 	gui/qt/qml/utils/StackViewExt.qml \
 	gui/qt/qml/utils/ScanProgressBar.qml \
+	gui/qt/qml/utils/LabelSeparator.qml \
+	gui/qt/qml/utils/RoundButton.qml \
         gui/qt/qml/utils/SearchBox.qml \
         gui/qt/qml/utils/SortControl.qml \
 	gui/qt/qml/menus/CheckableModelSubMenu.qml \
diff --git a/modules/gui/qt/qml/style/VLCStyle.qml b/modules/gui/qt/qml/style/VLCStyle.qml
index b947dd26f8..144d401470 100644
--- a/modules/gui/qt/qml/style/VLCStyle.qml
+++ b/modules/gui/qt/qml/style/VLCStyle.qml
@@ -82,6 +82,8 @@ Item {
     property int cover_large: 160 * scale;
     property int cover_xlarge: 192 * scale;
 
+    property int heightBar_xxxsmall: 2 * scale;
+    property int heightBar_xxsmall: 4 * scale;
     property int heightBar_xsmall: 8 * scale;
     property int heightBar_small: 16 * scale;
     property int heightBar_normal: 32 * scale;
diff --git a/modules/gui/qt/qml/utils/LabelSeparator.qml b/modules/gui/qt/qml/utils/LabelSeparator.qml
new file mode 100644
index 0000000000..3eb6368340
--- /dev/null
+++ b/modules/gui/qt/qml/utils/LabelSeparator.qml
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ * Copyright (C) 2019 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/"
+
+Item{
+    id: control
+    height: childrenRect.height
+    anchors{
+        left: parent.left
+        right: parent.right
+    }
+
+    property alias text: txt.text
+
+    Label {
+        id: txt
+        font.pixelSize: VLCStyle.fontSize_xxlarge
+        color: VLCStyle.colors.text
+        font.weight: Font.Bold
+        anchors{
+            left: control.left
+            right: control.right
+            topMargin: VLCStyle.margin_small
+            leftMargin: VLCStyle.margin_large
+
+        }
+    }
+
+    Rectangle {
+        height: VLCStyle.heightBar_xxxsmall
+        radius: 2
+
+        anchors{
+            left: control.left
+            right: control.right
+            top: txt.bottom
+            topMargin: VLCStyle.margin_small
+            leftMargin: VLCStyle.margin_large
+
+        }
+        color: VLCStyle.colors.bgAlt
+    }
+}
diff --git a/modules/gui/qt/qml/utils/RoundButton.qml b/modules/gui/qt/qml/utils/RoundButton.qml
new file mode 100644
index 0000000000..e2cd65702d
--- /dev/null
+++ b/modules/gui/qt/qml/utils/RoundButton.qml
@@ -0,0 +1,42 @@
+/*****************************************************************************
+ * Copyright (C) 2019 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/"
+
+Button{
+    id: control
+    hoverEnabled: true
+    property real size: VLCStyle.icon_normal
+    contentItem: Text {
+        text: control.text
+        font: control.font
+        color: control.hovered || activeFocus ? VLCStyle.colors.accent : VLCStyle.colors.text
+        horizontalAlignment: Text.AlignHCenter
+        verticalAlignment: Text.AlignVCenter
+    }
+
+    background: Rectangle {
+        implicitWidth: control.size
+        implicitHeight: control.size
+        opacity: control.hovered ? 1 : 0.5
+        color: VLCStyle.colors.bgAlt
+        radius: VLCStyle.icon_normal/2
+    }
+}
diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc
index 9e53652d20..2a71cf830e 100644
--- a/modules/gui/qt/vlc.qrc
+++ b/modules/gui/qt/vlc.qrc
@@ -198,6 +198,8 @@
         <file alias="ScanProgressBar.qml">qml/utils/ScanProgressBar.qml</file>
         <file alias="SearchBox.qml">qml/utils/SearchBox.qml</file>
         <file alias="SortControl.qml">qml/utils/SortControl.qml</file>
+        <file alias="RoundButton.qml">qml/utils/RoundButton.qml</file>
+        <file alias="LabelSeparator.qml">qml/utils/LabelSeparator.qml</file>
     </qresource>
     <qresource prefix="/mediacenter">
         <file alias="MCMusicDisplay.qml">qml/mediacenter/MCMusicDisplay.qml</file>



More information about the vlc-commits mailing list