Disable tabs menu button when only single tab exists in a Dock area (#111)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user