From c4d1553da4553da65ea7877af6ae7441528f1134 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Thu, 21 Jan 2010 21:12:40 +0100 Subject: [PATCH] Add first version of a new sidebar, including project selector. The project selector also allows to select targets. However, this is not yet used, since the necessary changes are still being stabilized. Done-with: con --- src/plugins/coreplugin/coreimpl.cpp | 7 + src/plugins/coreplugin/coreimpl.h | 1 + src/plugins/coreplugin/fancyactionbar.cpp | 196 +++++++----- src/plugins/coreplugin/fancyactionbar.h | 5 +- src/plugins/coreplugin/fancyactionbar.qrc | 3 + src/plugins/coreplugin/icore.h | 2 + .../coreplugin/images/button_top_outline.png | Bin 0 -> 411 bytes .../images/fancytoolbutton_bottom_outline.png | Bin 0 -> 1811 bytes .../images/fancytoolbutton_normal_outline.png | Bin 0 -> 2407 bytes .../images/fancytoolbutton_top_outline.png | Bin 0 -> 411 bytes src/plugins/coreplugin/modemanager.cpp | 5 + src/plugins/coreplugin/modemanager.h | 3 + .../projectexplorer/metatypedeclarations.h | 1 - .../miniprojecttargetselector.cpp | 289 ++++++++++++++++++ .../miniprojecttargetselector.h | 102 +++++++ src/plugins/projectexplorer/project.h | 2 + .../projectexplorer/projectexplorer.cpp | 40 ++- src/plugins/projectexplorer/projectexplorer.h | 6 +- .../projectexplorer/projectexplorer.pro | 2 + 19 files changed, 581 insertions(+), 83 deletions(-) create mode 100644 src/plugins/coreplugin/images/button_top_outline.png create mode 100644 src/plugins/coreplugin/images/fancytoolbutton_bottom_outline.png create mode 100644 src/plugins/coreplugin/images/fancytoolbutton_normal_outline.png create mode 100644 src/plugins/coreplugin/images/fancytoolbutton_top_outline.png create mode 100644 src/plugins/projectexplorer/miniprojecttargetselector.cpp create mode 100644 src/plugins/projectexplorer/miniprojecttargetselector.h diff --git a/src/plugins/coreplugin/coreimpl.cpp b/src/plugins/coreplugin/coreimpl.cpp index 643cc4c5f0b..65916f8cac2 100644 --- a/src/plugins/coreplugin/coreimpl.cpp +++ b/src/plugins/coreplugin/coreimpl.cpp @@ -33,6 +33,8 @@ #include #include +#include + namespace Core { namespace Internal { @@ -179,6 +181,11 @@ QMainWindow *CoreImpl::mainWindow() const return m_mainwindow; } +QStatusBar *CoreImpl::statusBar() const +{ + return m_mainwindow->statusBar(); +} + // adds and removes additional active contexts, this context is appended to the // currently active contexts. call updateContext after changing void CoreImpl::addAdditionalContext(int context) diff --git a/src/plugins/coreplugin/coreimpl.h b/src/plugins/coreplugin/coreimpl.h index dd3a7d831e8..6e0540ec047 100644 --- a/src/plugins/coreplugin/coreimpl.h +++ b/src/plugins/coreplugin/coreimpl.h @@ -79,6 +79,7 @@ public: IContext *currentContextObject() const; QMainWindow *mainWindow() const; + QStatusBar *statusBar() const; // adds and removes additional active contexts, this context is appended to the // currently active contexts. call updateContext after changing diff --git a/src/plugins/coreplugin/fancyactionbar.cpp b/src/plugins/coreplugin/fancyactionbar.cpp index bcb75b6dc7c..18bca72f99c 100644 --- a/src/plugins/coreplugin/fancyactionbar.cpp +++ b/src/plugins/coreplugin/fancyactionbar.cpp @@ -1,4 +1,4 @@ -/************************************************************************** +/********************Q****************************************************** ** ** This file is part of Qt Creator ** @@ -29,53 +29,25 @@ #include "fancyactionbar.h" +#include + +#include +#include + #include #include #include #include -#include #include +#include +#include +#include using namespace Core; using namespace Internal; -static const char* const svgIdButtonBase = "ButtonBase"; -static const char* const svgIdButtonNormalBase = "ButtonNormalBase"; -static const char* const svgIdButtonNormalOverlay = "ButtonNormalOverlay"; -static const char* const svgIdButtonPressedBase = "ButtonPressedBase"; -static const char* const svgIdButtonPressedOverlay = "ButtonPressedOverlay"; -static const char* const svgIdButtonDisabledOverlay = "ButtonDisabledOverlay"; -static const char* const svgIdButtonHoverOverlay = "ButtonHoverOverlay"; - -static const char* const elementsSvgIds[] = { - svgIdButtonBase, - svgIdButtonNormalBase, - svgIdButtonNormalOverlay, - svgIdButtonPressedBase, - svgIdButtonPressedOverlay, - svgIdButtonDisabledOverlay, - svgIdButtonHoverOverlay -}; - -const QMap &buttonElementsMap() -{ - static QMap result; - if (result.isEmpty()) { - QSvgRenderer renderer(QLatin1String(":/fancyactionbar/images/fancytoolbutton.svg")); - for (size_t i = 0; i < sizeof(elementsSvgIds)/sizeof(elementsSvgIds[0]); i++) { - QString elementId(elementsSvgIds[i]); - QPicture elementPicture; - QPainter elementPainter(&elementPicture); - renderer.render(&elementPainter, elementId); - result.insert(elementId, elementPicture); - } - } - return result; -} - FancyToolButton::FancyToolButton(QWidget *parent) : QToolButton(parent) - , m_buttonElements(buttonElementsMap()) { setAttribute(Qt::WA_Hover, true); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); @@ -85,40 +57,99 @@ void FancyToolButton::paintEvent(QPaintEvent *event) { Q_UNUSED(event) QPainter p(this); - QSize sh(sizeHint()); - double scale = (double)height() / sh.height(); - if (scale < 1) { - p.save(); - p.scale(1, scale); - } - p.drawPicture(0, 0, m_buttonElements.value(svgIdButtonBase)); - p.drawPicture(0, 0, m_buttonElements.value(isDown() ? svgIdButtonPressedBase : svgIdButtonNormalBase)); + + QLayout *parentLayout = qobject_cast(parentWidget())->actionsLayout(); + int lineHeight = fontMetrics().height(); + bool isTitledAction = defaultAction()->property("titledAction").toBool(); + #ifndef Q_WS_MAC // Mac UIs usually don't hover - if (underMouse() && isEnabled()) - p.drawPicture(0, 0, m_buttonElements.value(svgIdButtonHoverOverlay)); + if (underMouse() && isEnabled() && !isDown()) { + QColor whiteOverlay(Qt::white); + whiteOverlay.setAlpha(20); + p.fillRect(rect().adjusted(1, 1, -1, -1), whiteOverlay); + } #endif - if (scale < 1) - p.restore(); - - if (!icon().isNull()) { - icon().paint(&p, rect()); - } else { - const int margin = 4; - p.drawText(rect().adjusted(margin, margin, -margin, -margin), Qt::AlignCenter | Qt::TextWordWrap, text()); - + if (isDown()) { + QColor whiteOverlay(Qt::black); + whiteOverlay.setAlpha(20); + p.fillRect(rect().adjusted(1, 1, -1, -1), whiteOverlay); } - if (scale < 1) { - p.scale(1, scale); + QPixmap borderPixmap; + QMargins margins; + if (parentLayout && parentLayout->count() > 0 && + parentLayout->itemAt(parentLayout->count()-1)->widget() == this) { + margins = QMargins(3, 3, 2, 0); + borderPixmap = QPixmap( + QLatin1String(":/fancyactionbar/images/fancytoolbutton_bottom_outline.png")); + } else if (parentLayout && parentLayout->count() > 0 && + parentLayout->itemAt(0)->widget() == this) { + margins = QMargins(3, 3, 2, 3); + borderPixmap = QPixmap( + QLatin1String(":/fancyactionbar/images/fancytoolbutton_top_outline.png")); + } else { + margins = QMargins(3, 3, 2, 0); + borderPixmap = QPixmap( + QLatin1String(":/fancyactionbar/images/fancytoolbutton_normal_outline.png")); + } + + QRect drawRect = rect(); + qDrawBorderPixmap(&p, drawRect, margins, borderPixmap); + + QPixmap pix = icon().pixmap(size() - QSize(15, 15), isEnabled() ? QIcon::Normal : QIcon::Disabled); + QPoint center = rect().center(); + QSize halfPixSize = pix.size()/2; + + p.drawPixmap(center-QPoint(halfPixSize.width()-1, halfPixSize.height()-1), pix); + + if (popupMode() == QToolButton::DelayedPopup && !isTitledAction) { + QPoint arrowOffset = center + QPoint(pix.rect().width()/2, pix.rect().height()/2); + QStyleOption opt; + if (isEnabled()) + opt.state &= QStyle::State_Enabled; + else + opt.state |= QStyle::State_Enabled; + opt.rect = QRect(arrowOffset.x(), arrowOffset.y(), 6, 6); + style()->drawPrimitive(QStyle::PE_IndicatorArrowDown, + &opt, &p, this); } - if (isEnabled()) { - p.drawPicture(0, 0, m_buttonElements.value(isDown() ? - svgIdButtonPressedOverlay : svgIdButtonNormalOverlay)); - } else { - p.drawPicture(0, 0, m_buttonElements.value(svgIdButtonDisabledOverlay)); + if (isTitledAction) { + QRect r(0, lineHeight/2, rect().width(), lineHeight); + QColor penColor; + if (isEnabled()) + penColor = Qt::white; + else + penColor = Qt::gray; + p.setPen(penColor); + const QString projectName = defaultAction()->property("heading").toString(); + QFont f = font(); + f.setPointSize(f.pointSize()-1); + p.setFont(f); + QFontMetrics fm(f); + QString ellidedProjectName = fm.elidedText(projectName, Qt::ElideMiddle, r.width()); + if (isEnabled()) { + const QRect shadowR = r.translated(0, 1); + p.setPen(Qt::black); + p.drawText(shadowR, Qt::AlignVCenter|Qt::AlignHCenter, ellidedProjectName); + p.setPen(penColor); + } + p.drawText(r, Qt::AlignVCenter|Qt::AlignHCenter, ellidedProjectName); + r = QRect(0, rect().bottom()-lineHeight*1.5, rect().width(), lineHeight); + const QString buildConfiguration = defaultAction()->property("subtitle").toString(); + f.setBold(true); + p.setFont(f); + QString ellidedBuildConfiguration = fm.elidedText(buildConfiguration, Qt::ElideMiddle, r.width()); + if (isEnabled()) { + const QRect shadowR = r.translated(0, 1); + p.setPen(Qt::black); + p.drawText(shadowR, Qt::AlignVCenter|Qt::AlignHCenter, ellidedBuildConfiguration); + p.setPen(penColor); + } + p.drawText(r, Qt::AlignVCenter|Qt::AlignHCenter, ellidedBuildConfiguration); } + } void FancyActionBar::paintEvent(QPaintEvent *event) @@ -128,7 +159,12 @@ void FancyActionBar::paintEvent(QPaintEvent *event) QSize FancyToolButton::sizeHint() const { - return m_buttonElements.value(svgIdButtonBase).boundingRect().size(); + QSize buttonSize = iconSize().expandedTo(QSize(64, 40)); + if (defaultAction()->property("titledAction").toBool()) { + int lineHeight = fontMetrics().height(); + buttonSize += QSize(0, lineHeight*4); + } + return buttonSize; } QSize FancyToolButton::minimumSizeHint() const @@ -149,13 +185,30 @@ FancyActionBar::FancyActionBar(QWidget *parent) { m_actionsLayout = new QVBoxLayout; - QHBoxLayout *centeringLayout = new QHBoxLayout; - centeringLayout->addStretch(); - centeringLayout->addLayout(m_actionsLayout); - centeringLayout->addStretch(); - setLayout(centeringLayout); + QVBoxLayout *spacerLayout = new QVBoxLayout; + spacerLayout->addLayout(m_actionsLayout); + int sbh = ICore::instance()->statusBar()->height(); + spacerLayout->addSpacing(sbh); + spacerLayout->setMargin(0); + spacerLayout->setSpacing(0); + + QHBoxLayout *orientRightLayout = new QHBoxLayout; + orientRightLayout->addStretch(); + orientRightLayout->setMargin(0); + orientRightLayout->setSpacing(0); + orientRightLayout->setContentsMargins(0, 0, 1, 0); + orientRightLayout->addLayout(spacerLayout); + setLayout(orientRightLayout); } +void FancyActionBar::addProjectSelector(QAction *action) +{ + FancyToolButton* toolButton = new FancyToolButton(this); + toolButton->setDefaultAction(action); + connect(action, SIGNAL(changed()), toolButton, SLOT(actionChanged())); + m_actionsLayout->insertWidget(0, toolButton); + +} void FancyActionBar::insertAction(int index, QAction *action, QMenu *menu) { FancyToolButton *toolButton = new FancyToolButton(this); @@ -187,3 +240,8 @@ void FancyActionBar::toolButtonContextMenuActionTriggered(QAction* action) button->defaultAction()->trigger(); } } + +QLayout *FancyActionBar::actionsLayout() const +{ + return m_actionsLayout; +} diff --git a/src/plugins/coreplugin/fancyactionbar.h b/src/plugins/coreplugin/fancyactionbar.h index 0f4f853e3a6..ad7807d9357 100644 --- a/src/plugins/coreplugin/fancyactionbar.h +++ b/src/plugins/coreplugin/fancyactionbar.h @@ -54,9 +54,6 @@ public: private slots: void actionChanged(); - -private: - const QMap &m_buttonElements; }; class FancyActionBar : public QWidget @@ -68,6 +65,8 @@ public: void paintEvent(QPaintEvent *event); void insertAction(int index, QAction *action, QMenu *menu = 0); + void addProjectSelector(QAction *action); + QLayout *actionsLayout() const; private slots: void toolButtonContextMenuActionTriggered(QAction*); diff --git a/src/plugins/coreplugin/fancyactionbar.qrc b/src/plugins/coreplugin/fancyactionbar.qrc index 1d46626955e..f71f5d851de 100644 --- a/src/plugins/coreplugin/fancyactionbar.qrc +++ b/src/plugins/coreplugin/fancyactionbar.qrc @@ -6,5 +6,8 @@ images/mode_Output.png images/mode_Project.png images/mode_Reference.png + images/fancytoolbutton_bottom_outline.png + images/fancytoolbutton_normal_outline.png + images/fancytoolbutton_top_outline.png diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index de991cce82c..56851d655d7 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -40,6 +40,7 @@ QT_BEGIN_NAMESPACE class QMainWindow; class QPrinter; class QSettings; +class QStatusBar; template class QList; QT_END_NAMESPACE @@ -104,6 +105,7 @@ public: virtual QString resourcePath() const = 0; virtual QMainWindow *mainWindow() const = 0; + virtual QStatusBar *statusBar() const = 0; // adds and removes additional active contexts, this context is appended to the // currently active contexts. call updateContext after changing diff --git a/src/plugins/coreplugin/images/button_top_outline.png b/src/plugins/coreplugin/images/button_top_outline.png new file mode 100644 index 0000000000000000000000000000000000000000..edb50687ce30f063d513ec9548ba1d253bdb655e GIT binary patch literal 411 zcmeAS@N?(olHy`uVBq!ia0y~yU~p$(V9?=UV_;w~Z(iEQz`(#*9OUlAuqS<1(9I25lPs}rzJZeT4-owUV+{mQBIDf{x9G-gk#-SFniyhI6|V=HoR zPbr=@vzF(igZ{%iY#~Y%%`TVtem&L{x5fmjJvny%9!h+ zrLn8mWmmp8^}XzUSSI+0#MNzUoj4BIJX$j4-SRe@2QzLi=bj-`puoT`Q*eM0Otd#J m^I1HA5fCwSi9g@>Foym!TekO!+X)5+1_n=8KbLh*2~7a*TBB3| literal 0 HcmV?d00001 diff --git a/src/plugins/coreplugin/images/fancytoolbutton_bottom_outline.png b/src/plugins/coreplugin/images/fancytoolbutton_bottom_outline.png new file mode 100644 index 0000000000000000000000000000000000000000..6cb32d87e3ef84253f4c924e4d8b59610f096b9b GIT binary patch literal 1811 zcmeAS@N?(olHy`uVBq!ia0y~yU~p$(V9@7aV_;y|D1Kdofq{XsILO_JVcj{ImkbOH zY)RhkE)4%caKYZ?lNlHoI14-?iy0XBtr!^ig&0qzlx8q6FtC?+`ns~;Vie+6vB=tP z>%qXlAX(xXQR1ARo12W zI)f(~n_MnN250lLOqikAZu5T6^SQ={l|R3_s$Ki@lWOHWVW$HUhZpIb3-9m#{Pb7p zciri;zih3#ziXFT?X|tLx0XHL+I)~f@E~(aWLt5cif0yYY`V+c?p*8j(jB=Ea;p1t zkLNy^l3K}mF2NwdZhpLJo|I>HuJSh%*6o@XO24lDyY_W<^xao`fB*j7BA|DWQ*pv` z%gTAPbKP>XS0|szx|{T6+s@Ft8s>}(&$X3aZxt{(R>A3a+cot1s|g)fUS0n5clMSw zXOqgmDunJeD!Q2v>guv?tM2yo%vs_`xAUHO)uDfV?Y8yCH9vR7Za!Ybe#)r&+Qw|* z7vHB@zUIkDy0XbGGCO-_+4{S$mMQPmx}#JiYPV)vuF%hF_H$F?BAjpezqEgO@nyNk z<|*%*_4K~}IP&oC)7MWP&$%3b&f@P&9?ngLv+`$q)=lp@IWNWL_v_$q{Bn~@t5sGW zFBe`@ZjrwJ(M%)$H}%`jKVEMzkuV=mRUxJFKpE8-{dYM z`hI4pvDV5JOBP+36vVVNge6#D9_x{Y(BBg+^xGM74OU*gxhgLzY)TB*o{xWQe$MPJ z3Q-P|{}s))EH`l5?xK~aAAjApg2`m&*)LHkcgxOf4n7+huC+Gcn!X^5V@RN2h;AC^ zgwl1Tx1HXWbDffESQK(SCLlyZ#XwIzCPdul@D%$~@oSOS{3*%zp1qfts;qQr#>DSUmb2shLOs_$FDN+SSUYR-j#+?yV*-GcU_1FZJxzRndQ6e%xO3`$cxls{;}yT2d{|7EeC^=us{| z6aByM-=1dfX(rzS-WpiR6n%RnSUZ2>F1d_jI#F7JT=N6%{x&^&D6FP_JYx%w`s4nX zw|-gYc3lW_RypIPBHm+u<4TasbB_+5(>;4%vBrzfS6nKv+JooN>-=3k`)m|8&YQ1h zSs5x2!Vx&bbz#TEO4Tzy#}dCY*6+(d-M)H;s@BydD(AFn>={G#{*?x84_eUW)Zz7R zO8p+|)o<;$NvLk$T_d3C=k;h0Q(%DW(uLiNTrT<-y}Zq|I`mn{=1DU`1nk$W-7;y} zjv!OlO-s+N4?8$t26lgrbyctMLQjy8#9%8 zg@)8t(e1l@1Il*I|9mj%!YV}zjZo%9)0}e`b_CDb{44k6*O&c2UQ}MPRw3nX#%C~O@t1LQaNNn7As8uGKE$2kxX3gf0h1z;oS3Q$Ro^iu6{b&7!&QB>-2iE_L z{`NvRjWvtK&}r$RIdhs0_!PV4o%>_bEZ?V5UCr~n(S=pN>9U6uSB>ZgMfJ1Gc}$$9 zU0rtgPu_zoy|aqnWj%klM(XpsKl57z^ny?AIezPOerR{`bD3*VlahRXeCHQnieFK8 z<=x)>udY}3e}B2Q@uF1mwx>5$Je_7O+qytcUi^BVS5Z`r+B)x=U6=E=>LtZ4{ihUg z`^bT(A-k7l=6z3kxKsCZapE5>j@7kSGCe1s*Yo; literal 0 HcmV?d00001 diff --git a/src/plugins/coreplugin/images/fancytoolbutton_normal_outline.png b/src/plugins/coreplugin/images/fancytoolbutton_normal_outline.png new file mode 100644 index 0000000000000000000000000000000000000000..8e7958e99da79934d90aad9e2b3ba077a6c6ce7e GIT binary patch literal 2407 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 nZA!SbTKvIE*5@Zq|7X;iN55 zKVx8EkSuYHC~?lu%}vcKVQ?-=O)N=GQ7F$W$xv|j^bH7aqS<1(9I25lPs}rzJZeT4-owUV+{mQBIDf{x9G-gk#-SFniyhI6|V=HoR zPbr=@vzF(igZ{%iY#~Y%%`TVtem&L{x5fmjJvny%9!h+ zrLn8mWmmp8^}XzUSSI+0#MNzUoj4BIJX$j4-SRe@2QzLi=bj-`puoT`Q*eM0Otd#J m^I1HA5fCwSi9g@>Foym!TekO!+X)5+1_n=8KbLh*2~7Z!IHL#v literal 0 HcmV?d00001 diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index df9d41d01c2..bede27cb535 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -205,6 +205,11 @@ void ModeManager::addAction(Command *command, int priority, QMenu *menu) m_actionBar->insertAction(index, command->action(), menu); } +void ModeManager::addProjectSelector(QAction *action) +{ + m_actionBar->addProjectSelector(action); +} + void ModeManager::currentTabAboutToChange(int index) { if (index >= 0) { diff --git a/src/plugins/coreplugin/modemanager.h b/src/plugins/coreplugin/modemanager.h index c2ad51a8a4f..4cf2d8a4043 100644 --- a/src/plugins/coreplugin/modemanager.h +++ b/src/plugins/coreplugin/modemanager.h @@ -38,6 +38,7 @@ #include QT_BEGIN_NAMESPACE +class QAction; class QSignalMapper; class QMenu; QT_END_NAMESPACE @@ -50,6 +51,7 @@ class IMode; namespace Internal { class FancyTabWidget; class FancyActionBar; +class FancyConfigButton; class MainWindow; } // namespace Internal @@ -67,6 +69,7 @@ public: IMode* mode(const QString &id) const; void addAction(Command *command, int priority, QMenu *menu = 0); + void addProjectSelector(QAction *action); void addWidget(QWidget *widget); signals: diff --git a/src/plugins/projectexplorer/metatypedeclarations.h b/src/plugins/projectexplorer/metatypedeclarations.h index 57fccb55067..c575324c369 100644 --- a/src/plugins/projectexplorer/metatypedeclarations.h +++ b/src/plugins/projectexplorer/metatypedeclarations.h @@ -46,7 +46,6 @@ class CommandQObject; } } -Q_DECLARE_METATYPE(ProjectExplorer::Project*) Q_DECLARE_METATYPE(QList) Q_DECLARE_METATYPE(ProjectExplorer::SessionManager*) Q_DECLARE_METATYPE(ProjectExplorer::IProjectManager*) diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp new file mode 100644 index 00000000000..d8de5905b92 --- /dev/null +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -0,0 +1,289 @@ +#include "miniprojecttargetselector.h" + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace ProjectExplorer; +using namespace ProjectExplorer::Internal; + +MiniTargetWidget::MiniTargetWidget(Project *project, QWidget *parent) : + QWidget(parent), m_project(project) +{ + m_buildComboBox = new QComboBox; + m_buildComboBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); + m_runComboBox = new QComboBox; + m_runComboBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); + + int fontSize = font().pointSize(); + setStyleSheet(QString("QWidget { font-size: %1pt; color: white; } " + "QLabel#targetName { font-size: %2pt; font-weight: bold; } " + "QComboBox { background-color: transparent; margin: 0; border: none; } " + "QComboBox QWidget { background-color: %3 } " + "QComboBox::drop-down { border: none; }" + "QComboBox::down-arrow { image: url(:/welcome/images/combobox_arrow.png); } " + ).arg(fontSize-1).arg(fontSize).arg(Utils::StyleHelper::baseColor().name())); + + QGridLayout *gridLayout = new QGridLayout(this); + + m_targetName = new QLabel(tr("Target")); + m_targetName->setObjectName(QLatin1String("targetName")); + m_targetIcon = new QLabel(); + m_targetIcon->setPixmap(style()->standardIcon(QStyle::SP_ComputerIcon).pixmap(48, 48)); + + Q_FOREACH(BuildConfiguration* bc, project->buildConfigurations()) + addBuildConfiguration(bc); + + Q_FOREACH(RunConfiguration* rc, project->runConfigurations()) + addRunConfiguration(rc); + + connect(project, SIGNAL(addedBuildConfiguration(ProjectExplorer::BuildConfiguration*)), + SLOT(addBuildConfiguration(ProjectExplorer::BuildConfiguration*))); + connect(project, SIGNAL(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)), + SLOT(addBuildConfiguration(ProjectExplorer::BuildConfiguration*))); + + connect(project, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration*)), + SLOT(addRunConfiguration(ProjectExplorer::RunConfiguration*))); + connect(project, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration*)), + SLOT(removeRunConfiguration(ProjectExplorer::RunConfiguration*))); + + connect(m_buildComboBox, SIGNAL(currentIndexChanged(int)), SLOT(setActiveBuildConfiguration(int))); + connect(m_runComboBox, SIGNAL(currentIndexChanged(int)), SLOT(setActiveRunConfiguration(int))); + + connect(project, SIGNAL(activeBuildConfigurationChanged()), SLOT(setActiveBuildConfiguration())); + connect(project, SIGNAL(activeRunConfigurationChanged()), SLOT(setActiveRunConfiguration())); + + QHBoxLayout *runHelperLayout = new QHBoxLayout; + runHelperLayout->setMargin(0); + runHelperLayout->setSpacing(0); + QHBoxLayout *buildHelperLayout = new QHBoxLayout; + buildHelperLayout->setMargin(0); + buildHelperLayout->setSpacing(0); + + buildHelperLayout->addWidget(m_buildComboBox); + runHelperLayout->addWidget(m_runComboBox); + + QFormLayout *formLayout = new QFormLayout; + QLabel *lbl = new QLabel(tr("Build:")); + lbl->setIndent(6); + formLayout->addRow(lbl, buildHelperLayout); + lbl = new QLabel(tr("Run:")); + lbl->setIndent(6); + formLayout->addRow(lbl, runHelperLayout); + + gridLayout->addWidget(m_targetName, 0, 0); + gridLayout->addWidget(m_targetIcon, 0, 1, 2, 1, Qt::AlignTop|Qt::AlignHCenter); + gridLayout->addLayout(formLayout, 1, 0); +} + +void MiniTargetWidget::setActiveBuildConfiguration(int index) +{ + ProjectExplorer::BuildConfiguration* bc = + m_buildComboBox->itemData(index).value(); + m_project->setActiveBuildConfiguration(bc); + emit activeBuildConfigurationChanged(bc); +} + +void MiniTargetWidget::setActiveRunConfiguration(int index) +{ + m_project->setActiveRunConfiguration( + m_runComboBox->itemData(index).value()); +} +void MiniTargetWidget::setActiveBuildConfiguration() +{ + m_buildComboBox->setCurrentIndex(m_buildComboBox->findData( + QVariant::fromValue(m_project->activeBuildConfiguration()))); +} + +void MiniTargetWidget::setActiveRunConfiguration() +{ + m_runComboBox->setCurrentIndex(m_runComboBox->findData( + QVariant::fromValue(m_project->activeRunConfiguration()))); +} + +void MiniTargetWidget::addRunConfiguration(ProjectExplorer::RunConfiguration* runConfig) +{ + connect(runConfig, SIGNAL(displayNameChanged()), SLOT(updateDisplayName())); + m_runComboBox->addItem(runConfig->displayName(), QVariant::fromValue(runConfig)); + if (m_project->activeRunConfiguration() == runConfig) + m_runComboBox->setCurrentIndex(m_runComboBox->count()-1); +} + +void MiniTargetWidget::removeRunConfiguration(ProjectExplorer::RunConfiguration* runConfig) +{ + m_runComboBox->removeItem(m_runComboBox->findData(QVariant::fromValue(runConfig))); +} + +void MiniTargetWidget::addBuildConfiguration(ProjectExplorer::BuildConfiguration* buildConfig) +{ + connect(buildConfig, SIGNAL(displayNameChanged()), SLOT(updateDisplayName())); + m_buildComboBox->addItem(buildConfig->displayName(), QVariant::fromValue(buildConfig)); + if (m_project->activeBuildConfiguration() == buildConfig) + m_buildComboBox->setCurrentIndex(m_buildComboBox->count()-1); +} + +void MiniTargetWidget::removeBuildConfiguration(ProjectExplorer::BuildConfiguration* buildConfig) +{ + m_buildComboBox->removeItem(m_buildComboBox->findData(QVariant::fromValue(buildConfig))); +} + +void MiniTargetWidget::updateDisplayName() +{ + QObject *obj = sender(); + if (RunConfiguration* runConfig = qobject_cast(obj)) + { + m_runComboBox->setItemText(m_runComboBox->findData(QVariant::fromValue(runConfig)), + runConfig->displayName()); + } else if (BuildConfiguration* buildConfig = qobject_cast(obj)) + { + m_buildComboBox->setItemText(m_buildComboBox->findData(QVariant::fromValue(buildConfig)), + buildConfig->displayName()); + } +} + + +MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorAction, QWidget *parent) : + QWidget(parent), m_projectAction(targetSelectorAction) +{ + setWindowFlags(Qt::Popup); + setFocusPolicy(Qt::NoFocus); + + targetSelectorAction->setIcon(style()->standardIcon(QStyle::SP_ComputerIcon)); + targetSelectorAction->setProperty("titledAction", true); + + QVBoxLayout *layout = new QVBoxLayout(this); + layout->setMargin(0); + layout->setSpacing(0); + + Utils::StyledBar *bar = new Utils::StyledBar; + bar->setSingleRow(true); + layout->addWidget(bar); + QHBoxLayout *toolLayout = new QHBoxLayout(bar); + toolLayout->setMargin(0); + toolLayout->setSpacing(0); + + QLabel *lbl = new QLabel(tr("Project")); + lbl->setIndent(6); + QFont f = lbl->font(); + f.setBold(true); + lbl->setFont(f); + m_projectsBox = new QComboBox; + m_projectsBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); + m_projectsBox->setMaximumWidth(200); + + toolLayout->addWidget(lbl); + toolLayout->addWidget(new Utils::StyledSeparator); + toolLayout->addWidget(m_projectsBox); + + m_widgetStack = new QStackedWidget; + m_widgetStack->setFocusPolicy(Qt::NoFocus); + layout->addWidget(m_widgetStack); + + connect(m_projectsBox, SIGNAL(activated(int)), this, SLOT(emitStartupProjectChanged(int))); +} + +void MiniProjectTargetSelector::setVisible(bool visible) +{ + if (visible) { + resize(sizeHint()); + QStatusBar *statusBar = Core::ICore::instance()->statusBar(); + QPoint moveTo = statusBar->mapToGlobal(QPoint(0,0)); + moveTo -= QPoint(0, sizeHint().height()); + move(moveTo); + } + QWidget::setVisible(visible); +} + +void MiniProjectTargetSelector::addProject(ProjectExplorer::Project* project) +{ + QTC_ASSERT(project, return); + ProjectListWidget *targetList = new ProjectListWidget(project); + targetList->setStyleSheet(QString("QListWidget { background: %1; border: none; }") + .arg(Utils::StyleHelper::baseColor().name())); + int pos = m_widgetStack->addWidget(targetList); + + m_projectsBox->addItem(project->displayName(), QVariant::fromValue(project)); + + QListWidgetItem *lwi = new QListWidgetItem(); + targetList->addItem(lwi); + MiniTargetWidget *targetWidget = new MiniTargetWidget(project); + targetWidget->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); + // width==0 size hint to avoid horizontal scrolling in list widget + lwi->setSizeHint(QSize(0, targetWidget->sizeHint().height())); + targetList->setItemWidget(lwi, targetWidget); + targetList->setCurrentItem(lwi); + + connect(project, SIGNAL(activeBuildConfigurationChanged()), SLOT(updateAction())); + + if (project == ProjectExplorerPlugin::instance()->startupProject()) { + m_projectsBox->setCurrentIndex(pos); + m_widgetStack->setCurrentIndex(pos); + } +} + +void MiniProjectTargetSelector::removeProject(ProjectExplorer::Project* project) +{ + for (int i = 0; i < m_widgetStack->count(); ++i) { + ProjectListWidget *plw = qobject_cast(m_widgetStack->widget(i)); + if (plw && plw->project() == project) { + m_projectsBox->removeItem(i); + delete plw; + } + } +} + + +void MiniProjectTargetSelector::updateAction() +{ + Project *project = ProjectExplorerPlugin::instance()->startupProject(); + + QString projectName = tr("No Project"); + QString buildConfig = tr("None"); + + if (project) { + projectName = project->displayName(); + if (BuildConfiguration* bc = project->activeBuildConfiguration()) + buildConfig = bc->displayName(); + } + m_projectAction->setProperty("heading", projectName); + m_projectAction->setProperty("subtitle", buildConfig); + m_projectAction->setIcon(m_projectAction->icon()); // HACK TO FORCE UPDATE +} + +void MiniProjectTargetSelector::emitStartupProjectChanged(int index) +{ + Project *project = m_projectsBox->itemData(index).value(); + QTC_ASSERT(project, return;) + emit startupProjectChanged(project); +} + +void MiniProjectTargetSelector::changeStartupProject(ProjectExplorer::Project *project) +{ + for (int i = 0; i < m_widgetStack->count(); ++i) { + ProjectListWidget *plw = qobject_cast(m_widgetStack->widget(i)); + if (plw && plw->project() == project) { + m_projectsBox->setCurrentIndex(i); + m_widgetStack->setCurrentIndex(i); + } + } + updateAction(); +} diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.h b/src/plugins/projectexplorer/miniprojecttargetselector.h new file mode 100644 index 00000000000..14f2dcd4c2b --- /dev/null +++ b/src/plugins/projectexplorer/miniprojecttargetselector.h @@ -0,0 +1,102 @@ +#ifndef MINIPROJECTTARGETSELECTOR_H +#define MINIPROJECTTARGETSELECTOR_H + +#include + + +QT_BEGIN_NAMESPACE +class QComboBox; +class QLabel; +class QStackedWidget; +QT_END_NAMESPACE + +namespace ProjectExplorer { +class Project; +class RunConfiguration; +class BuildConfiguration; + +namespace Internal { + +// helper classes + +class ProjectListWidget : public QListWidget +{ + Q_OBJECT +private: + ProjectExplorer::Project* m_project; + +public: + ProjectListWidget(ProjectExplorer::Project *project, QWidget *parent = 0) + : QListWidget(parent), m_project(project) + { + setFocusPolicy(Qt::NoFocus); + setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + } + + ProjectExplorer::Project *project() const + { + return m_project; + } + +}; + +class MiniTargetWidget : public QWidget +{ + Q_OBJECT +public: + // TODO: Pass target instead of project + MiniTargetWidget(Project *project, QWidget *parent = 0); + + +private slots: + void addRunConfiguration(ProjectExplorer::RunConfiguration *runConfig); + void removeRunConfiguration(ProjectExplorer::RunConfiguration *buildConfig); + void addBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfig); + void removeBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfig); + + void setActiveBuildConfiguration(int index); + void setActiveRunConfiguration(int index); + void setActiveBuildConfiguration(); + void setActiveRunConfiguration(); + + void updateDisplayName(); + +signals: + void activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration *buildConfig); + +private: + QLabel *m_targetName; + QLabel *m_targetIcon; + QComboBox *m_runComboBox; + QComboBox *m_buildComboBox; + ProjectExplorer::Project* m_project; +}; + +// main class + +class MiniProjectTargetSelector : public QWidget +{ + Q_OBJECT +public: + MiniProjectTargetSelector(QAction *projectAction,QWidget *parent = 0); + void setVisible(bool visible); + +signals: + void startupProjectChanged(ProjectExplorer::Project *project); + +private slots: + void addProject(ProjectExplorer::Project *project); + void removeProject(ProjectExplorer::Project *project); + void emitStartupProjectChanged(int index); + void changeStartupProject(ProjectExplorer::Project *project); + void updateAction(); + +private: + QAction *m_projectAction; + QComboBox *m_projectsBox; + QStackedWidget *m_widgetStack; +}; + +}; +}; +#endif // MINIPROJECTTARGETSELECTOR_H diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 2923289ec75..2f18c82cb21 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -168,4 +168,6 @@ private: } // namespace ProjectExplorer +Q_DECLARE_METATYPE(ProjectExplorer::Project *) + #endif // PROJECT_H diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 30b12e4cc3f..b08fda8cbcb 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -62,6 +62,7 @@ #include "projectwelcomepagewidget.h" #include "corelistenercheckingforrunningbuild.h" #include "buildconfiguration.h" +#include "miniprojecttargetselector.h" #include #include @@ -147,6 +148,7 @@ struct ProjectExplorerPluginPrivate { QAction *m_openTerminalHere; QAction *m_removeFileAction; QAction *m_renameFileAction; + QAction *m_projectSelectorAction; QMenu *m_buildConfigurationMenu; QActionGroup *m_buildConfigurationActionGroup; @@ -174,6 +176,7 @@ struct ProjectExplorerPluginPrivate { RunControl *m_debuggingRunControl; QString m_runMode; QString m_projectFilterString; + Internal::MiniProjectTargetSelector * m_targetSelector; Internal::ProjectExplorerSettings m_projectExplorerSettings; Internal::ProjectWelcomePage *m_welcomePlugin; Internal::ProjectWelcomePageWidget *m_welcomePage; @@ -697,6 +700,24 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er d->m_renameFileAction->setEnabled(false); d->m_renameFileAction->setVisible(false); + // target selector + d->m_projectSelectorAction = new QAction(this); + d->m_projectSelectorAction->setEnabled(false); + QWidget *mainWindow = Core::ICore::instance()->mainWindow(); + d->m_targetSelector = new Internal::MiniProjectTargetSelector(d->m_projectSelectorAction, mainWindow); + connect(d->m_projectSelectorAction, SIGNAL(triggered()), d->m_targetSelector, SLOT(show())); + modeManager->addProjectSelector(d->m_projectSelectorAction); + + + connect(d->m_session, SIGNAL(projectAdded(ProjectExplorer::Project*)), + d->m_targetSelector, SLOT(addProject(ProjectExplorer::Project*))); + connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project*)), + d->m_targetSelector, SLOT(removeProject(ProjectExplorer::Project*))); + connect(d->m_targetSelector, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), + this, SLOT(setStartupProject(ProjectExplorer::Project*))); + connect(d->m_session, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), + d->m_targetSelector, SLOT(changeStartupProject(ProjectExplorer::Project*))); + connect(core, SIGNAL(saveSettingsRequested()), this, SLOT(savePersistentSettings())); @@ -1268,7 +1289,7 @@ void ProjectExplorerPlugin::startRunControl(RunControl *runControl, const QStrin d->m_debuggingRunControl = runControl; runControl->start(); - updateRunAction(); + updateToolBarActions(); } void ProjectExplorerPlugin::buildQueueFinished(bool success) @@ -1373,7 +1394,7 @@ void ProjectExplorerPlugin::updateActions() d->m_cleanSessionAction->setEnabled(hasProjects && !building); d->m_cancelBuildAction->setEnabled(building); - updateRunAction(); + updateToolBarActions(); } // NBS TODO check projectOrder() @@ -1568,7 +1589,7 @@ void ProjectExplorerPlugin::runProjectImpl(Project *pro, QString mode) configurations << pro->activeBuildConfiguration(); d->m_buildManager->buildProjects(configurations); - updateRunAction(); + updateToolBarActions(); } } else { // TODO this ignores RunConfiguration::isEnabled() @@ -1631,7 +1652,7 @@ void ProjectExplorerPlugin::runControlFinished() if (sender() == d->m_debuggingRunControl) d->m_debuggingRunControl = 0; - updateRunAction(); + updateToolBarActions(); } void ProjectExplorerPlugin::startupProjectChanged() @@ -1643,17 +1664,17 @@ void ProjectExplorerPlugin::startupProjectChanged() if (previousStartupProject) { disconnect(previousStartupProject, SIGNAL(activeRunConfigurationChanged()), - this, SLOT(updateRunAction())); + this, SLOT(updateToolBarActions())); } previousStartupProject = project; if (project) { connect(project, SIGNAL(activeRunConfigurationChanged()), - this, SLOT(updateRunAction())); + this, SLOT(updateToolBarActions())); } - updateRunAction(); + updateToolBarActions(); } // NBS TODO implement more than one runner @@ -1667,7 +1688,7 @@ IRunControlFactory *ProjectExplorerPlugin::findRunControlFactory(RunConfiguratio return 0; } -void ProjectExplorerPlugin::updateRunAction() +void ProjectExplorerPlugin::updateToolBarActions() { const Project *project = startupProject(); bool canRun = project && findRunControlFactory(project->activeRunConfiguration(), ProjectExplorer::Constants::RUNMODE); @@ -1679,6 +1700,9 @@ void ProjectExplorerPlugin::updateRunAction() d->m_runActionContextMenu->setEnabled(canRun && !building); d->m_debugAction->setEnabled(canDebug && !building); + + d->m_projectSelectorAction->setEnabled(!session()->projects().isEmpty()); + } void ProjectExplorerPlugin::cancelBuild() diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index c44fa2b38b9..c4d647986a3 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -116,7 +116,6 @@ public: void setCurrentNode(Node *node); Project *startupProject() const; - void setStartupProject(ProjectExplorer::Project *project = 0); BuildManager *buildManager() const; @@ -148,6 +147,9 @@ signals: void settingsChanged(); +public slots: + void setStartupProject(ProjectExplorer::Project *project = 0); + private slots: void buildStateChanged(ProjectExplorer::Project * pro); void buildQueueFinished(bool success); @@ -205,7 +207,7 @@ private slots: void runControlFinished(); void startupProjectChanged(); // Calls updateRunAction - void updateRunAction(); + void updateToolBarActions(); void addToApplicationOutputWindow(RunControl *, const QString &line); void addToApplicationOutputWindowInline(RunControl *, const QString &line); diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro index d752fb82443..864b66f7ceb 100644 --- a/src/plugins/projectexplorer/projectexplorer.pro +++ b/src/plugins/projectexplorer/projectexplorer.pro @@ -67,6 +67,7 @@ HEADERS += projectexplorer.h \ projectwelcomepage.h \ projectwelcomepagewidget.h \ baseprojectwizarddialog.h \ + miniprojecttargetselector.h \ targetselector.h \ targetsettingswidget.h \ doubletabwidget.h @@ -124,6 +125,7 @@ SOURCES += projectexplorer.cpp \ projectwelcomepagewidget.cpp \ corelistenercheckingforrunningbuild.cpp \ baseprojectwizarddialog.cpp \ + miniprojecttargetselector.cpp \ targetselector.cpp \ targetsettingswidget.cpp \ doubletabwidget.cpp