mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
TabTreeModel: Don't allow to move pinned tabs
This commit is contained in:
parent
85def54d3c
commit
dc8ddb03c1
@ -108,10 +108,15 @@ WebTab *TabTreeModel::tab(const QModelIndex &index) const
|
|||||||
|
|
||||||
Qt::ItemFlags TabTreeModel::flags(const QModelIndex &index) const
|
Qt::ItemFlags TabTreeModel::flags(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
if (!index.isValid()) {
|
TabTreeModelItem *it = item(index);
|
||||||
|
if (!it || !it->tab) {
|
||||||
return Qt::ItemIsDropEnabled;
|
return Qt::ItemIsDropEnabled;
|
||||||
}
|
}
|
||||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
|
Qt::ItemFlags flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||||
|
if (!it->tab->isPinned()) {
|
||||||
|
flags |= Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled;
|
||||||
|
}
|
||||||
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant TabTreeModel::data(const QModelIndex &index, int role) const
|
QVariant TabTreeModel::data(const QModelIndex &index, int role) const
|
||||||
|
Loading…
Reference in New Issue
Block a user