FindToolBar: Add support for "lightcolored" panels

The labels need to be polished so that they get the right palette,
and the icon needs to be switched from light to dark.

Change-Id: I3e37947e741c3d92f3c1ac3bb02e631aa7803f59
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Daniel Teske
2014-08-11 17:31:27 +02:00
parent b7f1c93495
commit 7d5d9b4d0f
13 changed files with 58 additions and 18 deletions

View File

@@ -28,18 +28,18 @@
****************************************************************************/
#include "findplaceholder.h"
#include "find/findtoolbar.h"
#include <extensionsystem/pluginmanager.h>
#include <QVBoxLayout>
using namespace Core;
FindToolBarPlaceHolder *FindToolBarPlaceHolder::m_current = 0;
FindToolBarPlaceHolder::FindToolBarPlaceHolder(QWidget *owner, QWidget *parent)
: QWidget(parent), m_owner(owner), m_subWidget(0)
: QWidget(parent), m_owner(owner), m_subWidget(0), m_lightColored(false)
{
setLayout(new QVBoxLayout);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
@@ -77,15 +77,18 @@ bool FindToolBarPlaceHolder::isUsedByWidget(QWidget *widget)
return false;
}
void FindToolBarPlaceHolder::setWidget(QWidget *widget)
void FindToolBarPlaceHolder::setWidget(Internal::FindToolBar *widget)
{
if (m_subWidget) {
m_subWidget->setVisible(false);
m_subWidget->setParent(0);
}
m_subWidget = widget;
if (m_subWidget)
if (m_subWidget) {
m_subWidget->setLightColored(m_lightColored);
m_subWidget->setLightColoredIcon(m_lightColored);
layout()->addWidget(m_subWidget);
}
}
FindToolBarPlaceHolder *FindToolBarPlaceHolder::getCurrent()
@@ -97,3 +100,13 @@ void FindToolBarPlaceHolder::setCurrent(FindToolBarPlaceHolder *placeHolder)
{
m_current = placeHolder;
}
void FindToolBarPlaceHolder::setLightColored(bool lightColored)
{
m_lightColored = lightColored;
}
bool FindToolBarPlaceHolder::isLightColored() const
{
return m_lightColored;
}