Disable tabs menu button when only single tab exists in a Dock area (#111)

This commit is contained in:
mvidelgauz
2020-02-06 16:21:19 +02:00
committed by GitHub
parent 72496ebd48
commit 474dd13855
9 changed files with 73 additions and 11 deletions

View File

@@ -41,6 +41,7 @@ struct ElidingLabelPrivate
CElidingLabel* _this;
Qt::TextElideMode ElideMode = Qt::ElideNone;
QString Text;
bool IsElided = false;
ElidingLabelPrivate(CElidingLabel* _public) : _this(_public) {}
@@ -69,6 +70,12 @@ void ElidingLabelPrivate::elideText(int Width)
{
str = Text.at(0);
}
bool WasElided = IsElided;
IsElided = str != Text;
if(IsElided != WasElided)
{
emit _this->elidedChanged(IsElided);
}
_this->QLabel::setText(str);
}
@@ -113,6 +120,12 @@ void CElidingLabel::setElideMode(Qt::TextElideMode mode)
d->elideText(size().width());
}
//============================================================================
bool CElidingLabel::isElided() const
{
return d->IsElided;
}
//============================================================================
void CElidingLabel::mouseReleaseEvent(QMouseEvent* event)