mirror of
https://github.com/YACReader/yacreader
synced 2025-07-29 10:25:14 -04:00
added default value for empty shortcuts "None"
autoload the actions in the first actions groups added to edit shortcuts dialog
This commit is contained in:
@ -57,13 +57,21 @@ QVariant ActionsShortcutsModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
}
|
||||
|
||||
if(role == Qt::ForegroundRole && index.column() == KEYS && actions[index.row()]->shortcut().isEmpty())
|
||||
return QBrush(QColor("#AAAAAA"));
|
||||
|
||||
if (role != Qt::DisplayRole)
|
||||
return QVariant();
|
||||
|
||||
if (index.column() == NAME)
|
||||
return QVariant(actions[index.row()]->toolTip());
|
||||
if (index.column() == KEYS)
|
||||
return QVariant(actions[index.row()]->shortcut().toString(QKeySequence::NativeText));
|
||||
{
|
||||
QKeySequence ks = actions[index.row()]->shortcut();
|
||||
if(ks.isEmpty())
|
||||
return tr("None");
|
||||
return QVariant(ks.toString(QKeySequence::NativeText));
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
Reference in New Issue
Block a user