Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions qml/FullscreenFrame.qml
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,7 @@ InputEventItem {
folderId: 0
}
sortRole: ItemArrangementProxyModel.IndexInPageRole
Component.onCompleted: {
proxyModel.sort(0)
}
sortColumn: 0
}

MouseArea {
Expand Down Expand Up @@ -666,6 +664,9 @@ InputEventItem {
}
}
Component.onCompleted: {
if (LauncherController.currentFrame === "FullscreenFrame") {
itemMoveTransition.enabled = true
}
gridViewContainer.checkPageSwitchState()
}
Component.onDestruction: {
Expand Down
18 changes: 18 additions & 0 deletions src/models/sortproxymodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,24 @@ void SortProxyModel::setSortRole(int role)
}
}

void SortProxyModel::setSortColumn(int column)
{
if (m_sortColumn != column)
{
int oldColumn = m_sortColumn;
m_sortColumn = column;
Q_EMIT sortColumnChanged();

// If source model is already set, reorder to apply the new sort column
if (sourceModel() && !m_proxyToSourceMap.empty())
{
reorder();
}

Q_UNUSED(oldColumn)
}
}

int SortProxyModel::sortRole() const
{
return m_sortRole;
Expand Down
5 changes: 4 additions & 1 deletion src/models/sortproxymodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ class SortProxyModelTest;
* of the API, so if you used QSortFilterProxyModel only for sorting it
* should be a drop-in replacement.
*
* @note BLumia: Currently, sort() needs to be called manually
* @note sortColumn can be set declaratively in QML to enable
* initial sorting during model reset (no move signals emitted).
*/
class SortProxyModel : public QAbstractProxyModel
{
Q_OBJECT
Q_PROPERTY(int sortRole READ sortRole WRITE setSortRole NOTIFY sortRoleChanged)
Q_PROPERTY(int sortColumn READ sortColumn WRITE setSortColumn NOTIFY sortColumnChanged)
QML_ELEMENT

public:
Expand All @@ -60,6 +62,7 @@ class SortProxyModel : public QAbstractProxyModel
public:
void setSortRole(int role);
int sortRole() const;
void setSortColumn(int column);
void setSortCaseSensitivity(Qt::CaseSensitivity sensitivity);
Qt::CaseSensitivity sortCaseSensitivity() const;
int sortColumn() const;
Expand Down
Loading