X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/bbef0013a1bf6d8e041cae49a7f08d7b221708de..2dcc433ab2c353a40e3c65f3df46e8a1eac697cc:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 1f3e99f76..e5cc9901f 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -53,6 +53,7 @@ #include "dolphin_iconsmodesettings.h" #include "dolphin_searchsettings.h" +#include #include #include #include @@ -71,7 +72,6 @@ #include #include #include -#include #include #include #include @@ -93,8 +93,8 @@ #include #include #include +#include #include -#include /* * Remembers the tab configuration if a tab has been closed. @@ -1429,6 +1429,13 @@ void DolphinMainWindow::slotToolBarMenuButtonDeleted() m_updateToolBarTimer->start(); } +void DolphinMainWindow::slotToolBarIconSizeChanged(const QSize& iconSize) +{ + if (m_openToolBarMenuButton) { + m_openToolBarMenuButton->setIconSize(iconSize); + } +} + void DolphinMainWindow::init() { DolphinSettings& settings = DolphinSettings::instance(); @@ -1962,12 +1969,10 @@ void DolphinMainWindow::createToolBarMenuButton() 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. @@ -1975,6 +1980,7 @@ void DolphinMainWindow::createToolBarMenuButton() 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