[vlc-commits] qml: Add editor tab button

Rohan Rajpal git at videolan.org
Wed Aug 21 16:27:01 CEST 2019


vlc | branch: master | Rohan Rajpal <rohan17089 at iiitd.ac.in> | Wed Aug  7 23:05:10 2019 +0530| [94cd7125df1628b58604a71614b1a3b7f461db9a] | committer: Jean-Baptiste Kempf

qml: Add editor tab button

Add the tab button for the editor

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

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

 modules/gui/qt/Makefile.am                     |  1 +
 modules/gui/qt/qml/dialogs/EditorTabButton.qml | 42 ++++++++++++++++++++++++++
 modules/gui/qt/qml/style/VLCStyle.qml          |  5 +++
 modules/gui/qt/vlc.qrc                         |  1 +
 4 files changed, 49 insertions(+)

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index 9a9b8ca412..964acf31d5 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -571,6 +571,7 @@ libqt_plugin_la_QML = \
 	gui/qt/qml/dialogs/EditorDummyButton.qml \
 	gui/qt/qml/dialogs/EditorDNDDelegate.qml \
 	gui/qt/qml/dialogs/EditorDNDView.qml\
+	gui/qt/qml/dialogs/EditorTabButton.qml \
 	gui/qt/qml/dialogs/ToolbarEditorButtonList.qml \
 	gui/qt/qml/dialogs/ToolbarEditor.qml \
 	gui/qt/qml/utils/DNDLabel.qml \
diff --git a/modules/gui/qt/qml/dialogs/EditorTabButton.qml b/modules/gui/qt/qml/dialogs/EditorTabButton.qml
new file mode 100644
index 0000000000..7623729942
--- /dev/null
+++ b/modules/gui/qt/qml/dialogs/EditorTabButton.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/"
+
+TabButton {
+    id: mainPlayerControl
+
+    property int index: 0
+    property bool active: index == bar.currentIndex
+
+    contentItem: Text {
+        text: mainPlayerControl.text
+        color: VLCStyle.colors.buttonText
+        horizontalAlignment: Text.AlignHCenter
+        verticalAlignment: Text.AlignVCenter
+    }
+
+    background: Rectangle {
+        width: VLCStyle.button_width_large
+        height: VLCStyle.heightBar_normal
+        color: active ? VLCStyle.colors.bgAlt : hovered ? VLCStyle.colors.bgHover : VLCStyle.colors.bg
+        radius: 2
+    }
+}
diff --git a/modules/gui/qt/qml/style/VLCStyle.qml b/modules/gui/qt/qml/style/VLCStyle.qml
index b680388135..aa475840db 100644
--- a/modules/gui/qt/qml/style/VLCStyle.qml
+++ b/modules/gui/qt/qml/style/VLCStyle.qml
@@ -127,6 +127,11 @@ Item {
     property int combobox_height_normal: 24 * scale
     property int combobox_height_large: 30 * scale
 
+    //button
+    property int button_width_small: 64 * scale
+    property int button_width_normal: 96 * scale
+    property int button_width_large: 128 * scale
+
     //timings
     property int delayToolTipAppear: 500;
     property int timingPlaylistClose: 1000;
diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc
index 74037963ba..10cd8247b9 100644
--- a/modules/gui/qt/vlc.qrc
+++ b/modules/gui/qt/vlc.qrc
@@ -279,5 +279,6 @@
         <file alias="ToolbarEditorButtonList.qml">qml/dialogs/ToolbarEditorButtonList.qml</file>
         <file alias="ToolbarEditor.qml">qml/dialogs/ToolbarEditor.qml</file>
         <file alias="EditorDNDView.qml">qml/dialogs/EditorDNDView.qml</file>
+        <file alias="EditorTabButton.qml">qml/dialogs/EditorTabButton.qml</file>
     </qresource>
 </RCC>



More information about the vlc-commits mailing list