Core: Dedicated lock/unlock icons for toolbar and documents view

This change enables us to have a variation of the lock icon for toolbars
and for non-toolbars. This gives removes the need for an outlined locked
icon which would work on dark and light backgrounds.

Change-Id: I5b825b11e892928515112f6f49b1b0639862bc42
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2016-04-02 01:44:19 +02:00
parent 051ac9dd0e
commit 14af79932a
9 changed files with 22 additions and 51 deletions

View File

@@ -413,11 +413,13 @@ void EditorToolBar::updateDocumentStatus(IDocument *document)
d->m_lockButton->setEnabled(false);
d->m_lockButton->setToolTip(QString());
} else if (document->isFileReadOnly()) {
d->m_lockButton->setIcon(DocumentModel::lockedIcon());
const static QIcon locked = Icons::LOCKED_TOOLBAR.icon();
d->m_lockButton->setIcon(locked);
d->m_lockButton->setEnabled(true);
d->m_lockButton->setToolTip(tr("Make Writable"));
} else {
d->m_lockButton->setIcon(DocumentModel::unlockedIcon());
const static QIcon unlocked = Icons::UNLOCKED_TOOLBAR.icon();
d->m_lockButton->setIcon(unlocked);
d->m_lockButton->setEnabled(false);
d->m_lockButton->setToolTip(tr("File is writable"));
}