aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/panelswidget.cpp
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2016-07-22 15:53:01 +0200
committerhjk <hjk@qt.io>2016-07-26 10:00:09 +0000
commit245965223450e6936d9a6b250bff777e633bbcc6 (patch)
treed2c029881338cc3ad34046284dcbbdc73b54afba /src/plugins/projectexplorer/panelswidget.cpp
parentd258d47b426dcf3e58dab8e46456bc4e396890b7 (diff)
ProjectExplorer: Rework mode main window
The existing solution with the special-style horizontal kit selector comes from a time when there was typically one, at most four targets. Today's setup can easily reach half a dozen targets with several toolchain versions each and can't be sensibly handled with the overflowing horizontal bar. This here replaces the horizontal kit selector bar as well as the top level project "tab bar" with a normal tree view. All targets are visible (but possibly disabled) at once, and can be enabled/disabled using the context menu on the tree items. Change-Id: I1ce7401ca96109bf34bc8c0ae19d265e5845aa88 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/panelswidget.cpp')
-rw-r--r--src/plugins/projectexplorer/panelswidget.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/plugins/projectexplorer/panelswidget.cpp b/src/plugins/projectexplorer/panelswidget.cpp
index 25b10b8a9a..5d7f9a866e 100644
--- a/src/plugins/projectexplorer/panelswidget.cpp
+++ b/src/plugins/projectexplorer/panelswidget.cpp
@@ -34,6 +34,7 @@
#include <utils/stylehelper.h>
#include <utils/theme/theme.h>
#include <utils/qtcassert.h>
+#include <utils/styledbar.h>
namespace {
const int ICON_SIZE(64);
@@ -106,14 +107,13 @@ void RootWidget::paintEvent(QPaintEvent *e)
///
PanelsWidget::PanelsWidget(QWidget *parent) :
- QScrollArea(parent),
+ QWidget(parent),
m_root(new RootWidget(this))
{
// We want a 900px wide widget with and the scrollbar at the
// side of the screen.
m_root->setMaximumWidth(900);
m_root->setContentsMargins(0, 0, 40, 0);
-
QPalette pal;
QColor background = StyleHelper::mergedColors(
palette().window().color(), Qt::white, 85);
@@ -122,6 +122,13 @@ PanelsWidget::PanelsWidget(QWidget *parent) :
pal.setColor(QPalette::All, QPalette::Window, background);
m_root->setPalette(pal);
+
+ m_scroller = new QScrollArea(this);
+ m_scroller->setWidget(m_root);
+ m_scroller->setFrameStyle(QFrame::NoFrame);
+ m_scroller->setWidgetResizable(true);
+ m_scroller->setFocusPolicy(Qt::NoFocus);
+
// The layout holding the individual panels:
auto topLayout = new QVBoxLayout(m_root);
topLayout->setMargin(0);
@@ -130,13 +137,17 @@ PanelsWidget::PanelsWidget(QWidget *parent) :
m_layout = new QGridLayout;
m_layout->setColumnMinimumWidth(0, ICON_SIZE + 4);
m_layout->setSpacing(0);
+
topLayout->addLayout(m_layout);
topLayout->addStretch(100);
- setWidget(m_root);
- setFrameStyle(QFrame::NoFrame);
- setWidgetResizable(true);
- setFocusPolicy(Qt::NoFocus);
+ auto layout = new QVBoxLayout(this);
+ layout->setContentsMargins(0, 0, 0, 0);
+ layout->setSpacing(0);
+ layout->addWidget(new Utils::StyledBar(this));
+ layout->addWidget(m_scroller);
+
+ //layout->addWidget(new FindToolBarPlaceHolder(this));
}
PanelsWidget::~PanelsWidget()