Commit 1584e21b authored by Christoph Cullmann's avatar Christoph Cullmann

reasonable sub-toolbar sizes, like normal QPushButton sizes

parent d537a172
......@@ -44,6 +44,7 @@
#include <QAction>
#include <QDir>
#include <QLineEdit>
#include <QStyle>
#include <QVBoxLayout>
// END Includes
......@@ -60,6 +61,12 @@ KateFileBrowser::KateFileBrowser(KTextEditor::MainWindow *mainWindow, QWidget *p
m_toolbar->setMovable(false);
m_toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_toolbar->setContextMenuPolicy(Qt::NoContextMenu);
// ensure reasonable icons sizes, like e.g. the quick-open and co. icons
// the normal toolbar sizes are TOO large, e.g. for scaled stuff even more!
const int iconSize = style()->pixelMetric(QStyle::PM_ButtonIconSize, nullptr, this);
m_toolbar->setIconSize(QSize(iconSize, iconSize));
mainLayout->addWidget(m_toolbar);
// includes some actions, but not hooked into the shortcut dialog atm
......
......@@ -39,6 +39,7 @@
#include <QAction>
#include <QApplication>
#include <QStyle>
#include <QVBoxLayout>
#include "katefiletreedebug.h"
......@@ -143,6 +144,12 @@ KateFileTreePluginView::KateFileTreePluginView(KTextEditor::MainWindow *mainWind
m_toolbar->setMovable(false);
m_toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_toolbar->setContextMenuPolicy(Qt::NoContextMenu);
// ensure reasonable icons sizes, like e.g. the quick-open and co. icons
// the normal toolbar sizes are TOO large, e.g. for scaled stuff even more!
const int iconSize = m_toolView->style()->pixelMetric(QStyle::PM_ButtonIconSize, nullptr, m_toolView);
m_toolbar->setIconSize(QSize(iconSize, iconSize));
mainLayout->addWidget(m_toolbar);
// create filetree
......
......@@ -44,6 +44,7 @@
#include <qtimer.h>
#include <QApplication>
#include <QClipboard>
#include <QStyle>
#include <QTime>
#include <QElapsedTimer>
......@@ -61,7 +62,11 @@ DataOutputWidget::DataOutputWidget(QWidget *parent)
KToolBar *toolbar = new KToolBar(this);
toolbar->setOrientation(Qt::Vertical);
toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
toolbar->setIconSize(QSize(16, 16));
// ensure reasonable icons sizes, like e.g. the quick-open and co. icons
// the normal toolbar sizes are TOO large, e.g. for scaled stuff even more!
const int iconSize = style()->pixelMetric(QStyle::PM_ButtonIconSize, nullptr, this);
toolbar->setIconSize(QSize(iconSize, iconSize));
/// TODO: disable actions if no results are displayed or selected
......
......@@ -27,6 +27,7 @@
#include <qlayout.h>
#include <qtextedit.h>
#include <qdatetime.h>
#include <QStyle>
TextOutputWidget::TextOutputWidget(QWidget *parent)
: QWidget(parent)
......@@ -49,7 +50,11 @@ TextOutputWidget::TextOutputWidget(QWidget *parent)
KToolBar *toolbar = new KToolBar(this);
toolbar->setOrientation(Qt::Vertical);
toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
toolbar->setIconSize(QSize(16, 16));
// ensure reasonable icons sizes, like e.g. the quick-open and co. icons
// the normal toolbar sizes are TOO large, e.g. for scaled stuff even more!
const int iconSize = style()->pixelMetric(QStyle::PM_ButtonIconSize, nullptr, this);
toolbar->setIconSize(QSize(iconSize, iconSize));
/// TODO: disable actions if no results are displayed
......
......@@ -76,6 +76,7 @@
#include <QApplication>
#include <QMenu>
#include <QMenuBar>
#include <QStyle>
#include <QToolButton>
#include <QTimer>
#include <QFontDatabase>
......
......@@ -229,6 +229,11 @@ ToolView::ToolView(MainWindow *mainwin, Sidebar *sidebar, QWidget *parent)
m_toolbar = new KToolBar(this);
m_toolbar->setVisible(false);
m_toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
// ensure reasonable icons sizes, like e.g. the quick-open and co. icons
// the normal toolbar sizes are TOO large, e.g. for scaled stuff even more!
const int iconSize = style()->pixelMetric(QStyle::PM_ButtonIconSize, nullptr, this);
m_toolbar->setIconSize(QSize(iconSize, iconSize));
}
QSize ToolView::sizeHint() const
......
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