[vlc-devel] [PATCH 28/38] qml: implement player switch button

Fatih Uzunoglu fuzun54 at outlook.com
Thu Aug 20 19:55:37 CEST 2020


---
 modules/gui/qt/player/qml/ControlButtons.qml | 26 +++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/player/qml/ControlButtons.qml b/modules/gui/qt/player/qml/ControlButtons.qml
index 7602ca869b..2224fd74c8 100644
--- a/modules/gui/qt/player/qml/ControlButtons.qml
+++ b/modules/gui/qt/player/qml/ControlButtons.qml
@@ -60,7 +60,8 @@ Item{
         { id:  PlayerControlBarModel.TELETEXT_BUTTONS, label: VLCIcons.tvtelx, text: i18n.qtr("Teletext")},
         { id:  PlayerControlBarModel.ASPECT_RATIO_COMBOBOX, label: VLCIcons.aspect_ratio, text: i18n.qtr("Aspect Ratio")},
         { id:  PlayerControlBarModel.WIDGET_SPACER, label: VLCIcons.space, text: i18n.qtr("Spacer")},
-        { id:  PlayerControlBarModel.WIDGET_SPACER_EXTEND, label: VLCIcons.space, text: i18n.qtr("Expanding Spacer")}
+        { id:  PlayerControlBarModel.WIDGET_SPACER_EXTEND, label: VLCIcons.space, text: i18n.qtr("Expanding Spacer")},
+        { id:  PlayerControlBarModel.PLAYER_SWITCH_BUTTON, label: VLCIcons.fullscreen, text: i18n.qtr("Switch Player")}
     ]
 
     function returnbuttondelegate(inpID){
@@ -95,6 +96,7 @@ Item{
         case PlayerControlBarModel.VOLUME: return volumeBtnDelegate
         case PlayerControlBarModel.ASPECT_RATIO_COMBOBOX: return aspectRatioDelegate
         case PlayerControlBarModel.TELETEXT_BUTTONS: return teletextdelegate
+        case PlayerControlBarModel.PLAYER_SWITCH_BUTTON: return playerSwitchBtnDelegate
         }
         console.log("button delegate id " + inpID +  " doesn't exists")
         return spacerDelegate
@@ -739,4 +741,26 @@ Item{
         id: volumeBtnDelegate
         VolumeWidget{}
     }
+
+    Component {
+        id: playerSwitchBtnDelegate
+
+        Widgets.IconToolButton{
+            size: VLCStyle.icon_medium
+            enabled: !paintOnly
+            iconText: VLCIcons.fullscreen
+
+            onClicked: {
+                if (isMiniplayer) {
+                    history.push(["player"])
+                }
+                else {
+                    history.previous()
+                }
+            }
+
+            property bool acceptFocus: true
+            text: i18n.qtr("Switch Player")
+        }
+    }
 }
-- 
2.25.1



More information about the vlc-devel mailing list