Commit 12bdfdb7 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.ImportManager: Adding setReadOnly to ImportLabel



Using disabled did not give any visible feedback.

Change-Id: I67bb9cd83c7d36c5899e40a91e9a6a34cb882ec4
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 96481561
......@@ -72,6 +72,16 @@ const Import ImportLabel::import() const
return m_import;
}
void ImportLabel::setReadOnly(bool readOnly) const
{
m_removeButton->setDisabled(readOnly);
if (readOnly) {
m_removeButton->setIcon(QIcon());
} else {
m_removeButton->setIcon(QIcon(Core::Constants::ICON_CLOSE_DOCUMENT));
}
}
void ImportLabel::emitRemoveImport()
{
emit removeImport(m_import);
......
......@@ -45,6 +45,7 @@ public:
void setImport(const Import &import);
const Import import() const;
void setReadOnly(bool) const;
signals:
void removeImport(const Import &import);
......
......@@ -78,7 +78,7 @@ void ImportsWidget::removePossibleImports()
void ImportsWidget::setUsedImports(const QList<Import> &usedImports)
{
foreach (ImportLabel *importLabel, m_importLabels)
importLabel->setDisabled(usedImports.contains(importLabel->import()));
importLabel->setReadOnly(usedImports.contains(importLabel->import()));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment