Commit cb0458ec authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

show no text for left/right sidebars

no text but larger icons

the multi-tab bar has minor layout glitches with that
guess this needs some patching there to add no margin
if no text set
parent f69457df
......@@ -379,7 +379,6 @@ void Sidebar::updateLastSizeOnResize()
ToolView *Sidebar::addWidget(const QIcon &icon, const QString &text, ToolView *widget)
{
static int id = 0;
if (widget) {
if (widget->sidebar() == this) {
......@@ -389,9 +388,13 @@ ToolView *Sidebar::addWidget(const QIcon &icon, const QString &text, ToolView *w
widget->sidebar()->removeWidget(widget);
}
static int id = 0;
int newId = ++id;
appendTab(icon, newId, text);
auto newTab = tab(newId);
Q_ASSERT(newTab);
connect(newTab, SIGNAL(clicked(int)), this, SLOT(tabClicked(int)));
newTab->installEventFilter(this);
if (!widget) {
widget = new ToolView(m_mainWin, this, m_ownSplit);
......@@ -415,12 +418,15 @@ ToolView *Sidebar::addWidget(const QIcon &icon, const QString &text, ToolView *w
// starts with invalid size
m_widgetToSize.emplace(widget, QSize());
show();
connect(tab(newId), SIGNAL(clicked(int)), this, SLOT(tabClicked(int)));
tab(newId)->installEventFilter(this);
tab(newId)->setToolTip(QString());
if (position() == KMultiTabBar::Left || position() == KMultiTabBar::Right) {
const int iconSize = style()->pixelMetric(QStyle::PM_LargeIconSize, nullptr, this);
newTab->setIconSize(QSize(iconSize, iconSize));
newTab->setText(QString());
} else {
newTab->setToolTip(QString());
}
show();
return widget;
}
......
Supports Markdown
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