#include "dolphin_iconsmodesettings.h"
#include "dolphin_searchsettings.h"
+#include <KAcceleratorManager>
#include <KAction>
#include <KActionCollection>
#include <KActionMenu>
#include <KInputDialog>
#include <KLocale>
#include <KProtocolManager>
-#include <KPushButton>
#include <KMenu>
#include <KMenuBar>
#include <KMessageBox>
#include <QDBusMessage>
#include <QKeyEvent>
#include <QClipboard>
+#include <QToolButton>
#include <QSplitter>
-#include <kacceleratormanager.h>
/*
* Remembers the tab configuration if a tab has been closed.
m_updateToolBarTimer->start();
}
+void DolphinMainWindow::slotToolBarIconSizeChanged(const QSize& iconSize)
+{
+ if (m_openToolBarMenuButton) {
+ m_openToolBarMenuButton->setIconSize(iconSize);
+ }
+}
+
void DolphinMainWindow::init()
{
DolphinSettings& settings = DolphinSettings::instance();
Q_ASSERT(!m_openToolBarMenuButton);
m_toolBarSpacer = new QWidget(this);
- m_toolBarSpacer->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
+ m_toolBarSpacer->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
- m_openToolBarMenuButton = new KPushButton(this);
- m_openToolBarMenuButton->setFlat(true);
+ m_openToolBarMenuButton = new QToolButton(this);
m_openToolBarMenuButton->setIcon(KIcon("configure"));
- m_openToolBarMenuButton->setMaximumWidth(m_openToolBarMenuButton->sizeHint().height());
// Instead of using QPushButton::setMenu() the opening of the menu is done manually
// to prevent the "clutter" of the down-arrow drawn by the style.
toolBar()->addWidget(m_toolBarSpacer);
toolBar()->addWidget(m_openToolBarMenuButton);
+ connect(toolBar(), SIGNAL(iconSizeChanged(QSize)), this, SLOT(slotToolBarIconSizeChanged(QSize)));
// The added widgets are owned by the toolbar and may get deleted when e.g. the toolbar
// gets edited. In this case we must add them again. The adding is done asynchronously by