diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am index 456f245ae0d9d9a109672d052753f9f72322739b..6a6ad5c6d525b1e5863a1ceed764cc48fb7b3d5e 100644 --- a/modules/gui/qt/Makefile.am +++ b/modules/gui/qt/Makefile.am @@ -755,6 +755,37 @@ libqt_plugin_la_QML = \ gui/qt/player/qml/TrackInfo.qml \ gui/qt/player/qml/VolumeWidget.qml \ gui/qt/player/qml/ButtonsLayout.qml \ + gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml \ + gui/qt/player/qml/controlbarcontrols/AspectRatioWidget.qml \ + gui/qt/player/qml/controlbarcontrols/AtoBButton.qml \ + gui/qt/player/qml/controlbarcontrols/BackButton.qml \ + gui/qt/player/qml/controlbarcontrols/ChapterNextButton.qml \ + gui/qt/player/qml/controlbarcontrols/ChapterPreviousButton.qml \ + gui/qt/player/qml/controlbarcontrols/ExpandingSpacerWidget.qml \ + gui/qt/player/qml/controlbarcontrols/ExtendedSettingsButton.qml \ + gui/qt/player/qml/controlbarcontrols/FasterButton.qml \ + gui/qt/player/qml/controlbarcontrols/FrameButton.qml \ + gui/qt/player/qml/controlbarcontrols/FullscreenButton.qml \ + gui/qt/player/qml/controlbarcontrols/InfoButton.qml \ + gui/qt/player/qml/controlbarcontrols/LangButton.qml \ + gui/qt/player/qml/controlbarcontrols/LoopButton.qml \ + gui/qt/player/qml/controlbarcontrols/MenuButton.qml \ + gui/qt/player/qml/controlbarcontrols/NextButton.qml \ + gui/qt/player/qml/controlbarcontrols/OpenButton.qml \ + gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml \ + gui/qt/player/qml/controlbarcontrols/PlayButton.qml \ + gui/qt/player/qml/controlbarcontrols/PlayerSwitchButton.qml \ + gui/qt/player/qml/controlbarcontrols/PlaylistButton.qml \ + gui/qt/player/qml/controlbarcontrols/PreviousButton.qml \ + gui/qt/player/qml/controlbarcontrols/QuitButton.qml \ + gui/qt/player/qml/controlbarcontrols/RandomButton.qml \ + gui/qt/player/qml/controlbarcontrols/RecordButton.qml \ + gui/qt/player/qml/controlbarcontrols/SkipBackButton.qml \ + gui/qt/player/qml/controlbarcontrols/SkipForwardButton.qml \ + gui/qt/player/qml/controlbarcontrols/SlowerButton.qml \ + gui/qt/player/qml/controlbarcontrols/SnapshotButton.qml \ + gui/qt/player/qml/controlbarcontrols/SpacerWidget.qml \ + gui/qt/player/qml/controlbarcontrols/StopButton.qml \ gui/qt/playlist/qml/PlaylistDelegate.qml \ gui/qt/playlist/qml/PlaylistListView.qml \ gui/qt/playlist/qml/PlaylistOverlayMenu.qml \ diff --git a/modules/gui/qt/player/qml/ControlButtons.qml b/modules/gui/qt/player/qml/ControlButtons.qml index 9054bd9edad6e66841313d0399fb40d17b555874..c6b25c7e06e4c8b647b82deceaad50936ad2da0b 100644 --- a/modules/gui/qt/player/qml/ControlButtons.qml +++ b/modules/gui/qt/player/qml/ControlButtons.qml @@ -1,4 +1,4 @@ -/***************************************************************************** +/***************************************************************************** * Copyright (C) 2019 VLC authors and VideoLAN * * This program is free software; you can redistribute it and/or modify @@ -16,16 +16,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Layouts 1.11 -import QtQuick.Controls 2.4 -import QtGraphicalEffects 1.0 +import QtQml 2.11 import org.videolan.vlc 0.1 +import "qrc:///player/controlbarcontrols/" as Controls import "qrc:///widgets/" as Widgets import "qrc:///style/" -import "qrc:///util/Helpers.js" as Helpers QtObject { id: controlButtons @@ -102,771 +99,69 @@ QtObject { } } - readonly property Component backBtnDelegate : Widgets.IconControlButton { - id: backBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.exit - text: i18n.qtr("Back") - onClicked: history.previous() - } - - readonly property Component randomBtnDelegate : Widgets.IconControlButton { - id: randomBtn - size: VLCStyle.icon_medium - checked: mainPlaylistController.random - iconText: VLCIcons.shuffle_on - onClicked: mainPlaylistController.toggleRandom() - text: i18n.qtr("Random") - } - - readonly property Component prevBtnDelegate : Widgets.IconControlButton { - id: prevBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.previous - enabled: mainPlaylistController.hasPrev - onClicked: mainPlaylistController.prev() - text: i18n.qtr("Previous") - } - - readonly property Component playBtnDelegate : ToolButton { - id: playBtn - - width: VLCStyle.icon_medium - height: width - - scale: (playBtnMouseArea.pressed) ? 0.95 : 1.0 - - property VLCColors colors: VLCStyle.colors - - property color color: colors.buttonPlayIcon - - property color colorDisabled: colors.textInactive - - property bool paintOnly: false - - property bool isCursorInside: false - - Keys.onPressed: { - if (KeyHelper.matchOk(event) ) { - event.accepted = true - } - Navigation.defaultKeyAction(event) - } - Keys.onReleased: { - if (!event.accepted && KeyHelper.matchOk(event)) - mainPlaylistController.togglePlayPause() - } - - states: [ - State { - name: "hovered" - when: interactionIndicator - - PropertyChanges { - target: hoverShadow - radius: VLCStyle.dp(24, VLCStyle.scale) - } - }, - State { - name: "default" - when: !interactionIndicator - - PropertyChanges { - target: contentLabel - color: enabled ? playBtn.color : playBtn.colorDisabled - } - - PropertyChanges { - target: hoverShadow - radius: 0 - } - } - ] - readonly property bool interactionIndicator: (playBtn.activeFocus || playBtn.isCursorInside || playBtn.highlighted) - - contentItem: Label { - id: contentLabel - - text: (player.playingState !== PlayerController.PLAYING_STATE_PAUSED - && player.playingState !== PlayerController.PLAYING_STATE_STOPPED) - ? VLCIcons.pause - : VLCIcons.play - - Behavior on color { - ColorAnimation { - duration: VLCStyle.ms75 - easing.type: Easing.InOutSine - } - } - - font.pixelSize: VLCIcons.pixelSize(VLCStyle.icon_normal) - font.family: VLCIcons.fontFamily - - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - } - - background: Item { - Gradient { - id: playBtnGradient - GradientStop { position: 0.0; color: VLCStyle.colors.buttonPlayA } - GradientStop { position: 1.0; color: VLCStyle.colors.buttonPlayB } - } - - MouseArea { - id: playBtnMouseArea - - anchors.fill: parent - anchors.margins: VLCStyle.dp(1, VLCStyle.scale) - - hoverEnabled: true - - readonly property int radius: playBtnMouseArea.width / 2 - - onPositionChanged: { - if (Helpers.pointInRadius( - (playBtnMouseArea.width / 2) - playBtnMouseArea.mouseX, - (playBtnMouseArea.height / 2) - playBtnMouseArea.mouseY, - radius)) { - // cursor is inside of the round button - playBtn.isCursorInside = true - } - else { - // cursor is outside - playBtn.isCursorInside = false - } - } - - onHoveredChanged: { - if (!playBtnMouseArea.containsMouse) - playBtn.isCursorInside = false - } - - onClicked: { - if (!playBtn.isCursorInside) - return - - mainPlaylistController.togglePlayPause() - } - - onPressAndHold: { - if (!playBtn.isCursorInside) - return - - mainPlaylistController.stop() - } - } - - DropShadow { - id: hoverShadow - - anchors.fill: parent - - visible: radius > 0 - samples: (radius * 2) + 1 - // opacity: 0.29 // it looks better without this - color: "#FF610A" - source: opacityMask - antialiasing: true - - Behavior on radius { - NumberAnimation { - duration: VLCStyle.ms75 - easing.type: Easing.InOutSine - } - } - } - - Rectangle { - radius: (width * 0.5) - anchors.fill: parent - anchors.margins: VLCStyle.dp(1, VLCStyle.scale) - - color: VLCStyle.colors.white - } - - Rectangle { - id: outerRect - anchors.fill: parent - - radius: (width * 0.5) - gradient: playBtnGradient - - visible: false - } - - Rectangle { - id: innerRect - anchors.fill: parent - - radius: (width * 0.5) - border.width: VLCStyle.dp(2, VLCStyle.scale) - - color: "transparent" - visible: false - } - - OpacityMask { - id: opacityMask - anchors.fill: parent - - source: outerRect - maskSource: innerRect - - antialiasing: true - } - } - } - - readonly property Component nextBtnDelegate : Widgets.IconControlButton { - id: nextBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.next - enabled: mainPlaylistController.hasNext - onClicked: mainPlaylistController.next() - text: i18n.qtr("Next") - } - - readonly property Component chapterPreviousBtnDelegate : Widgets.IconControlButton { - id: chapterPreviousBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.dvd_prev - onClicked: player.chapterPrev() - enabled: player.hasChapters - text: i18n.qtr("Previous chapter") - } - - readonly property Component chapterNextBtnDelegate : Widgets.IconControlButton { - id: chapterNextBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.dvd_next - onClicked: player.chapterNext() - enabled: player.hasChapters - text: i18n.qtr("Next chapter") - } - - readonly property Component repeatBtnDelegate : Widgets.IconControlButton { - id: repeatBtn - size: VLCStyle.icon_medium - checked: mainPlaylistController.repeatMode !== PlaylistControllerModel.PLAYBACK_REPEAT_NONE - iconText: (mainPlaylistController.repeatMode === PlaylistControllerModel.PLAYBACK_REPEAT_CURRENT) - ? VLCIcons.repeat_one - : VLCIcons.repeat_all - onClicked: mainPlaylistController.toggleRepeatMode() - text: i18n.qtr("Repeat") - } - - readonly property Component langBtnDelegate : Widgets.IconControlButton { - id: langBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.audiosub - - enabled: langMenuLoader.status === Loader.Ready - onClicked: langMenuLoader.item.open() - - text: i18n.qtr("Languages and tracks") - - Loader { - id: langMenuLoader - - active: (typeof rootPlayer !== 'undefined') && (rootPlayer !== null) - - sourceComponent: LanguageMenu { - id: langMenu - - parent: rootPlayer - focus: true - x: 0 - y: (rootPlayer.positionSliderY - height) - z: 1 - - onOpened: { - controlButtons.requestLockUnlockAutoHide(true, controlButtons) - if (!!rootPlayer) - rootPlayer.menu = langMenu - } - - onClosed: { - controlButtons.requestLockUnlockAutoHide(false, controlButtons) - langBtn.forceActiveFocus() - if (!!rootPlayer) - rootPlayer.menu = undefined - } - } - } - } - - readonly property Component playlistBtnDelegate : Widgets.IconControlButton { - id: playlistBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.playlist - onClicked: { - mainInterface.playlistVisible = !mainInterface.playlistVisible - if (mainInterface.playlistVisible && mainInterface.playlistDocked) { - playlistWidget.gainFocus(playlistBtn) - } - } - - text: i18n.qtr("Playlist") - } - - readonly property Component menuBtnDelegate : Widgets.IconControlButton { - id: menuBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.ellipsis - text: i18n.qtr("Menu") - - onClicked: contextMenu.popup(this.mapToGlobal(0, 0)) - - QmlGlobalMenu { - id: contextMenu - - ctx: mainctx - - onAboutToShow: controlButtons.requestLockUnlockAutoHide(true, contextMenu) - onAboutToHide: controlButtons.requestLockUnlockAutoHide(false, contextMenu) - } - } - - readonly property Component spacerDelegate : Item { - id: spacer - enabled: false - implicitWidth: VLCStyle.icon_normal - implicitHeight: VLCStyle.icon_normal - property alias spacetextExt: spacetext - property bool paintOnly: false - Label { - id: spacetext - text: VLCIcons.space - color: VLCStyle.colors.buttonText - visible: parent.paintOnly - - anchors.centerIn: parent + readonly property Component backBtnDelegate : Controls.BackButton { } - font.pixelSize: VLCIcons.pixelSize(VLCStyle.icon_medium) - font.family: VLCIcons.fontFamily + readonly property Component randomBtnDelegate : Controls.RandomButton { } - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - } - } + readonly property Component prevBtnDelegate : Controls.PreviousButton { } - readonly property Component extendiblespacerDelegate : Item { - id: extendedspacer + readonly property Component playBtnDelegate : Controls.PlayButton { } - enabled: false + readonly property Component nextBtnDelegate : Controls.NextButton { } - implicitWidth: paintOnly ? VLCStyle.widthExtendedSpacer : extraWidth - implicitHeight: VLCStyle.icon_normal + readonly property Component chapterPreviousBtnDelegate : Controls.ChapterPreviousButton { } - property bool paintOnly: false - property alias spacetextExt: spacetext + readonly property Component chapterNextBtnDelegate : Controls.ChapterNextButton { } - readonly property real minimumWidth: 0 - property real extraWidth: 0 + readonly property Component repeatBtnDelegate : Controls.LoopButton { } - Label { - id: spacetext - anchors.centerIn: parent + readonly property Component langBtnDelegate : Controls.LangButton { } - text: VLCIcons.space - color: VLCStyle.colors.buttonText - visible: paintOnly + readonly property Component playlistBtnDelegate : Controls.PlaylistButton { } - font.pixelSize: VLCIcons.pixelSize(VLCStyle.icon_medium) - font.family: VLCIcons.fontFamily + readonly property Component menuBtnDelegate : Controls.MenuButton { } - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - } - } + readonly property Component spacerDelegate : Controls.SpacerWidget { } - readonly property Component fullScreenBtnDelegate : Widgets.IconControlButton { - id: fullScreenBtn - size: VLCStyle.icon_medium - enabled: player.hasVideoOutput - iconText: player.fullscreen ? VLCIcons.defullscreen :VLCIcons.fullscreen - onClicked: player.fullscreen = !player.fullscreen - text: i18n.qtr("fullscreen") - } - - readonly property Component recordBtnDelegate : Widgets.IconControlButton { - id: recordBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.record - enabled: player.isPlaying - checked: player.isRecording - onClicked: player.toggleRecord() - text: i18n.qtr("record") - } - - readonly property Component toggleABloopstateDelegate : Widgets.IconControlButton { - id: abBtn - - size: VLCStyle.icon_medium - checked: player.ABloopState !== PlayerController.ABLOOP_STATE_NONE - onClicked: player.toggleABloopState() - text: i18n.qtr("A to B") - - iconText: { - switch(player.ABloopState) { - case PlayerController.ABLOOP_STATE_A: return VLCIcons.atob_bg_b - case PlayerController.ABLOOP_STATE_B: return VLCIcons.atob_bg_none - case PlayerController.ABLOOP_STATE_NONE: return VLCIcons.atob_bg_ab - } - } + readonly property Component extendiblespacerDelegate : Controls.ExpandingSpacerWidget { } - Widgets.IconLabel { - anchors.centerIn: abBtn.contentItem + readonly property Component fullScreenBtnDelegate : Controls.FullscreenButton { } - color: abBtn.colors.accent + readonly property Component recordBtnDelegate : Controls.RecordButton { } - text: { - switch(player.ABloopState) { - case PlayerController.ABLOOP_STATE_A: return VLCIcons.atob_fg_a - case PlayerController.ABLOOP_STATE_B: return VLCIcons.atob_fg_ab - case PlayerController.ABLOOP_STATE_NONE: return "" - } - } - } - } + readonly property Component toggleABloopstateDelegate : Controls.AtoBButton { } - readonly property Component snapshotBtnDelegate : Widgets.IconControlButton { - id: snapshotBtn - size: VLCStyle.icon_medium - enabled: player.isPlaying - iconText: VLCIcons.snapshot - onClicked: player.snapshot() - text: i18n.qtr("Snapshot") - } + readonly property Component snapshotBtnDelegate : Controls.SnapshotButton { } - readonly property Component stopBtnDelegate : Widgets.IconControlButton { - id: stopBtn - size: VLCStyle.icon_medium - enabled: player.isPlaying - iconText: VLCIcons.stop - onClicked: mainPlaylistController.stop() - text: i18n.qtr("Stop") - } + readonly property Component stopBtnDelegate : Controls.StopButton { } - readonly property Component mediainfoBtnDelegate : Widgets.IconControlButton { - id: infoBtn - size: VLCStyle.icon_medium - enabled: player.isPlaying - iconText: VLCIcons.info - onClicked: dialogProvider.mediaInfoDialog() - text: i18n.qtr("Informations") - } + readonly property Component mediainfoBtnDelegate : Controls.InfoButton { } - readonly property Component framebyframeDelegate : Widgets.IconControlButton { - id: frameBtn - size: VLCStyle.icon_medium - enabled: player.isPlaying - iconText: VLCIcons.frame_by_frame - onClicked: player.frameNext() - text: i18n.qtr("Next frame") - } + readonly property Component framebyframeDelegate : Controls.FrameButton { } - readonly property Component fasterBtnDelegate : Widgets.IconControlButton { - id: fasterBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.faster - onClicked: player.faster() - text: i18n.qtr("Faster") - } + readonly property Component fasterBtnDelegate : Controls.FasterButton { } - readonly property Component slowerBtnDelegate : Widgets.IconControlButton { - id: slowerBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.slower - onClicked: player.slower() - text: i18n.qtr("Slower") - } + readonly property Component slowerBtnDelegate : Controls.SlowerButton { } - readonly property Component openmediaBtnDelegate : Widgets.IconControlButton { - id: openMediaBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.eject - onClicked: dialogProvider.openDialog() - text: i18n.qtr("Open media") - } + readonly property Component openmediaBtnDelegate : Controls.OpenButton { } - readonly property Component extdSettingsBtnDelegate : Widgets.IconControlButton { - id: extdSettingsBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.extended - onClicked: dialogProvider.extendedDialog() - Accessible.name: i18n.qtr("Extended settings") - } + readonly property Component extdSettingsBtnDelegate : Controls.ExtendedSettingsButton { } - readonly property Component stepFwdBtnDelegate : Widgets.IconControlButton { - id: stepfwdBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.skip_for - onClicked: player.jumpFwd() - text: i18n.qtr("Step forward") - } + readonly property Component stepFwdBtnDelegate : Controls.SkipForwardButton { } + readonly property Component stepBackBtnDelegate : Controls.SkipBackButton { } - readonly property Component stepBackBtnDelegate : Widgets.IconControlButton { - id: stepBackBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.skip_back - onClicked: player.jumpBwd() - text: i18n.qtr("Step back") - } + readonly property Component quitBtnDelegate : Controls.QuitButton { } - readonly property Component quitBtnDelegate : Widgets.IconControlButton { - id: quitBtn - size: VLCStyle.icon_medium - iconText: VLCIcons.clear - onClicked: mainInterface.close() - text: i18n.qtr("Quit") - } - - readonly property Component aspectRatioDelegate : Widgets.ComboBoxExt { - property bool paintOnly: false - Layout.alignment: Qt.AlignVCenter - width: VLCStyle.combobox_width_normal - height: VLCStyle.combobox_height_normal - textRole: "display" - model: player.aspectRatio - currentIndex: -1 - onCurrentIndexChanged: model.toggleIndex(currentIndex) - Accessible.name: i18n.qtr("Aspect ratio") - } + readonly property Component aspectRatioDelegate : Controls.AspectRatioWidget { } readonly property Component teletextdelegate : TeletextWidget { } readonly property Component volumeBtnDelegate : VolumeWidget { parentWindow: controlButtons.parentWindow } - readonly property Component playerSwitchBtnDelegate : Widgets.IconControlButton { - size: VLCStyle.icon_medium - iconText: VLCIcons.fullscreen - - onClicked: { - if (history.current.view === "player") - history.previous() - else - g_mainDisplay.showPlayer() - } - - text: i18n.qtr("Switch Player") - } - - readonly property Component artworkInfoDelegate : Widgets.AnimatedBackground { - id: artworkInfoItem + readonly property Component playerSwitchBtnDelegate : Controls.PlayerSwitchButton { } - property bool paintOnly: false + readonly property Component artworkInfoDelegate : Controls.ArtworkInfoWidget { } - property VLCColors colors: VLCStyle.colors - - readonly property real minimumWidth: cover.width + VLCStyle.focus_border * 2 - property real extraWidth: 0 - - implicitWidth: playingItemInfoRow.width + VLCStyle.focus_border * 2 - implicitHeight: playingItemInfoRow.height + VLCStyle.focus_border * 2 - - activeBorderColor: colors.bgFocus - - Keys.onPressed: { - if (KeyHelper.matchOk(event) ) { - event.accepted = true - } - Navigation.defaultKeyAction(event) - } - Keys.onReleased: { - if (!event.accepted && KeyHelper.matchOk(event)) - g_mainDisplay.showPlayer() - } - - MouseArea { - id: artworkInfoMouseArea - anchors.fill: parent - visible: !paintOnly - onClicked: g_mainDisplay.showPlayer() - hoverEnabled: true - } - - Row { - id: playingItemInfoRow - - anchors.centerIn: parent - - width: (coverItem.width + infoColumn.width + spacing) - - spacing: infoColumn.visible ? VLCStyle.margin_xsmall : 0 - - Item { - id: coverItem - anchors.verticalCenter: parent.verticalCenter - implicitHeight: childrenRect.height - implicitWidth: childrenRect.width - - Rectangle { - id: coverRect - anchors.fill: cover - color: colors.bg - } - - DropShadow { - anchors.fill: coverRect - source: coverRect - radius: 8 - samples: 17 - color: VLCStyle.colors.glowColorBanner - spread: 0.2 - } - - Image { - id: cover - - source: { - if (paintOnly) - VLCStyle.noArtAlbum - else - (mainPlaylistController.currentItem.artwork && mainPlaylistController.currentItem.artwork.toString()) - ? mainPlaylistController.currentItem.artwork - : VLCStyle.noArtAlbum - } - fillMode: Image.PreserveAspectFit - - width: VLCStyle.dp(60) - height: VLCStyle.dp(60) - - ToolTip { - x: parent.x - - visible: artworkInfoItem.visible - && (titleLabel.implicitWidth > titleLabel.width || artistLabel.implicitWidth > titleLabel.width) - && (artworkInfoMouseArea.containsMouse || artworkInfoItem.active) - delay: 500 - - contentItem: Text { - text: i18n.qtr("%1\n%2\n%3").arg(titleLabel.text).arg(artistLabel.text).arg(progressIndicator.text) - color: colors.tooltipTextColor - } - - background: Rectangle { - color: colors.tooltipColor - } - } - } - } - - Column { - id: infoColumn - anchors.verticalCenter: parent.verticalCenter - - readonly property real preferredWidth: Math.max(titleLabel.implicitWidth, artistLabel.implicitWidth, progressIndicator.implicitWidth) - width: ((artworkInfoItem.extraWidth > preferredWidth) || (paintOnly)) ? preferredWidth - : artworkInfoItem.extraWidth - - visible: width > 0 - - Widgets.MenuLabel { - id: titleLabel - - width: parent.width - - text: { - if (paintOnly) - i18n.qtr("Title") - else - mainPlaylistController.currentItem.title - } - color: colors.text - } - - Widgets.MenuCaption { - id: artistLabel - - width: parent.width - - text: { - if (paintOnly) - i18n.qtr("Artist") - else - mainPlaylistController.currentItem.artist - } - color: colors.menuCaption - } - - Widgets.MenuCaption { - id: progressIndicator - - width: parent.width - - text: { - if (paintOnly) - " -- / -- " - else - player.time.toString() + " / " + player.length.toString() - } - color: colors.menuCaption - } - } - } - } - - readonly property Component playbackSpeedButtonDelegate : Widgets.IconControlButton { - id: playbackSpeedButton - - size: VLCStyle.icon_medium - text: i18n.qtr("Playback Speed") - color: playbackSpeedPopup.visible ? colors.accent : colors.playerControlBarFg - - onClicked: playbackSpeedPopup.open() - - PlaybackSpeed { - id: playbackSpeedPopup - - z: 1 - colors: playbackSpeedButton.colors - focus: true - parent: playbackSpeedButton.paintOnly - ? playbackSpeedButton // button is not part of main display (ToolbarEditorDialog) - : (history.current.view === "player") ? rootPlayer : g_mainDisplay - - onOpened: { - // update popup coordinates - // - // mapFromItem is affected by various properties of source and target objects - // which can't be represented in a binding expression so a initial setting in - // object defination (x: clamp(...)) doesn't work, so we set x and y on initial open - x = Qt.binding(function () { - // coords are mapped through playbackSpeedButton.parent so that binding is generated based on playbackSpeedButton.x - var mappedParentCoordinates = parent.mapFromItem(playbackSpeedButton.parent, playbackSpeedButton.x, 0) - return Helpers.clamp(mappedParentCoordinates.x - ((width - playbackSpeedButton.width) / 2), - VLCStyle.margin_xxsmall + VLCStyle.applicationHorizontalMargin, - parent.width - VLCStyle.applicationHorizontalMargin - VLCStyle.margin_xxsmall - width) - }) - - y = Qt.binding(function () { - // coords are mapped through playbackSpeedButton.parent so that binding is generated based on playbackSpeedButton.y - var mappedParentCoordinates = parent.mapFromItem(playbackSpeedButton.parent, 0, playbackSpeedButton.y) - return mappedParentCoordinates.y - playbackSpeedPopup.height - VLCStyle.margin_xxsmall - }) - - // player related -- - controlButtons.requestLockUnlockAutoHide(true, controlButtons) - if (!!rootPlayer) - rootPlayer.menu = playbackSpeedPopup - } - - onClosed: { - controlButtons.requestLockUnlockAutoHide(false, controlButtons) - playbackSpeedButton.forceActiveFocus() - if (!!rootPlayer) - rootPlayer.menu = undefined - } - } - - Label { - anchors.centerIn: parent - font.pixelSize: VLCStyle.fontSize_normal - text: !playbackSpeedButton.paintOnly ? i18n.qtr("%1x").arg(+player.rate.toFixed(2)) : i18n.qtr("1x") - color: playbackSpeedButton.background.foregroundColor // IconToolButton.background is a AnimatedBackground - } - } + readonly property Component playbackSpeedButtonDelegate : Controls.PlaybackSpeedButton { } } diff --git a/modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml b/modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml new file mode 100644 index 0000000000000000000000000000000000000000..2ab9f83f82289bfb1927e5e5393982bb3028e3a9 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml @@ -0,0 +1,184 @@ +/***************************************************************************** + * Copyright (C) 2021 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 QtGraphicalEffects 1.0 + +import org.videolan.vlc 0.1 + +import "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.AnimatedBackground { + id: artworkInfoItem + + property bool paintOnly: false + + property VLCColors colors: VLCStyle.colors + + readonly property real minimumWidth: cover.width + VLCStyle.focus_border * 2 + property real extraWidth: 0 + + implicitWidth: playingItemInfoRow.width + VLCStyle.focus_border * 2 + implicitHeight: playingItemInfoRow.height + VLCStyle.focus_border * 2 + + activeBorderColor: colors.bgFocus + + Keys.onPressed: { + if (KeyHelper.matchOk(event)) + event.accepted = true + + Navigation.defaultKeyAction(event) + } + + Keys.onReleased: { + if (KeyHelper.matchOk(event)) { + g_mainDisplay.showPlayer() + event.accepted = true + } + } + + MouseArea { + id: artworkInfoMouseArea + anchors.fill: parent + visible: !paintOnly + onClicked: g_mainDisplay.showPlayer() + hoverEnabled: true + } + + Row { + id: playingItemInfoRow + + anchors.centerIn: parent + + width: (coverItem.width + infoColumn.width + spacing) + + spacing: infoColumn.visible ? VLCStyle.margin_xsmall : 0 + + Item { + id: coverItem + anchors.verticalCenter: parent.verticalCenter + implicitHeight: childrenRect.height + implicitWidth: childrenRect.width + + Rectangle { + id: coverRect + anchors.fill: cover + color: colors.bg + } + + DropShadow { + anchors.fill: coverRect + source: coverRect + radius: 8 + samples: 17 + color: VLCStyle.colors.glowColorBanner + spread: 0.2 + } + + Image { + id: cover + + source: { + if (paintOnly) + VLCStyle.noArtAlbum + else + (mainPlaylistController.currentItem.artwork && mainPlaylistController.currentItem.artwork.toString()) + ? mainPlaylistController.currentItem.artwork + : VLCStyle.noArtAlbum + } + fillMode: Image.PreserveAspectFit + + width: VLCStyle.dp(60) + height: VLCStyle.dp(60) + + ToolTip { + x: parent.x + + visible: artworkInfoItem.visible + && (titleLabel.implicitWidth > titleLabel.width || artistLabel.implicitWidth > titleLabel.width) + && (artworkInfoMouseArea.containsMouse || artworkInfoItem.active) + delay: 500 + + contentItem: Text { + text: i18n.qtr("%1\n%2\n%3").arg(titleLabel.text).arg(artistLabel.text).arg(progressIndicator.text) + color: colors.tooltipTextColor + } + + background: Rectangle { + color: colors.tooltipColor + } + } + } + } + + Column { + id: infoColumn + anchors.verticalCenter: parent.verticalCenter + + readonly property real preferredWidth: Math.max(titleLabel.implicitWidth, artistLabel.implicitWidth, progressIndicator.implicitWidth) + width: ((artworkInfoItem.extraWidth > preferredWidth) || (paintOnly)) ? preferredWidth + : artworkInfoItem.extraWidth + + visible: width > 0 + + Widgets.MenuLabel { + id: titleLabel + + width: parent.width + + text: { + if (paintOnly) + i18n.qtr("Title") + else + mainPlaylistController.currentItem.title + } + color: colors.text + } + + Widgets.MenuCaption { + id: artistLabel + + width: parent.width + + text: { + if (paintOnly) + i18n.qtr("Artist") + else + mainPlaylistController.currentItem.artist + } + color: colors.menuCaption + } + + Widgets.MenuCaption { + id: progressIndicator + + width: parent.width + + text: { + if (paintOnly) + " -- / -- " + else + player.time.toString() + " / " + player.length.toString() + } + color: colors.menuCaption + } + } + } +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/AspectRatioWidget.qml b/modules/gui/qt/player/qml/controlbarcontrols/AspectRatioWidget.qml new file mode 100644 index 0000000000000000000000000000000000000000..1f3931e0328b7ea5b2d4dd9d32565c444453a295 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/AspectRatioWidget.qml @@ -0,0 +1,35 @@ +/***************************************************************************** + * Copyright (C) 2021 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.Layouts 1.11 + +import "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.ComboBoxExt { + property bool paintOnly: false + Layout.alignment: Qt.AlignVCenter + width: VLCStyle.combobox_width_normal + height: VLCStyle.combobox_height_normal + textRole: "display" + model: player.aspectRatio + currentIndex: -1 + onCurrentIndexChanged: model.toggleIndex(currentIndex) + Accessible.name: i18n.qtr("Aspect ratio") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/AtoBButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/AtoBButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..3ce378a88634931cadeda7978b8f44216d4b2c35 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/AtoBButton.qml @@ -0,0 +1,53 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: abBtn + + size: VLCStyle.icon_medium + checked: player.ABloopState !== PlayerController.ABLOOP_STATE_NONE + onClicked: player.toggleABloopState() + text: i18n.qtr("A to B") + + iconText: { + switch(player.ABloopState) { + case PlayerController.ABLOOP_STATE_A: return VLCIcons.atob_bg_b + case PlayerController.ABLOOP_STATE_B: return VLCIcons.atob_bg_none + case PlayerController.ABLOOP_STATE_NONE: return VLCIcons.atob_bg_ab + } + } + + Widgets.IconLabel { + anchors.centerIn: abBtn.contentItem + + color: abBtn.colors.accent + + text: { + switch(player.ABloopState) { + case PlayerController.ABLOOP_STATE_A: return VLCIcons.atob_fg_a + case PlayerController.ABLOOP_STATE_B: return VLCIcons.atob_fg_ab + case PlayerController.ABLOOP_STATE_NONE: return "" + } + } + } +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/BackButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/BackButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..da3d1071f42144c278ca7e869202fed1d30a63b6 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/BackButton.qml @@ -0,0 +1,30 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: backBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.exit + text: i18n.qtr("Back") + onClicked: history.previous() +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/ChapterNextButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/ChapterNextButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..307852491c8d3c3c6a4513755d400199a74ef149 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/ChapterNextButton.qml @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: chapterNextBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.dvd_next + onClicked: player.chapterNext() + enabled: player.hasChapters + text: i18n.qtr("Next chapter") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/ChapterPreviousButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/ChapterPreviousButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..f08d2eae2a7214491b826b41a6c60477f554f430 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/ChapterPreviousButton.qml @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: chapterPreviousBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.dvd_prev + onClicked: player.chapterPrev() + enabled: player.hasChapters + text: i18n.qtr("Previous chapter") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/ExpandingSpacerWidget.qml b/modules/gui/qt/player/qml/controlbarcontrols/ExpandingSpacerWidget.qml new file mode 100644 index 0000000000000000000000000000000000000000..ccef162970aaff9c4e3e6efc986353525b5d644a --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/ExpandingSpacerWidget.qml @@ -0,0 +1,51 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Item { + enabled: false + + implicitWidth: paintOnly ? VLCStyle.widthExtendedSpacer : extraWidth + implicitHeight: VLCStyle.icon_normal + + property bool paintOnly: false + property alias spacetextExt: spacetext + + readonly property real minimumWidth: 0 + property real extraWidth: 0 + + Label { + id: spacetext + anchors.centerIn: parent + + text: VLCIcons.space + color: VLCStyle.colors.buttonText + visible: paintOnly + + font.pixelSize: VLCIcons.pixelSize(VLCStyle.icon_medium) + font.family: VLCIcons.fontFamily + + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/ExtendedSettingsButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/ExtendedSettingsButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..a258188c2ea708f25dc04fe96de8f933fb02348a --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/ExtendedSettingsButton.qml @@ -0,0 +1,30 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: extdSettingsBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.extended + onClicked: dialogProvider.extendedDialog() + Accessible.name: i18n.qtr("Extended settings") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/FasterButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/FasterButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..d208560d4e743209cf71837c49b1e6fb5622ddee --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/FasterButton.qml @@ -0,0 +1,30 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: fasterBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.faster + onClicked: player.faster() + text: i18n.qtr("Faster") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/FrameButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/FrameButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..d35940d2fb6141be9b5405841ce0f2e82f761049 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/FrameButton.qml @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: frameBtn + size: VLCStyle.icon_medium + enabled: player.isPlaying + iconText: VLCIcons.frame_by_frame + onClicked: player.frameNext() + text: i18n.qtr("Next frame") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/FullscreenButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/FullscreenButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..b61414efc1834d589c5d969a5c6cf9d17b3aa0f4 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/FullscreenButton.qml @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: fullScreenBtn + size: VLCStyle.icon_medium + enabled: player.hasVideoOutput + iconText: player.fullscreen ? VLCIcons.defullscreen :VLCIcons.fullscreen + onClicked: player.fullscreen = !player.fullscreen + text: i18n.qtr("fullscreen") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/InfoButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/InfoButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..c6f40df40225f60fbe57357722fc2311850c82c9 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/InfoButton.qml @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: infoBtn + size: VLCStyle.icon_medium + enabled: player.isPlaying + iconText: VLCIcons.info + onClicked: dialogProvider.mediaInfoDialog() + text: i18n.qtr("Informations") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..37bc0e9ea4bcbd2465bf9b2a31ebf75ef5076ba8 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml @@ -0,0 +1,63 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" +import "qrc:///player/" as Player + + +Widgets.IconControlButton { + id: langBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.audiosub + + enabled: langMenuLoader.status === Loader.Ready + onClicked: langMenuLoader.item.open() + + text: i18n.qtr("Languages and tracks") + + Loader { + id: langMenuLoader + + active: (typeof rootPlayer !== 'undefined') && (rootPlayer !== null) + + sourceComponent: Player.LanguageMenu { + id: langMenu + + parent: rootPlayer + focus: true + x: 0 + y: (rootPlayer.positionSliderY - height) + z: 1 + + onOpened: { + controlButtons.requestLockUnlockAutoHide(true, controlButtons) + if (!!rootPlayer) + rootPlayer.menu = langMenu + } + + onClosed: { + controlButtons.requestLockUnlockAutoHide(false, controlButtons) + langBtn.forceActiveFocus() + if (!!rootPlayer) + rootPlayer.menu = undefined + } + } + } +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/LoopButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/LoopButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..61d7fa805116d16012c0131bd92b3f84fc2a04b5 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/LoopButton.qml @@ -0,0 +1,35 @@ +/***************************************************************************** + * Copyright (C) 2021 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 org.videolan.vlc 0.1 + +import "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: repeatBtn + size: VLCStyle.icon_medium + checked: mainPlaylistController.repeatMode !== PlaylistControllerModel.PLAYBACK_REPEAT_NONE + iconText: (mainPlaylistController.repeatMode === PlaylistControllerModel.PLAYBACK_REPEAT_CURRENT) + ? VLCIcons.repeat_one + : VLCIcons.repeat_all + onClicked: mainPlaylistController.toggleRepeatMode() + text: i18n.qtr("Repeat") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/MenuButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/MenuButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..ebbe88c26ad95a8af04d65c7154524dc689dcff1 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/MenuButton.qml @@ -0,0 +1,42 @@ +/***************************************************************************** + * Copyright (C) 2021 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 org.videolan.vlc 0.1 + +import "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: menuBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.ellipsis + text: i18n.qtr("Menu") + + onClicked: contextMenu.popup(this.mapToGlobal(0, 0)) + + QmlGlobalMenu { + id: contextMenu + + ctx: mainctx + + onAboutToShow: controlButtons.requestLockUnlockAutoHide(true, contextMenu) + onAboutToHide: controlButtons.requestLockUnlockAutoHide(false, contextMenu) + } +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/NextButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/NextButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..2e37ec078bfeabb5ebcf9698d15762d7218704f6 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/NextButton.qml @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: nextBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.next + enabled: mainPlaylistController.hasNext + onClicked: mainPlaylistController.next() + text: i18n.qtr("Next") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/OpenButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/OpenButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..fb7854de4ac1b5565592ae21792ba1ffe406f0a7 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/OpenButton.qml @@ -0,0 +1,30 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: openMediaBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.eject + onClicked: dialogProvider.openDialog() + text: i18n.qtr("Open media") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..bf411bcfad3a0cf416175782f22882cde8f12e4d --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml @@ -0,0 +1,217 @@ +/***************************************************************************** + * Copyright (C) 2021 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 QtGraphicalEffects 1.0 + +import org.videolan.vlc 0.1 + +import "qrc:///widgets/" as Widgets +import "qrc:///style/" +import "qrc:///util/Helpers.js" as Helpers + + +ToolButton { + id: playBtn + + width: VLCStyle.icon_medium + height: width + + scale: (playBtnMouseArea.pressed) ? 0.95 : 1.0 + + property VLCColors colors: VLCStyle.colors + + property color color: colors.buttonPlayIcon + + property color colorDisabled: colors.textInactive + + property bool paintOnly: false + + property bool isCursorInside: false + + Keys.onPressed: { + if (KeyHelper.matchOk(event) ) { + event.accepted = true + } + Navigation.defaultKeyAction(event) + } + Keys.onReleased: { + if (!event.accepted && KeyHelper.matchOk(event)) + mainPlaylistController.togglePlayPause() + } + + states: [ + State { + name: "hovered" + when: interactionIndicator + + PropertyChanges { + target: hoverShadow + radius: VLCStyle.dp(24, VLCStyle.scale) + } + }, + State { + name: "default" + when: !interactionIndicator + + PropertyChanges { + target: contentLabel + color: enabled ? playBtn.color : playBtn.colorDisabled + } + + PropertyChanges { + target: hoverShadow + radius: 0 + } + } + ] + readonly property bool interactionIndicator: (playBtn.activeFocus || playBtn.isCursorInside || playBtn.highlighted) + + contentItem: Label { + id: contentLabel + + text: (player.playingState !== PlayerController.PLAYING_STATE_PAUSED + && player.playingState !== PlayerController.PLAYING_STATE_STOPPED) + ? VLCIcons.pause + : VLCIcons.play + + Behavior on color { + ColorAnimation { + duration: VLCStyle.ms75 + easing.type: Easing.InOutSine + } + } + + font.pixelSize: VLCIcons.pixelSize(VLCStyle.icon_normal) + font.family: VLCIcons.fontFamily + + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } + + background: Item { + Gradient { + id: playBtnGradient + GradientStop { position: 0.0; color: VLCStyle.colors.buttonPlayA } + GradientStop { position: 1.0; color: VLCStyle.colors.buttonPlayB } + } + + MouseArea { + id: playBtnMouseArea + + anchors.fill: parent + anchors.margins: VLCStyle.dp(1, VLCStyle.scale) + + hoverEnabled: true + + readonly property int radius: playBtnMouseArea.width / 2 + + onPositionChanged: { + if (Helpers.pointInRadius( + (playBtnMouseArea.width / 2) - playBtnMouseArea.mouseX, + (playBtnMouseArea.height / 2) - playBtnMouseArea.mouseY, + radius)) { + // cursor is inside of the round button + playBtn.isCursorInside = true + } + else { + // cursor is outside + playBtn.isCursorInside = false + } + } + + onHoveredChanged: { + if (!playBtnMouseArea.containsMouse) + playBtn.isCursorInside = false + } + + onClicked: { + if (!playBtn.isCursorInside) + return + + mainPlaylistController.togglePlayPause() + } + + onPressAndHold: { + if (!playBtn.isCursorInside) + return + + mainPlaylistController.stop() + } + } + + DropShadow { + id: hoverShadow + + anchors.fill: parent + + visible: radius > 0 + samples: (radius * 2) + 1 + // opacity: 0.29 // it looks better without this + color: "#FF610A" + source: opacityMask + antialiasing: true + + Behavior on radius { + NumberAnimation { + duration: VLCStyle.ms75 + easing.type: Easing.InOutSine + } + } + } + + Rectangle { + radius: (width * 0.5) + anchors.fill: parent + anchors.margins: VLCStyle.dp(1, VLCStyle.scale) + + color: VLCStyle.colors.white + } + + Rectangle { + id: outerRect + anchors.fill: parent + + radius: (width * 0.5) + gradient: playBtnGradient + + visible: false + } + + Rectangle { + id: innerRect + anchors.fill: parent + + radius: (width * 0.5) + border.width: VLCStyle.dp(2, VLCStyle.scale) + + color: "transparent" + visible: false + } + + OpacityMask { + id: opacityMask + anchors.fill: parent + + source: outerRect + maskSource: innerRect + + antialiasing: true + } + } +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..d62d2dea8d8a3960d1af350055f35084d7c61433 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml @@ -0,0 +1,85 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" +import "qrc:///player/" as Player + + +Widgets.IconControlButton { + id: playbackSpeedButton + + size: VLCStyle.icon_medium + text: i18n.qtr("Playback Speed") + color: playbackSpeedPopup.visible ? colors.accent : colors.playerControlBarFg + + onClicked: playbackSpeedPopup.open() + + Player.PlaybackSpeed { + id: playbackSpeedPopup + + z: 1 + colors: playbackSpeedButton.colors + focus: true + parent: playbackSpeedButton.paintOnly + ? playbackSpeedButton // button is not part of main display (ToolbarEditorDialog) + : (history.current.view === "player") ? rootPlayer : g_mainDisplay + + onOpened: { + // update popup coordinates + // + // mapFromItem is affected by various properties of source and target objects + // which can't be represented in a binding expression so a initial setting in + // object defination (x: clamp(...)) doesn't work, so we set x and y on initial open + x = Qt.binding(function () { + // coords are mapped through playbackSpeedButton.parent so that binding is generated based on playbackSpeedButton.x + var mappedParentCoordinates = parent.mapFromItem(playbackSpeedButton.parent, playbackSpeedButton.x, 0) + return Helpers.clamp(mappedParentCoordinates.x - ((width - playbackSpeedButton.width) / 2), + VLCStyle.margin_xxsmall + VLCStyle.applicationHorizontalMargin, + parent.width - VLCStyle.applicationHorizontalMargin - VLCStyle.margin_xxsmall - width) + }) + + y = Qt.binding(function () { + // coords are mapped through playbackSpeedButton.parent so that binding is generated based on playbackSpeedButton.y + var mappedParentCoordinates = parent.mapFromItem(playbackSpeedButton.parent, 0, playbackSpeedButton.y) + return mappedParentCoordinates.y - playbackSpeedPopup.height - VLCStyle.margin_xxsmall + }) + + // player related -- + controlButtons.requestLockUnlockAutoHide(true, controlButtons) + if (!!rootPlayer) + rootPlayer.menu = playbackSpeedPopup + } + + onClosed: { + controlButtons.requestLockUnlockAutoHide(false, controlButtons) + playbackSpeedButton.forceActiveFocus() + if (!!rootPlayer) + rootPlayer.menu = undefined + } + } + + Label { + anchors.centerIn: parent + font.pixelSize: VLCStyle.fontSize_normal + text: !playbackSpeedButton.paintOnly ? i18n.qtr("%1x").arg(+player.rate.toFixed(2)) : i18n.qtr("1x") + color: playbackSpeedButton.background.foregroundColor // IconToolButton.background is a AnimatedBackground + } +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/PlayerSwitchButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/PlayerSwitchButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..534934fe3e73e5c5f8cb6ff223c534dfaf733cc8 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/PlayerSwitchButton.qml @@ -0,0 +1,36 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + size: VLCStyle.icon_medium + iconText: VLCIcons.fullscreen + + onClicked: { + if (history.current.view === "player") + history.previous() + else + g_mainDisplay.showPlayer() + } + + text: i18n.qtr("Switch Player") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/PlaylistButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/PlaylistButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..52affb96621161e2cf1b3c91fe5f99c64c2e7724 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/PlaylistButton.qml @@ -0,0 +1,36 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: playlistBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.playlist + onClicked: { + mainInterface.playlistVisible = !mainInterface.playlistVisible + if (mainInterface.playlistVisible && mainInterface.playlistDocked) { + playlistWidget.gainFocus(playlistBtn) + } + } + + text: i18n.qtr("Playlist") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/PreviousButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/PreviousButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..05e816b8f0081d0ec5eebb27a213c85aa9c4e540 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/PreviousButton.qml @@ -0,0 +1,30 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + +Widgets.IconControlButton { + id: prevBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.previous + enabled: mainPlaylistController.hasPrev + onClicked: mainPlaylistController.prev() + text: i18n.qtr("Previous") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/QuitButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/QuitButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..dd4fbff61cf4a65c6be65f080938037efadadf5c --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/QuitButton.qml @@ -0,0 +1,30 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: quitBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.clear + onClicked: mainInterface.close() + text: i18n.qtr("Quit") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/RandomButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/RandomButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..fa3836683a14b2c2aff91db04770238f4a0de9b3 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/RandomButton.qml @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: randomBtn + size: VLCStyle.icon_medium + checked: mainPlaylistController.random + iconText: VLCIcons.shuffle_on + onClicked: mainPlaylistController.toggleRandom() + text: i18n.qtr("Random") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/RecordButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/RecordButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..30e13024c054be629bcdb031d720043b7913c2d3 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/RecordButton.qml @@ -0,0 +1,32 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: recordBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.record + enabled: player.isPlaying + checked: player.isRecording + onClicked: player.toggleRecord() + text: i18n.qtr("record") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/SkipBackButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/SkipBackButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..63e7047c195cd52bb191aba86a83e393fd5261c0 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/SkipBackButton.qml @@ -0,0 +1,30 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: stepBackBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.skip_back + onClicked: player.jumpBwd() + text: i18n.qtr("Step back") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/SkipForwardButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/SkipForwardButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..dca66afd1a56305bb0708b9dfb069d77b89e1f44 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/SkipForwardButton.qml @@ -0,0 +1,30 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: stepfwdBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.skip_for + onClicked: player.jumpFwd() + text: i18n.qtr("Step forward") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/SlowerButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/SlowerButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..4f8b4a45cd1b51f549af23a4ab2d331149b10810 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/SlowerButton.qml @@ -0,0 +1,30 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: slowerBtn + size: VLCStyle.icon_medium + iconText: VLCIcons.slower + onClicked: player.slower() + text: i18n.qtr("Slower") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/SnapshotButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/SnapshotButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..f00666a3a0d77f65182c4aa2bd4fee93efd21da6 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/SnapshotButton.qml @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: snapshotBtn + size: VLCStyle.icon_medium + enabled: player.isPlaying + iconText: VLCIcons.snapshot + onClicked: player.snapshot() + text: i18n.qtr("Snapshot") +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/SpacerWidget.qml b/modules/gui/qt/player/qml/controlbarcontrols/SpacerWidget.qml new file mode 100644 index 0000000000000000000000000000000000000000..a87793ea55551a3bdaa0b6ec1b4ecf2a6730c397 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/SpacerWidget.qml @@ -0,0 +1,46 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Item { + id: spacer + enabled: false + implicitWidth: VLCStyle.icon_normal + implicitHeight: VLCStyle.icon_normal + property alias spacetextExt: spacetext + property bool paintOnly: false + Label { + id: spacetext + text: VLCIcons.space + color: VLCStyle.colors.buttonText + visible: parent.paintOnly + + anchors.centerIn: parent + + font.pixelSize: VLCIcons.pixelSize(VLCStyle.icon_medium) + font.family: VLCIcons.fontFamily + + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } +} diff --git a/modules/gui/qt/player/qml/controlbarcontrols/StopButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/StopButton.qml new file mode 100644 index 0000000000000000000000000000000000000000..53e6e4607d27e3ede3d36ef673c000eaf61ca1d1 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/StopButton.qml @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (C) 2021 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 "qrc:///widgets/" as Widgets +import "qrc:///style/" + + +Widgets.IconControlButton { + id: stopBtn + size: VLCStyle.icon_medium + enabled: player.isPlaying + iconText: VLCIcons.stop + onClicked: mainPlaylistController.stop() + text: i18n.qtr("Stop") +} diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc index dbcc48101d758c4c7a85ddab8ac063f6b9cea284..0a954dccd191102171bf393e6a2b847f73c4db7a 100644 --- a/modules/gui/qt/vlc.qrc +++ b/modules/gui/qt/vlc.qrc @@ -346,6 +346,39 @@ <file alias="ButtonsLayout.qml">player/qml/ButtonsLayout.qml</file> <file alias="PlaybackSpeed.qml">player/qml/PlaybackSpeed.qml</file> </qresource> + <qresource prefix="/player/controlbarcontrols"> + <file alias="ArtworkInfoWidget.qml">player/qml/controlbarcontrols/ArtworkInfoWidget.qml</file> + <file alias="AspectRatioWidget.qml">player/qml/controlbarcontrols/AspectRatioWidget.qml</file> + <file alias="AtoBButton.qml">player/qml/controlbarcontrols/AtoBButton.qml</file> + <file alias="BackButton.qml">player/qml/controlbarcontrols/BackButton.qml</file> + <file alias="ChapterNextButton.qml">player/qml/controlbarcontrols/ChapterNextButton.qml</file> + <file alias="ChapterPreviousButton.qml">player/qml/controlbarcontrols/ChapterPreviousButton.qml</file> + <file alias="ExpandingSpacerWidget.qml">player/qml/controlbarcontrols/ExpandingSpacerWidget.qml</file> + <file alias="ExtendedSettingsButton.qml">player/qml/controlbarcontrols/ExtendedSettingsButton.qml</file> + <file alias="FasterButton.qml">player/qml/controlbarcontrols/FasterButton.qml</file> + <file alias="FrameButton.qml">player/qml/controlbarcontrols/FrameButton.qml</file> + <file alias="FullscreenButton.qml">player/qml/controlbarcontrols/FullscreenButton.qml</file> + <file alias="InfoButton.qml">player/qml/controlbarcontrols/InfoButton.qml</file> + <file alias="LangButton.qml">player/qml/controlbarcontrols/LangButton.qml</file> + <file alias="LoopButton.qml">player/qml/controlbarcontrols/LoopButton.qml</file> + <file alias="MenuButton.qml">player/qml/controlbarcontrols/MenuButton.qml</file> + <file alias="NextButton.qml">player/qml/controlbarcontrols/NextButton.qml</file> + <file alias="OpenButton.qml">player/qml/controlbarcontrols/OpenButton.qml</file> + <file alias="PlaybackSpeedButton.qml">player/qml/controlbarcontrols/PlaybackSpeedButton.qml</file> + <file alias="PlayButton.qml">player/qml/controlbarcontrols/PlayButton.qml</file> + <file alias="PlayerSwitchButton.qml">player/qml/controlbarcontrols/PlayerSwitchButton.qml</file> + <file alias="PlaylistButton.qml">player/qml/controlbarcontrols/PlaylistButton.qml</file> + <file alias="PreviousButton.qml">player/qml/controlbarcontrols/PreviousButton.qml</file> + <file alias="QuitButton.qml">player/qml/controlbarcontrols/QuitButton.qml</file> + <file alias="RandomButton.qml">player/qml/controlbarcontrols/RandomButton.qml</file> + <file alias="RecordButton.qml">player/qml/controlbarcontrols/RecordButton.qml</file> + <file alias="SkipBackButton.qml">player/qml/controlbarcontrols/SkipBackButton.qml</file> + <file alias="SkipForwardButton.qml">player/qml/controlbarcontrols/SkipForwardButton.qml</file> + <file alias="SlowerButton.qml">player/qml/controlbarcontrols/SlowerButton.qml</file> + <file alias="SnapshotButton.qml">player/qml/controlbarcontrols/SnapshotButton.qml</file> + <file alias="SpacerWidget.qml">player/qml/controlbarcontrols/SpacerWidget.qml</file> + <file alias="StopButton.qml">player/qml/controlbarcontrols/StopButton.qml</file> + </qresource> <qresource prefix="/about"> <file alias="About.qml">dialogs/help/qml/About.qml</file> </qresource> diff --git a/po/POTFILES.in b/po/POTFILES.in index a61f30ecf29db2582674ebc51e058a1b46b40d42..5f2e8a800c5b04d263bb07bb003fd695ac7338a7 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -867,6 +867,37 @@ modules/gui/qt/player/qml/ResumeDialog.qml modules/gui/qt/player/qml/TeletextWidget.qml modules/gui/qt/player/qml/TopBar.qml modules/gui/qt/player/qml/VolumeWidget.qml +modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml +modules/gui/qt/player/qml/controlbarcontrols/AspectRatioWidget.qml +modules/gui/qt/player/qml/controlbarcontrols/AtoBButton.qml +modules/gui/qt/player/qml/controlbarcontrols/BackButton.qml +modules/gui/qt/player/qml/controlbarcontrols/ChapterNextButton.qml +modules/gui/qt/player/qml/controlbarcontrols/ChapterPreviousButton.qml +modules/gui/qt/player/qml/controlbarcontrols/ExpandingSpacerWidget.qml +modules/gui/qt/player/qml/controlbarcontrols/ExtendedSettingsButton.qml +modules/gui/qt/player/qml/controlbarcontrols/FasterButton.qml +modules/gui/qt/player/qml/controlbarcontrols/FrameButton.qml +modules/gui/qt/player/qml/controlbarcontrols/FullscreenButton.qml +modules/gui/qt/player/qml/controlbarcontrols/InfoButton.qml +modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml +modules/gui/qt/player/qml/controlbarcontrols/LoopButton.qml +modules/gui/qt/player/qml/controlbarcontrols/MenuButton.qml +modules/gui/qt/player/qml/controlbarcontrols/NextButton.qml +modules/gui/qt/player/qml/controlbarcontrols/OpenButton.qml +modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml +modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml +modules/gui/qt/player/qml/controlbarcontrols/PlayerSwitchButton.qml +modules/gui/qt/player/qml/controlbarcontrols/PlaylistButton.qml +modules/gui/qt/player/qml/controlbarcontrols/PreviousButton.qml +modules/gui/qt/player/qml/controlbarcontrols/QuitButton.qml +modules/gui/qt/player/qml/controlbarcontrols/RandomButton.qml +modules/gui/qt/player/qml/controlbarcontrols/RecordButton.qml +modules/gui/qt/player/qml/controlbarcontrols/SkipBackButton.qml +modules/gui/qt/player/qml/controlbarcontrols/SkipForwardButton.qml +modules/gui/qt/player/qml/controlbarcontrols/SlowerButton.qml +modules/gui/qt/player/qml/controlbarcontrols/SnapshotButton.qml +modules/gui/qt/player/qml/controlbarcontrols/SpacerWidget.qml +modules/gui/qt/player/qml/controlbarcontrols/StopButton.qml modules/gui/qt/playlist/qml/PlaylistDelegate.qml modules/gui/qt/playlist/qml/PlaylistDetachedWindow.qml modules/gui/qt/playlist/qml/PlaylistListView.qml