mirror of
https://code.videolan.org/videolan/vlc
synced 2024-09-12 13:44:56 +02:00
qml: obey naming conventions
This commit is contained in:
parent
af0df44cbf
commit
41e84a0f8b
@ -740,7 +740,7 @@ libqt_plugin_la_QML = \
|
||||
gui/qt/network/qml/ServicesHomeDisplay.qml \
|
||||
gui/qt/player/qml/qmldir \
|
||||
gui/qt/player/qml/ControlBar.qml \
|
||||
gui/qt/player/qml/ControlButtons.qml \
|
||||
gui/qt/player/qml/ControlbarControls.qml \
|
||||
gui/qt/player/qml/LanguageMenu.qml \
|
||||
gui/qt/player/qml/PlaybackSpeed.qml \
|
||||
gui/qt/player/qml/MiniPlayer.qml \
|
||||
|
@ -117,7 +117,7 @@ MouseArea {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
source: PlayerControlButtons.button(model.id).source
|
||||
source: PlayerControlbarControls.control(model.id).source
|
||||
onLoaded: {
|
||||
buttonloader.item.paintOnly = true
|
||||
buttonloader.item.enabled = false
|
||||
|
@ -31,7 +31,7 @@ GridView{
|
||||
clip: true
|
||||
|
||||
ScrollBar.vertical: ScrollBar { policy: ScrollBar.AlwaysOn }
|
||||
model: PlayerControlButtons.buttonList.length
|
||||
model: PlayerControlbarControls.controlList.length
|
||||
|
||||
highlightFollowsCurrentItem: false
|
||||
|
||||
@ -111,13 +111,13 @@ GridView{
|
||||
height: cellHeight
|
||||
|
||||
property bool held: false
|
||||
property int mIndex: PlayerControlButtons.buttonList[model.index].id
|
||||
property int mIndex: PlayerControlbarControls.controlList[model.index].id
|
||||
drag.target: held ? buttonDragItem : undefined
|
||||
cursorShape: Qt.OpenHandCursor
|
||||
|
||||
onPressed: {
|
||||
buttonDragItem.visible = true
|
||||
buttonDragItem.text = PlayerControlButtons.buttonList[model.index].label
|
||||
buttonDragItem.text = PlayerControlbarControls.controlList[model.index].label
|
||||
buttonDragItem.Drag.source = dragArea
|
||||
held = true
|
||||
root._held = true
|
||||
@ -155,7 +155,7 @@ GridView{
|
||||
Layout.preferredWidth: VLCStyle.icon_medium
|
||||
Layout.preferredHeight: VLCStyle.icon_medium
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: PlayerControlButtons.buttonList[model.index].label
|
||||
text: PlayerControlbarControls.controlList[model.index].label
|
||||
}
|
||||
|
||||
Widgets.ListSubtitleLabel {
|
||||
@ -164,7 +164,7 @@ GridView{
|
||||
Layout.fillHeight: true
|
||||
|
||||
elide: Text.ElideNone
|
||||
text: PlayerControlButtons.buttonList[model.index].text
|
||||
text: PlayerControlbarControls.controlList[model.index].text
|
||||
wrapMode: Text.WordWrap
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ FocusScope {
|
||||
delegate: Loader {
|
||||
id: buttonloader
|
||||
|
||||
source: PlayerControlButtons.button(model.id).source
|
||||
source: PlayerControlbarControls.control(model.id).source
|
||||
|
||||
focus: (index === 0)
|
||||
|
||||
|
@ -27,11 +27,9 @@ import "qrc:///widgets/" as Widgets
|
||||
import "qrc:///style/"
|
||||
|
||||
QtObject {
|
||||
id: controlButtons
|
||||
|
||||
readonly property string controlPath : "qrc:///player/controlbarcontrols/"
|
||||
|
||||
readonly property var buttonList: [
|
||||
readonly property var controlList: [
|
||||
{ id: ControlListModel.PLAY_BUTTON, file: "PlayButton.qml", label: VLCIcons.play, text: i18n.qtr("Play") },
|
||||
{ id: ControlListModel.STOP_BUTTON, file: "StopButton.qml", label: VLCIcons.stop, text: i18n.qtr("Stop") },
|
||||
{ id: ControlListModel.OPEN_BUTTON, file: "OpenButton.qml", label: VLCIcons.eject, text: i18n.qtr("Open") },
|
||||
@ -67,16 +65,16 @@ QtObject {
|
||||
{ id: ControlListModel.PLAYBACK_SPEED_BUTTON, file: "PlaybackSpeedButton.qml", label: "1x", text: i18n.qtr("Playback Speed") }
|
||||
]
|
||||
|
||||
function button(id) {
|
||||
var button = buttonList.find( function(button) { return ( button.id === id ) } )
|
||||
function control(id) {
|
||||
var control = controlList.find( function(control) { return ( control.id === id ) } )
|
||||
|
||||
if (button === undefined) {
|
||||
console.log("button delegate id " + id + " doesn't exist")
|
||||
if (control === undefined) {
|
||||
console.log("control delegate id " + id + " doesn't exist")
|
||||
return { source: controlPath + "Fallback.qml" }
|
||||
}
|
||||
|
||||
button.source = controlPath + button.file
|
||||
control.source = controlPath + control.file
|
||||
|
||||
return button
|
||||
return control
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
singleton PlayerControlButtons 1.0 ControlButtons.qml
|
||||
singleton PlayerControlbarControls 1.0 ControlbarControls.qml
|
||||
|
@ -334,7 +334,7 @@
|
||||
<file alias="ResumeDialog.qml">player/qml/ResumeDialog.qml</file>
|
||||
<file alias="SliderBar.qml">player/qml/SliderBar.qml</file>
|
||||
<file alias="TrackInfo.qml">player/qml/TrackInfo.qml</file>
|
||||
<file alias="ControlButtons.qml">player/qml/ControlButtons.qml</file>
|
||||
<file alias="ControlbarControls.qml">player/qml/ControlbarControls.qml</file>
|
||||
<file alias="MiniPlayer.qml">player/qml/MiniPlayer.qml</file>
|
||||
<file alias="TopBar.qml">player/qml/TopBar.qml</file>
|
||||
<file alias="PIPPlayer.qml">player/qml/PIPPlayer.qml</file>
|
||||
|
@ -860,7 +860,7 @@ modules/gui/qt/network/qml/NetworkGridItem.qml
|
||||
modules/gui/qt/network/qml/NetworkHomeDisplay.qml
|
||||
modules/gui/qt/network/qml/NetworkListItem.qml
|
||||
modules/gui/qt/network/qml/ServicesHomeDisplay.qml
|
||||
modules/gui/qt/player/qml/ControlButtons.qml
|
||||
modules/gui/qt/player/qml/ControlbarControls.qml
|
||||
modules/gui/qt/player/qml/LanguageMenu.qml
|
||||
modules/gui/qt/player/qml/Player.qml
|
||||
modules/gui/qt/player/qml/ResumeDialog.qml
|
||||
|
Loading…
Reference in New Issue
Block a user