Commit 8ed85f1e authored by con's avatar con
Browse files

Unify tool button appearance in "panelWidgets".

Reviewed-by: Jens Bache-Wiig
parent edac6eb8
......@@ -105,11 +105,9 @@ EditorView::EditorView(OpenEditorsModel *model, QWidget *parent) :
m_toolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
m_lockButton->setAutoRaise(true);
m_lockButton->setProperty("type", QLatin1String("dockbutton"));
m_closeButton->setAutoRaise(true);
m_closeButton->setIcon(QIcon(":/core/images/closebutton.png"));
m_closeButton->setProperty("type", QLatin1String("dockbutton"));
QHBoxLayout *toplayout = new QHBoxLayout;
toplayout->setSpacing(0);
......
......@@ -196,7 +196,6 @@ MainWindow::MainWindow() :
connect(QApplication::instance(), SIGNAL(focusChanged(QWidget*,QWidget*)),
this, SLOT(updateFocusWidget(QWidget*,QWidget*)));
// Add a small Toolbutton for toggling the navigation widget
m_toggleSideBarButton->setProperty("type", QLatin1String("dockbutton"));
statusBar()->insertPermanentWidget(0, m_toggleSideBarButton);
// setUnifiedTitleAndToolBarOnMac(true);
......
......@@ -31,7 +31,6 @@
#include "styleanimator.h"
#include <QtCore/QDebug>
#include <QtCore/QLibrary>
#include <utils/qtcassert.h>
......@@ -100,8 +99,6 @@ public:
{
style = QStyleFactory::create(baseStyleName);
QTC_ASSERT(style, /**/);
buttonImage_pressed = QImage(":/core/images/pushbutton_pressed.png");
buttonImage = QImage(":/core/images/pushbutton.png");
lineeditImage = QImage(":/core/images/inputfield.png");
lineeditImage_disabled = QImage(":/core/images/inputfield_disabled.png");
......@@ -117,8 +114,6 @@ public:
public:
QStyle *style;
QImage buttonImage;
QImage buttonImage_pressed;
QImage lineeditImage;
QImage lineeditImage_disabled;
......@@ -907,7 +902,6 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
switch (control) {
case CC_ToolButton:
if (const QStyleOptionToolButton *toolbutton = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
QString buttonType = widget->property("type").toString();
QRect button, menuarea;
button = subControlRect(control, toolbutton, SC_ToolButton, widget);
menuarea = subControlRect(control, toolbutton, SC_ToolButtonMenu, widget);
......@@ -930,24 +924,9 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
QStyleOption tool(0);
tool.palette = toolbutton->palette;
if (toolbutton->subControls & SC_ToolButton) {
if (buttonType == "dockbutton") {
tool.rect = button;
tool.state = bflags;
drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);
} else { // paint status bar button style
if (bflags & State_Sunken || bflags & State_On)
drawCornerImage(d->buttonImage_pressed, painter, option->rect, 2, 2, 2, 2);
else if (bflags & State_Enabled) {
#ifndef Q_WS_MAC
if (bflags & State_MouseOver) {
drawCornerImage(d->buttonImage, painter, option->rect, 2, 2, 2, 2);
QColor shade(255, 255, 255, 50);
painter->fillRect(button.adjusted(1, 1, -1, -1), shade);
}
#endif
}
}
tool.rect = button;
tool.state = bflags;
drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);
}
if (toolbutton->state & State_HasFocus) {
......
......@@ -383,9 +383,6 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget)
toolBarLayout->addWidget(splitAction);
toolBarLayout->addWidget(close);
splitAction->setProperty("type", QLatin1String("dockbutton"));
close->setProperty("type", QLatin1String("dockbutton"));
QVBoxLayout *lay = new QVBoxLayout();
lay->setMargin(0);
lay->setSpacing(0);
......
......@@ -177,18 +177,15 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
m_nextAction = new QAction(this);
m_nextAction->setIcon(QIcon(":/core/images/next.png"));
m_nextAction->setProperty("type", QLatin1String("dockbutton"));
m_nextAction->setText(tr("Next Item"));
connect(m_nextAction, SIGNAL(triggered()), this, SLOT(slotNext()));
m_prevAction = new QAction(this);
m_prevAction->setIcon(QIcon(":/core/images/prev.png"));
m_prevAction->setProperty("type", QLatin1String("dockbutton"));
m_prevAction->setText(tr("Previous Item"));
connect(m_prevAction, SIGNAL(triggered()), this, SLOT(slotPrev()));
m_closeButton->setIcon(QIcon(":/core/images/closebutton.png"));
m_closeButton->setProperty("type", QLatin1String("dockbutton"));
connect(m_closeButton, SIGNAL(clicked()), this, SLOT(slotHide()));
QVBoxLayout *mainlayout = new QVBoxLayout;
......@@ -201,10 +198,8 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
toolLayout->addWidget(m_widgetComboBox);
toolLayout->addWidget(m_clearButton);
m_prevToolButton = new QToolButton;
m_prevToolButton->setProperty("type", QLatin1String("dockbutton"));
toolLayout->addWidget(m_prevToolButton);
m_nextToolButton = new QToolButton;
m_nextToolButton->setProperty("type", QLatin1String("dockbutton"));
toolLayout->addWidget(m_nextToolButton);
toolLayout->addWidget(m_opToolBarWidgets);
toolLayout->addWidget(m_closeButton);
......
......@@ -237,13 +237,11 @@ SideBarWidget::SideBarWidget(SideBar *sideBar, const QString &title)
m_toolbar->addWidget(m_comboBox);
m_splitButton = new QToolButton;
m_splitButton->setProperty("type", QLatin1String("dockbutton"));
m_splitButton->setIcon(QIcon(":/core/images/splitbutton_horizontal.png"));
m_splitButton->setToolTip(tr("Split"));
connect(m_splitButton, SIGNAL(clicked(bool)), this, SIGNAL(split()));
m_closeButton = new QToolButton;
m_closeButton->setProperty("type", QLatin1String("dockbutton"));
m_closeButton->setIcon(QIcon(":/core/images/closebutton.png"));
m_closeButton->setToolTip(tr("Close"));
......
......@@ -82,16 +82,9 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
connect(m_ui.findEdit, SIGNAL(editingFinished()), this, SLOT(invokeResetIncrementalSearch()));
m_ui.close->setProperty("type", QLatin1String("dockbutton"));
m_ui.close->setIcon(QIcon(":/core/images/closebutton.png"));
connect(m_ui.close, SIGNAL(clicked()), this, SLOT(hideAndResetFocus()));
m_ui.findPreviousButton->setProperty("type", QLatin1String("dockbutton"));
m_ui.findNextButton->setProperty("type", QLatin1String("dockbutton"));
m_ui.replacePreviousButton->setProperty("type", QLatin1String("dockbutton"));
m_ui.replaceNextButton->setProperty("type", QLatin1String("dockbutton"));
m_ui.replaceAllButton->setProperty("type", QLatin1String("dockbutton"));
m_findCompleter->setModel(m_plugin->findCompletionModel());
m_replaceCompleter->setModel(m_plugin->replaceCompletionModel());
m_ui.findEdit->setCompleter(m_findCompleter);
......
......@@ -448,7 +448,6 @@ void HelpPlugin::createRightPaneSideBar()
SLOT(rightPaneForward()));
QToolButton *closeButton = new QToolButton();
closeButton->setProperty("type", QLatin1String("dockbutton"));
closeButton->setIcon(QIcon(":/core/images/closebutton.png"));
// Dummy layout to align the close button to the right
......
......@@ -204,7 +204,6 @@ Core::NavigationView FolderNavigationWidgetFactory::createWidget()
FolderNavigationWidget *ptw = new FolderNavigationWidget;
n.widget = ptw;
QToolButton *toggleSync = new QToolButton;
toggleSync->setProperty("type", "dockbutton");
toggleSync->setIcon(QIcon(":/core/images/linkicon.png"));
toggleSync->setCheckable(true);
toggleSync->setChecked(ptw->autoSynchronization());
......
......@@ -162,7 +162,6 @@ ProjectTreeWidget::ProjectTreeWidget(QWidget *parent)
this, SLOT(startupProjectChanged(ProjectExplorer::Project *)));
m_toggleSync = new QToolButton;
m_toggleSync->setProperty("type", "dockbutton");
m_toggleSync->setIcon(QIcon(":/core/images/linkicon.png"));
m_toggleSync->setCheckable(true);
m_toggleSync->setChecked(autoSynchronization());
......@@ -372,7 +371,6 @@ Core::NavigationView ProjectTreeWidgetFactory::createWidget()
n.widget = ptw;
QToolButton *filter = new QToolButton;
filter->setProperty("type", "dockbutton");
filter->setIcon(QIcon(":/projectexplorer/images/filtericon.png"));
filter->setToolTip(tr("Filter tree"));
filter->setPopupMode(QToolButton::InstantPopup);
......
......@@ -314,7 +314,6 @@ static QToolButton *createFilterButton(ProjectExplorer::BuildParserInterface::Pa
{
QToolButton *button = new QToolButton;
button->setIcon(model->iconFor(type));
button->setProperty("type", "dockbutton");
button->setToolTip(toolTip);
button->setCheckable(true);
button->setChecked(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment