forked from qt-creator/qt-creator
Improve icon and label behavior for target selector
I modified the text margins, removed the inconsistent "No project" label and made sure we fall back to the default computer icon when no project is open.
This commit is contained in:
@@ -227,13 +227,13 @@ QSize FancyToolButton::sizeHint() const
|
|||||||
QFontMetrics fm(boldFont);
|
QFontMetrics fm(boldFont);
|
||||||
qreal lineHeight = fm.height();
|
qreal lineHeight = fm.height();
|
||||||
const QString projectName = defaultAction()->property("heading").toString();
|
const QString projectName = defaultAction()->property("heading").toString();
|
||||||
buttonSize += QSizeF(0, 4);
|
buttonSize += QSizeF(0, 10);
|
||||||
if (!projectName.isEmpty())
|
if (!projectName.isEmpty())
|
||||||
buttonSize += QSizeF(0, lineHeight + 6);
|
buttonSize += QSizeF(0, lineHeight + 2);
|
||||||
|
|
||||||
const QString buildConfiguration = defaultAction()->property("subtitle").toString();
|
const QString buildConfiguration = defaultAction()->property("subtitle").toString();
|
||||||
if (!buildConfiguration.isEmpty())
|
if (!buildConfiguration.isEmpty())
|
||||||
buttonSize += QSizeF(0, lineHeight + 6);
|
buttonSize += QSizeF(0, lineHeight + 2);
|
||||||
}
|
}
|
||||||
return buttonSize.toSize();
|
return buttonSize.toSize();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -550,12 +550,12 @@ void MiniProjectTargetSelector::updateAction()
|
|||||||
{
|
{
|
||||||
Project *project = ProjectExplorerPlugin::instance()->startupProject();
|
Project *project = ProjectExplorerPlugin::instance()->startupProject();
|
||||||
|
|
||||||
QString projectName = tr("No Project");
|
QString projectName;;
|
||||||
QString targetName;
|
QString targetName;
|
||||||
QString targetToolTipText;
|
QString targetToolTipText;
|
||||||
QIcon targetIcon;
|
|
||||||
QString buildConfig;
|
QString buildConfig;
|
||||||
QString runConfig;
|
QString runConfig;
|
||||||
|
QIcon targetIcon = style()->standardIcon(QStyle::SP_ComputerIcon);
|
||||||
|
|
||||||
if (project) {
|
if (project) {
|
||||||
projectName = project->displayName();
|
projectName = project->displayName();
|
||||||
|
|||||||
Reference in New Issue
Block a user