Commit 3363efeb authored by Albert Astals Cid's avatar Albert Astals Cid

Set/unset messagelist corner widgets

Provides better aesthetics and also i don't do the odd click in the not really visible but still there new tab button

REVIEW: 125475
parent 3b4b3ad6
......@@ -805,8 +805,11 @@ QItemSelection Pane::Private::mapSelectionFromSource(const QItemSelection &selec
void Pane::Private::updateTabControls()
{
const bool enableAction = (q->count() > 1);
if (mCloseTabButton) {
mCloseTabButton->setEnabled(enableAction);
if (enableAction) {
q->setCornerWidget( mCloseTabButton, Qt::TopRightCorner);
mCloseTabButton->setVisible(true);
} else {
q->setCornerWidget( Q_NULLPTR, Qt::TopRightCorner);
}
if (mCloseTabAction) {
mCloseTabAction->setEnabled(enableAction);
......@@ -826,8 +829,16 @@ void Pane::Private::updateTabControls()
if (Core::Settings::self()->autoHideTabBarWithSingleTab()) {
q->tabBar()->setVisible(enableAction);
if (enableAction) {
q->setCornerWidget( mNewTabButton, Qt::TopLeftCorner);
mNewTabButton->setVisible(true);
} else {
q->setCornerWidget( Q_NULLPTR, Qt::TopLeftCorner);
}
} else {
q->tabBar()->setVisible(true);
q->setCornerWidget( mNewTabButton, Qt::TopLeftCorner);
mNewTabButton->setVisible(true);
}
const bool hasCloseButton(Core::Settings::self()->tabsHaveCloseButton());
......
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