[vlc-devel] [PATCH 07/15] qml: Add editor tab button

Rohan Rajpal rohan17089 at iiitd.ac.in
Mon Aug 12 15:24:21 CEST 2019


Add the tab button for the editor
---
 modules/gui/qt/Makefile.am                    |  1 +
 .../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(+)
 create mode 100644 modules/gui/qt/qml/dialogs/EditorTabButton.qml

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index 1b543eac8e..cfde19eb2d 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -565,6 +565,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 669d44938c..b618390460 100644
--- a/modules/gui/qt/qml/style/VLCStyle.qml
+++ b/modules/gui/qt/qml/style/VLCStyle.qml
@@ -123,6 +123,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 cd51446389..1dbf327d2e 100644
--- a/modules/gui/qt/vlc.qrc
+++ b/modules/gui/qt/vlc.qrc
@@ -270,5 +270,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>
-- 
2.17.1



More information about the vlc-devel mailing list