mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
improved rendering of notebook tab with scaling
This commit is contained in:
parent
5e69354178
commit
2faf24e3d5
2 changed files with 4 additions and 4 deletions
|
@ -395,7 +395,7 @@ void Notebook::performLayout(bool animated)
|
|||
|
||||
/// Layout tab
|
||||
item.tab->moveAnimated(QPoint(x, y), animated);
|
||||
x += item.tab->width() + int(scale * 1);
|
||||
x += item.tab->width() + std::max<int>(1, int(scale * 1));
|
||||
}
|
||||
|
||||
/// Update which tabs are in the last row
|
||||
|
|
|
@ -300,14 +300,14 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
|||
|
||||
// fill the tab background
|
||||
auto bgRect = rect();
|
||||
bgRect.setTop(bgRect.top() + 2);
|
||||
bgRect.setTop(ceil((this->selected_ ? 0.f : 1.f) * scale));
|
||||
|
||||
painter.fillRect(bgRect, tabBackground);
|
||||
|
||||
// top line
|
||||
painter.fillRect(
|
||||
QRectF(0, (this->selected_ ? 0.f : 1.f) * scale, this->width(),
|
||||
(this->selected_ ? 2.f : 1.f) * scale),
|
||||
QRectF(0, ceil((this->selected_ ? 0.f : 1.f) * scale), this->width(),
|
||||
ceil((this->selected_ ? 2.f : 1.f) * scale)),
|
||||
this->mouseOver_
|
||||
? colors.line.hover
|
||||
: (windowFocused ? colors.line.regular : colors.line.unfocused));
|
||||
|
|
Loading…
Reference in a new issue