[vlc-commits] qml: implement player switch button
Fatih Uzunoglu
git at videolan.org
Thu Aug 27 12:44:59 CEST 2020
vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Thu Aug 20 17:43:04 2020 +0300| [497a5b32c49115f0f97e0f0bac79b9fc88de8ff1] | committer: Pierre Lamot
qml: implement player switch button
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=497a5b32c49115f0f97e0f0bac79b9fc88de8ff1
---
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")
+ }
+ }
}
More information about the vlc-commits
mailing list