Vertical tabs (#1815)
* Vertical tabs * Vertical tab wrapping * Fix formatting * Cleanup code * Updated changelog * Hide button row if no buttons exist * Fix tab width expansion Co-authored-by: fourtf <tf.four@gmail.com>
This commit is contained in:
@@ -89,7 +89,20 @@ void NotebookTab::themeChangedEvent()
|
||||
this->setMouseEffectColor(this->theme->tabs.regular.text);
|
||||
}
|
||||
|
||||
void NotebookTab::updateSize()
|
||||
void NotebookTab::growWidth(int width)
|
||||
{
|
||||
if (this->growWidth_ != width)
|
||||
{
|
||||
this->growWidth_ = width;
|
||||
this->updateSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->growWidth_ = width;
|
||||
}
|
||||
}
|
||||
|
||||
int NotebookTab::normalTabWidth()
|
||||
{
|
||||
float scale = this->scale();
|
||||
int width;
|
||||
@@ -114,8 +127,21 @@ void NotebookTab::updateSize()
|
||||
{
|
||||
width = clamp(width, this->height(), int(150 * scale));
|
||||
}
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
void NotebookTab::updateSize()
|
||||
{
|
||||
float scale = this->scale();
|
||||
int width = this->normalTabWidth();
|
||||
auto height = int(NOTEBOOK_TAB_HEIGHT * scale);
|
||||
|
||||
if (width < this->growWidth_)
|
||||
{
|
||||
width = this->growWidth_;
|
||||
}
|
||||
|
||||
if (this->width() != width || this->height() != height)
|
||||
{
|
||||
this->resize(width, height);
|
||||
@@ -175,7 +201,7 @@ void NotebookTab::titleUpdated()
|
||||
{
|
||||
// Queue up save because: Tab title changed
|
||||
getApp()->windows->queueSave();
|
||||
|
||||
this->notebook_->performLayout();
|
||||
this->updateSize();
|
||||
this->update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user