1
mirror of https://code.videolan.org/videolan/vlc synced 2024-08-27 04:21:53 +02:00

qml: obey naming conventions

This commit is contained in:
Fatih Uzunoglu 2021-07-22 20:04:10 +03:00 committed by Jean-Baptiste Kempf
parent af0df44cbf
commit 41e84a0f8b
8 changed files with 18 additions and 20 deletions

View File

@ -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 \

View File

@ -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

View File

@ -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
}

View File

@ -97,7 +97,7 @@ FocusScope {
delegate: Loader {
id: buttonloader
source: PlayerControlButtons.button(model.id).source
source: PlayerControlbarControls.control(model.id).source
focus: (index === 0)

View File

@ -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
}
}

View File

@ -1 +1 @@
singleton PlayerControlButtons 1.0 ControlButtons.qml
singleton PlayerControlbarControls 1.0 ControlbarControls.qml

View File

@ -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>

View 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