Commit 22c6c006 authored by Piotr Henryk Dabrowski's avatar Piotr Henryk Dabrowski
Browse files

Fix tab color being changed when no user color was selected

parent 881034b3
......@@ -158,7 +158,7 @@ void DetachableTabBar::paintEvent(QPaintEvent *event)
}
QColor varColor = data.value<QColor>();
if (!varColor.isValid()) {
if (!varColor.isValid() || varColor.alpha() == 0) {
continue;
}
......
......@@ -28,10 +28,13 @@ RenameTabWidget::RenameTabWidget(QWidget *parent) :
_ui->tabTitleEdit->setClearButtonEnabled(true);
_ui->remoteTabTitleEdit->setClearButtonEnabled(true);
_colorNone = palette().base().color(); // so that item's text is visible in the combo-box
_colorNone.setAlpha(0);
QList<QColor> listColors(_ui->tabColorCombo->colors());
listColors.insert(0, QColor(QColor::Invalid));
listColors.insert(0, _colorNone);
_ui->tabColorCombo->setColors(listColors);
_ui->tabColorCombo->setItemText(1, i18n("Color from theme"));
_ui->tabColorCombo->setItemText(1, i18n("None"));
connect(_ui->tabTitleEdit, &QLineEdit::textChanged, this,
&Konsole::RenameTabWidget::tabTitleFormatChanged);
......@@ -76,7 +79,11 @@ void RenameTabWidget::setRemoteTabTitleText(const QString &text)
void RenameTabWidget::setColor(const QColor &color)
{
_ui->tabColorCombo->setColor(color);
if (!color.isValid() || color.alpha() == 0) {
_ui->tabColorCombo->setColor(_colorNone);
} else {
_ui->tabColorCombo->setColor(color);
}
}
QString RenameTabWidget::tabTitleText() const
......
......@@ -46,6 +46,7 @@ public Q_SLOTS:
private:
Ui::RenameTabWidget *_ui;
QColor _colorNone;
};
}
......
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