Browse Source

qml: remove 'Continue Watching' row from Video / All

Removed the recent videos row from the All sub-view of the Video
view. 'Continue Watching' row is now present in Home view.

Signed-off by: Ash <ashutoshv191@gmail.com>
pull/179/head
Ashutosh Verma 2 years ago
committed by Steve Lhomme
parent
commit
25108b481d
  1. 2
      modules/gui/qt/Makefile.am
  2. 18
      modules/gui/qt/medialibrary/qml/VideoAllDisplay.qml
  3. 36
      modules/gui/qt/medialibrary/qml/VideoAllSubDisplay.qml
  4. 164
      modules/gui/qt/medialibrary/qml/VideoRecentVideos.qml
  5. 56
      modules/gui/qt/medialibrary/qml/VideoRecentVideosDisplay.qml
  6. 2
      modules/gui/qt/meson.build
  7. 2
      po/POTFILES.in

2
modules/gui/qt/Makefile.am

@ -1039,8 +1039,6 @@ libqml_module_medialibrary_a_QML = \
medialibrary/qml/PlaylistMedia.qml \
medialibrary/qml/PlaylistMediaDisplay.qml \
medialibrary/qml/VideoPlaylistsDisplay.qml \
medialibrary/qml/VideoRecentVideos.qml \
medialibrary/qml/VideoRecentVideosDisplay.qml \
medialibrary/qml/VideoGridItem.qml \
medialibrary/qml/VideoInfoExpandPanel.qml \
medialibrary/qml/VideoListDisplay.qml \

18
modules/gui/qt/medialibrary/qml/VideoAllDisplay.qml

@ -43,9 +43,6 @@ Widgets.PageLoader {
}, {
name: "group",
component: componentGroup
}, {
name: "recentVideos",
component: componentRecentVideos
}]
// Events
@ -91,19 +88,4 @@ Widgets.PageLoader {
displayMarginEnd: g_mainDisplay.displayMargin
}
}
Component {
id: componentRecentVideos
VideoRecentVideosDisplay {
function isInfoExpandPanelAvailable(/* modelIndexData */) {
return true
}
listEnableEndFade: g_mainDisplay.hasMiniPlayer === false
displayMarginEnd: g_mainDisplay.displayMargin
}
}
}

36
modules/gui/qt/medialibrary/qml/VideoAllSubDisplay.qml

@ -82,7 +82,13 @@ VideoAll {
sectionProperty: _meta?.sectionProperty ?? ""
headerPositioning: headerItem.model.count > 0 ? ListView.InlineHeader : ListView.OverlayHeader
header: Widgets.ViewHeader {
view: root
visible: view.count > 0
text: qsTr("All")
}
// Functions
@ -259,32 +265,4 @@ VideoAll {
}
}
}
header: VideoRecentVideos {
width: root.width
nbItemPerRow: root.currentItem?.nbItemPerRow ?? 0
allVideosContentLeftMargin: root.currentItem?.contentLeftMargin ?? 0
allVideosContentRightMargin: root.currentItem?.contentRightMargin ?? 0
subtitleText: qsTr("Videos")
visible: (root.model?.count ?? 0) > 0
Navigation.parentItem: root
Navigation.downAction: function() {
currentItem.setCurrentItemFocus(Qt.TabFocusReason)
}
onImplicitHeightChanged: {
// implicitHeight depends on underlying ml model initialization
// and may update after view did resetFocus on initialization which
// will break resetFocus's scrolling (because header height changed)
// try to reapply reset focus here (ref #27071)
if (root.currentIndex <= 0 || root.currentIndex === root.initialIndex)
root.resetFocus()
}
}
}

164
modules/gui/qt/medialibrary/qml/VideoRecentVideos.qml

@ -1,164 +0,0 @@
/*****************************************************************************
* Copyright (C) 2019 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ( at your option ) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQml.Models
import VLC.MainInterface
import VLC.MediaLibrary
import VLC.Widgets as Widgets
import VLC.Util
import VLC.Style
FocusScope {
id: root
// properties
readonly property bool isSearchable: true
property alias subtitleText: subtitleLabel.text
property int leftPadding: VLCStyle.margin_xsmall
property int rightPadding: VLCStyle.margin_xsmall
property int nbItemPerRow
property int allVideosContentLeftMargin
property int allVideosContentRightMargin
property alias model: recentModel
// Settings
implicitHeight: recentVideosColumn.height
Navigation.navigable: recentModel.count > 0
function setCurrentItemFocus(reason) {
console.assert(root.Navigation.navigable)
if (reason === Qt.BacktabFocusReason)
view.setCurrentItemFocus(reason)
else
button.forceActiveFocus(reason)
}
// Childs
MLRecentVideoModel {
id: recentModel
ml: MediaLib
limit: MainCtx.gridView ? root.nbItemPerRow
: 5
searchPattern: MainCtx.search.pattern
}
readonly property ColorContext colorContext: ColorContext {
id: theme
colorSet: ColorContext.View
}
Column {
id: recentVideosColumn
width: root.width
topPadding: VLCStyle.layoutTitle_top_padding
Widgets.ViewHeader {
id: viewHeader
view: root
visible: recentModel.count > 0
seeAllButton.visible: recentModel.maximumCount > recentModel.count
Layout.fillWidth: true
leftPadding: view.currentItem?.contentLeftMargin ?? 0
rightPadding: view.currentItem?.contentRightMargin ?? 0
topPadding: 0
text: qsTr("Continue Watching")
onSeeAllButtonClicked: reason => History.push(["mc", "video", "all", "recentVideos"])
Navigation.parentItem: root
Navigation.downAction: function() {
view.setCurrentItemFocus(Qt.TabFocusReason)
}
}
VideoAll {
id: view
// Settings
visible: recentModel.count > 0
anchors {
left: parent.left
right: parent.right
leftMargin: root.leftPadding
rightMargin: root.rightPadding
}
height: currentItem?.contentHeight ?? 0
focus: true
model: recentModel
sectionProperty: ""
fadingEdgeList: false
sortModel: []
contextMenu: MLContextMenu {
model: recentModel
showPlayAsAudioAction: true
}
Navigation.parentItem: root
Navigation.upItem: viewHeader.seeAllButton
}
Widgets.ViewHeader {
id: subtitleLabel
view: root
leftPadding: allVideosContentLeftMargin
rightPadding: allVideosContentRightMargin
topPadding: recentModel.count > 0 ? (MainCtx.gridView ? VLCStyle.gridView_spacing :
VLCStyle.tableView_spacing)
: 0
text: view.title
}
}
}

56
modules/gui/qt/medialibrary/qml/VideoRecentVideosDisplay.qml

@ -1,56 +0,0 @@
/*****************************************************************************
* Copyright (C) 2023 VLC authors and VideoLAN
*
* Authors: Leon Vitanos <leon.vitanos@gmail.com>
*
* 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
import VLC.MediaLibrary
import VLC.Widgets as Widgets
import VLC.Style
import VLC.Util
import VLC.MainInterface
VideoAll {
id: root
// Settings
sectionProperty: ""
sortModel: []
isSearchable: false
// Children
model: MLRecentVideoModel {
id: recentModel
ml: MediaLib
}
contextMenu: MLContextMenu { model: recentModel; showPlayAsAudioAction: true }
header: Widgets.ViewHeader {
view: root
visible: view.count > 0
text: qsTr("Continue Watching")
}
}

2
modules/gui/qt/meson.build

@ -637,8 +637,6 @@ qml_modules += {
'medialibrary/qml/PlaylistMedia.qml',
'medialibrary/qml/PlaylistMediaDisplay.qml',
'medialibrary/qml/VideoPlaylistsDisplay.qml',
'medialibrary/qml/VideoRecentVideos.qml',
'medialibrary/qml/VideoRecentVideosDisplay.qml',
'medialibrary/qml/VideoGridItem.qml',
'medialibrary/qml/VideoInfoExpandPanel.qml',
'medialibrary/qml/VideoListDisplay.qml',

2
po/POTFILES.in

@ -794,8 +794,6 @@ modules/gui/qt/medialibrary/qml/VideoAll.qml
modules/gui/qt/medialibrary/qml/VideoAllDisplay.qml
modules/gui/qt/medialibrary/qml/VideoAllSubDisplay.qml
modules/gui/qt/medialibrary/qml/VideoDisplay.qml
modules/gui/qt/medialibrary/qml/VideoRecentVideos.qml
modules/gui/qt/medialibrary/qml/VideoRecentVideosDisplay.qml
modules/gui/qt/medialibrary/qml/VideoGridItem.qml
modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
modules/gui/qt/medialibrary/qml/VideoListDisplay.qml

Loading…
Cancel
Save