Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Finkel
VLC
Commits
e08eca22
Commit
e08eca22
authored
3 years ago
by
Benjamin Arnaud
Committed by
Hugo Beauzée-Luyssen
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
qml/PlaylistMediaDisplay: Update focus implementation
parent
fb11f5cc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml
+15
-25
15 additions, 25 deletions
modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml
with
15 additions
and
25 deletions
modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml
+
15
−
25
View file @
e08eca22
...
...
@@ -16,29 +16,27 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
import
QtQuick
2.11
import
QtQuick
2.11
import
QtQuick
.
Controls
2.4
import
QtQuick
.
Layouts
1.11
import
QtQml
.
Models
2.2
import
QtQuick
.
Layouts
1.11
import
QtQml
.
Models
2.2
import
org
.
videolan
.
medialib
0.1
import
org
.
videolan
.
vlc
0.1
import
"
qrc:///widgets/
"
as
Widgets
import
"
qrc:///main/
"
as
MainInterface
import
"
qrc:///util/
"
as
Util
import
"
qrc:///main/
"
as
MainInterface
import
"
qrc:///util/
"
as
Util
import
"
qrc:///style/
"
FocusScope
{
id
:
root
//---------------------------------------------------------------------------------------------
// Properties
//---------------------------------------------------------------------------------------------
readonly
property
bool
isViewMultiView
:
false
readonly
property
int
currentIndex
:
currentItem
.
currentIndex
readonly
property
int
currentIndex
:
view
.
currentIndex
property
int
initialIndex
:
0
property
variant
initialId
...
...
@@ -47,11 +45,9 @@ FocusScope {
// NOTE: Specify an optionnal header for the view.
property
Component
header
:
undefined
property
Item
headerItem
:
(
currentItem
)
?
currentItem
.
headerItem
:
undefined
property
Item
headerItem
:
view
.
headerItem
//---------------------------------------------------------------------------------------------
// Aliases
//---------------------------------------------------------------------------------------------
// NOTE: This is used to determine which media(s) shall be displayed.
property
alias
parentId
:
model
.
parentId
...
...
@@ -65,19 +61,15 @@ FocusScope {
property
alias
dragItem
:
dragItem
//---------------------------------------------------------------------------------------------
// Events
//---------------------------------------------------------------------------------------------
onModelChanged
:
resetFocus
()
onInitialIndexChanged
:
resetFocus
()
//---------------------------------------------------------------------------------------------
// Functions
//---------------------------------------------------------------------------------------------
function
setCurrentItemFocus
()
{
view
.
c
urrentItem
.
forceActiveFocus
()
}
function
setCurrentItemFocus
(
reason
)
{
view
.
setC
urrentItem
Focus
(
reason
);
}
function
resetFocus
()
{
if
(
model
.
count
===
0
)
return
...
...
@@ -89,11 +81,9 @@ FocusScope {
modelSelect
.
select
(
model
.
index
(
initialIndex
,
0
),
ItemSelectionModel
.
ClearAndSelect
);
if
(
currentItem
)
currentItem
.
positionViewAtIndex
(
initialIndex
,
ItemView
.
Contain
);
view
.
positionViewAtIndex
(
initialIndex
,
ItemView
.
Contain
);
}
//---------------------------------------------------------------------------------------------
// Events
function
onDelete
()
...
...
@@ -106,9 +96,7 @@ FocusScope {
model
.
remove
(
indexes
);
}
//---------------------------------------------------------------------------------------------
// Childs
//---------------------------------------------------------------------------------------------
MLPlaylistModel
{
id
:
model
...
...
@@ -122,7 +110,8 @@ FocusScope {
// from 'onModelReset' only ?
dragItem
.
Drag
.
cancel
();
if
(
count
===
0
||
modelSelect
.
hasSelection
)
return
;
if
(
count
===
0
||
modelSelect
.
hasSelection
)
return
;
resetFocus
();
}
...
...
@@ -187,7 +176,6 @@ FocusScope {
{
id
:
view
//-----------------------------------------------------------------------------------------
// Settings
anchors.left
:
parent
.
left
...
...
@@ -212,7 +200,8 @@ FocusScope {
headerPositioning
:
ListView
.
InlineHeader
Navigation.parentItem
:
root
Navigation.upItem
:
(
headerItem
)
?
headerItem
.
focus
:
null
Navigation.upItem
:
(
headerItem
)
?
headerItem
.
focusItem
:
null
Navigation.cancelAction
:
function
()
{
if
(
view
.
currentIndex
<=
0
)
{
root
.
Navigation
.
defaultNavigationCancel
()
...
...
@@ -222,7 +211,6 @@ FocusScope {
}
}
//-----------------------------------------------------------------------------------------
// Events
onContextMenuButtonClicked
:
contextMenu
.
popup
(
modelSelect
.
selectedIndexes
,
...
...
@@ -230,6 +218,8 @@ FocusScope {
onRightClick
:
contextMenu
.
popup
(
modelSelect
.
selectedIndexes
,
globalMousePos
)
// Keys
Keys.onDeletePressed
:
onDelete
()
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment