Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Code
Merge requests
1
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
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
Lyndon Brown
VLC
Commits
9cf9bd61
Commit
9cf9bd61
authored
3 years ago
by
Prince Gupta
Committed by
Hugo Beauzée-Luyssen
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
qml: select index on context button click in TableView
this way it mirrors the behaviour with GridViews
parent
93f1b08a
No related branches found
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/widgets/qml/TableViewDelegate.qml
+16
-10
16 additions, 10 deletions
modules/gui/qt/widgets/qml/TableViewDelegate.qml
with
16 additions
and
10 deletions
modules/gui/qt/widgets/qml/TableViewDelegate.qml
+
16
−
10
View file @
9cf9bd61
...
...
@@ -50,6 +50,15 @@ T.Control {
ListView.delayRemove
:
dragActive
function
selectAndFocus
(
modifiers
,
focusReason
)
{
selectionDelegateModel
.
updateSelection
(
modifiers
,
view
.
currentIndex
,
index
)
view
.
currentIndex
=
index
view
.
positionViewAtIndex
(
index
,
ListView
.
Contain
)
delegate
.
forceActiveFocus
(
focusReason
)
}
// Connections
Connections
{
...
...
@@ -104,14 +113,7 @@ T.Control {
onClicked
:
{
if
((
mouse
.
button
===
Qt
.
LeftButton
)
||
!
selectionDelegateModel
.
isSelected
(
root
.
model
.
index
(
index
,
0
)))
{
selectionDelegateModel
.
updateSelection
(
mouse
.
modifiers
,
view
.
currentIndex
,
index
)
view
.
positionViewAtIndex
(
index
,
ListView
.
Contain
)
view
.
currentIndex
=
index
delegate
.
forceActiveFocus
(
Qt
.
MouseFouseReason
)
delegate
.
selectAndFocus
(
mouse
.
modifiers
,
Qt
.
MouseFocusReason
)
}
if
(
mouse
.
button
===
Qt
.
RightButton
)
...
...
@@ -200,8 +202,12 @@ T.Control {
visible
:
delegate
.
hovered
onClicked
:
root
.
contextMenuButtonClicked
(
this
,
delegate
.
rowModel
,
contextButton
.
mapToGlobal
(
VLCStyle
.
margin_xsmall
,
contextButton
.
height
/
2
+
VLCStyle
.
fontHeight_normal
))
onClicked
:
{
delegate
.
selectAndFocus
(
Qt
.
NoModifier
,
Qt
.
MouseFocusReason
)
var
pos
=
contextButton
.
mapToGlobal
(
VLCStyle
.
margin_xsmall
,
contextButton
.
height
/
2
+
VLCStyle
.
fontHeight_normal
)
root
.
contextMenuButtonClicked
(
this
,
delegate
.
rowModel
,
pos
)
}
}
}
}
...
...
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