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
Multimedia
Kdenlive
Commits
4b35cfaf
Commit
4b35cfaf
authored
Dec 08, 2020
by
Jean-Baptiste Mardelle
Browse files
Don't change Bin horizontal scrolling when focusing an item
parent
1f798a90
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/bin.cpp
View file @
4b35cfaf
...
...
@@ -881,7 +881,7 @@ Bin::Bin(std::shared_ptr<ProjectItemModel> model, QWidget *parent)
// focus last selected item when clearing search line
QModelIndex
current
=
m_proxyModel
->
selectionModel
()
->
currentIndex
();
if
(
current
.
isValid
())
{
m_itemView
->
scrollTo
(
current
,
QAbstractItemView
::
PositionAtCenter
);
m_itemView
->
scrollTo
(
current
,
QAbstractItemView
::
EnsureVisible
);
}
}
});
...
...
@@ -1857,7 +1857,7 @@ void Bin::slotAddFolder()
auto
ix
=
m_itemModel
->
getIndexFromItem
(
folder
);
// Scroll to ensure folder is visible
m_itemView
->
scrollTo
(
m_proxyModel
->
mapFromSource
(
ix
),
QAbstractItemView
::
PositionAtCenter
);
m_itemView
->
scrollTo
(
m_proxyModel
->
mapFromSource
(
ix
),
QAbstractItemView
::
EnsureVisible
);
qDebug
()
<<
"selecting"
<<
ix
;
if
(
ix
.
isValid
())
{
qDebug
()
<<
"ix valid"
;
...
...
@@ -1919,7 +1919,7 @@ void Bin::selectClipById(const QString &clipId, int frame, const QPoint &zone)
if
(
id
.
isValid
()
&&
id2
.
isValid
())
{
m_proxyModel
->
selectionModel
()
->
select
(
QItemSelection
(
m_proxyModel
->
mapFromSource
(
id
),
m_proxyModel
->
mapFromSource
(
id2
)),
QItemSelectionModel
::
SelectCurrent
);
}
m_itemView
->
scrollTo
(
m_proxyModel
->
mapFromSource
(
ix
),
QAbstractItemView
::
PositionAtCenter
);
m_itemView
->
scrollTo
(
m_proxyModel
->
mapFromSource
(
ix
),
QAbstractItemView
::
EnsureVisible
);
}
}
else
{
m_proxyModel
->
selectionModel
()
->
clearSelection
();
...
...
@@ -2661,7 +2661,7 @@ void Bin::selectClip(const std::shared_ptr<ProjectClip> &clip)
auto
*
view
=
static_cast
<
QTreeView
*>
(
m_itemView
);
view
->
expand
(
m_proxyModel
->
mapFromSource
(
ix
.
parent
()));
}
m_itemView
->
scrollTo
(
m_proxyModel
->
mapFromSource
(
ix
),
QAbstractItemView
::
PositionAtCenter
);
m_itemView
->
scrollTo
(
m_proxyModel
->
mapFromSource
(
ix
),
QAbstractItemView
::
EnsureVisible
);
}
void
Bin
::
slotOpenCurrent
()
...
...
@@ -3290,7 +3290,7 @@ void Bin::slotItemDropped(const QList<QUrl> &urls, const QModelIndex &parent)
std
::
shared_ptr
<
AbstractProjectItem
>
item
=
m_itemModel
->
getItemByBinId
(
id
);
if
(
item
)
{
QModelIndex
ix
=
m_itemModel
->
getIndexFromItem
(
item
);
m_itemView
->
scrollTo
(
m_proxyModel
->
mapFromSource
(
ix
),
QAbstractItemView
::
PositionAtCenter
);
m_itemView
->
scrollTo
(
m_proxyModel
->
mapFromSource
(
ix
),
QAbstractItemView
::
EnsureVisible
);
}
}
}
...
...
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