forked from qt-creator/qt-creator
Fixed disabled checkbox styles for plugin manager
Reviewed-by: jbache
This commit is contained in:
@@ -221,16 +221,13 @@ int PluginView::parsePluginSpecs(QTreeWidgetItem *parentItem, Qt::CheckState &gr
|
|||||||
++loadCount;
|
++loadCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_whitelist.contains(spec->name()))
|
if (!m_whitelist.contains(spec->name())) {
|
||||||
pluginItem->setData(C_LOAD, Qt::CheckStateRole, state);
|
pluginItem->setData(C_LOAD, Qt::CheckStateRole, state);
|
||||||
else {
|
} else {
|
||||||
QColor disabledColor = palette().color(QPalette::Disabled,QPalette::WindowText).lighter(120);
|
|
||||||
pluginItem->setData(C_LOAD, Qt::CheckStateRole, Qt::Checked);
|
pluginItem->setData(C_LOAD, Qt::CheckStateRole, Qt::Checked);
|
||||||
pluginItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
pluginItem->setFlags(Qt::ItemIsSelectable);
|
||||||
pluginItem->setSizeHint(C_LOAD, QSize(1,1));
|
|
||||||
pluginItem->setForeground(C_LOAD, QBrush(disabledColor)); // QBrush(Qt::white, Qt::NoBrush));
|
|
||||||
//pluginItem->setBackground(C_LOAD, QBrush(Qt::white, Qt::NoBrush));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginItem->setToolTip(C_LOAD, tr("Load on Startup"));
|
pluginItem->setToolTip(C_LOAD, tr("Load on Startup"));
|
||||||
|
|
||||||
m_specToItem.insert(spec, pluginItem);
|
m_specToItem.insert(spec, pluginItem);
|
||||||
@@ -333,7 +330,7 @@ void PluginView::updatePluginSettings(QTreeWidgetItem *item, int column)
|
|||||||
child->setData(C_LOAD, Qt::CheckStateRole, state);
|
child->setData(C_LOAD, Qt::CheckStateRole, state);
|
||||||
} else {
|
} else {
|
||||||
child->setData(C_LOAD, Qt::CheckStateRole, Qt::Checked);
|
child->setData(C_LOAD, Qt::CheckStateRole, Qt::Checked);
|
||||||
child->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
child->setFlags(Qt::ItemIsSelectable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updatePluginDependencies();
|
updatePluginDependencies();
|
||||||
@@ -347,6 +344,9 @@ void PluginView::updatePluginDependencies()
|
|||||||
{
|
{
|
||||||
foreach (PluginSpec *spec, PluginManager::instance()->loadQueue()) {
|
foreach (PluginSpec *spec, PluginManager::instance()->loadQueue()) {
|
||||||
bool disableIndirectly = false;
|
bool disableIndirectly = false;
|
||||||
|
if (m_whitelist.contains(spec->name()))
|
||||||
|
continue;
|
||||||
|
|
||||||
foreach(const PluginSpec *depSpec, spec->dependencySpecs()) {
|
foreach(const PluginSpec *depSpec, spec->dependencySpecs()) {
|
||||||
if (!depSpec->isEnabled() || depSpec->isDisabledIndirectly()) {
|
if (!depSpec->isEnabled() || depSpec->isDisabledIndirectly()) {
|
||||||
disableIndirectly = true;
|
disableIndirectly = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user