Skip to content
Snippets Groups Projects
Commit 056dd332 authored by Rohan Rajpal's avatar Rohan Rajpal Committed by Jean-Baptiste Kempf
Browse files

qml: Move player buttons layout to another qml


Move player buttons layout to another qml file to use it in
future by miniplayer.

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent cebf83a2
No related branches found
No related tags found
No related merge requests found
......@@ -559,6 +559,7 @@ libqt_plugin_la_QML = \
gui/qt/qml/player/TrackSelector.qml \
gui/qt/qml/player/ControlBar.qml \
gui/qt/qml/player/ControlButtons.qml \
gui/qt/qml/player/PlayerButtonsLayout.qml \
gui/qt/qml/player/VolumeWidget.qml \
gui/qt/qml/player/ModalControlBar.qml \
gui/qt/qml/player/SliderBar.qml \
......
......@@ -85,40 +85,10 @@ Utils.NavigableFocusScope {
color: "transparent"
}
RowLayout{
id: buttonrow
property bool _focusGiven: false
PlayerButtonsLayout {
focus: true
anchors.fill: parent
Repeater{
model: playerControlBarModel
delegate: Loader{
id: buttonloader
sourceComponent: controlmodelbuttons.returnbuttondelegate(model.id)
onLoaded: {
if (! buttonloader.item.acceptFocus)
return
else
if (!buttonrow._focusGiven){
buttonloader.item.forceActiveFocus()
buttonrow._focusGiven = true
}
if(buttonloader.item instanceof Utils.IconToolButton)
buttonloader.item.size = model.size === PlayerControlBarModel.WIDGET_BIG ?
VLCStyle.icon_large : VLCStyle.icon_medium
var buttonindex = DelegateModel.itemsIndex
while(buttonindex > 0 && !(buttonrow.children[buttonindex-1].item.acceptFocus))
buttonindex = buttonindex-1
if (buttonindex > 0)
buttonloader.item.KeyNavigation.left = buttonrow.children[buttonindex-1].item
}
}
}
model: playerControlBarModel
}
}
}
......
/*****************************************************************************
* 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 QtQuick.Layouts 1.3
import QtQml.Models 2.11
import org.videolan.vlc 0.1
import "qrc:///style/"
import "qrc:///utils/" as Utils
RowLayout{
id: buttonrow
property bool _focusGiven: false
property alias model: buttonsRepeater.model
property var defaultSize: VLCStyle.icon_medium
Repeater{
id: buttonsRepeater
delegate: Loader{
id: buttonloader
sourceComponent: controlmodelbuttons.returnbuttondelegate(model.id)
onLoaded: {
if (! buttonloader.item.acceptFocus)
return
else
if (!buttonrow._focusGiven){
buttonloader.item.forceActiveFocus()
buttonrow._focusGiven = true
}
if(buttonloader.item instanceof Utils.IconToolButton)
buttonloader.item.size = model.size === PlayerControlBarModel.WIDGET_BIG ?
VLCStyle.icon_large : defaultSize
var buttonindex = DelegateModel.itemsIndex
while(buttonindex > 0 && !(buttonrow.children[buttonindex-1].item.acceptFocus))
buttonindex = buttonindex-1
if (buttonindex > 0)
buttonloader.item.KeyNavigation.left = buttonrow.children[buttonindex-1].item
}
}
}
}
......@@ -266,6 +266,7 @@
<file alias="TeletextWidget.qml">qml/player/TeletextWidget.qml</file>
<file alias="MiniPlayer.qml">qml/player/MiniPlayer.qml</file>
<file alias="TopBar.qml">qml/player/TopBar.qml</file>
<file alias="PlayerButtonsLayout.qml">qml/player/PlayerButtonsLayout.qml</file>
</qresource>
<qresource prefix="/about">
<file alias="About.qml">qml/about/About.qml</file>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment