Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
System
Dolphin
Commits
2cd1c07c
Commit
2cd1c07c
authored
Nov 17, 2020
by
Méven Car
Committed by
Elvis Angelaccio
Nov 23, 2020
Browse files
Places panel: highlight place only when it is displayed
BUG: 156678
FIXED-IN: 20.12
parent
d5a4835f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/panels/places/placespanel.cpp
View file @
2cd1c07c
...
...
@@ -77,7 +77,7 @@ bool PlacesPanel::urlChanged()
}
if
(
m_controller
)
{
select
Closest
Item
();
selectItem
();
}
return
true
;
...
...
@@ -139,7 +139,7 @@ void PlacesPanel::showEvent(QShowEvent* event)
layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
layout
->
addWidget
(
container
);
select
Closest
Item
();
selectItem
();
}
Panel
::
showEvent
(
event
);
...
...
@@ -293,7 +293,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos)
}
}
select
Closest
Item
();
selectItem
();
}
void
PlacesPanel
::
slotViewContextMenuRequested
(
const
QPointF
&
pos
)
...
...
@@ -361,7 +361,7 @@ void PlacesPanel::slotViewContextMenuRequested(const QPointF& pos)
}
}
select
Closest
Item
();
selectItem
();
}
QAction
*
PlacesPanel
::
buildGroupContextMenu
(
QMenu
*
menu
,
int
index
)
...
...
@@ -529,13 +529,17 @@ void PlacesPanel::editEntry(int index)
delete
dialog
;
}
void
PlacesPanel
::
select
Closest
Item
()
void
PlacesPanel
::
selectItem
()
{
const
int
index
=
m_model
->
closestItem
(
url
());
KItemListSelectionManager
*
selectionManager
=
m_controller
->
selectionManager
();
selectionManager
->
setCurrentItem
(
index
);
selectionManager
->
clearSelection
();
selectionManager
->
setSelected
(
index
);
const
QUrl
closestUrl
=
m_model
->
url
(
index
);
if
(
!
closestUrl
.
path
().
isEmpty
()
&&
url
()
==
closestUrl
)
{
selectionManager
->
setSelected
(
index
);
}
}
void
PlacesPanel
::
triggerItem
(
int
index
,
Qt
::
MouseButton
button
)
...
...
src/panels/places/placespanel.h
View file @
2cd1c07c
...
...
@@ -68,10 +68,10 @@ private:
void
editEntry
(
int
index
);
/**
* Selects the item that
has the closest URL for
the URL set
* Selects the item that
matches
the URL set
* for the panel (see Panel::setUrl()).
*/
void
select
Closest
Item
();
void
selectItem
();
void
triggerItem
(
int
index
,
Qt
::
MouseButton
button
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment