mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-03 22:55:28 +00:00
Compare commits
2 Commits
597c1d56b0
...
30dd1e79df
Author | SHA1 | Date | |
---|---|---|---|
![]() |
30dd1e79df | ||
![]() |
9a359fd47c |
@ -25,14 +25,28 @@ protected:
|
||||
void paintEvent(QPaintEvent* const event) override
|
||||
{
|
||||
QStylePainter painter(this);
|
||||
QStyleOptionTab option;
|
||||
|
||||
const int current_tab_index{currentIndex()};
|
||||
|
||||
const int tab_count{count()};
|
||||
for (int i{0}; i < tab_count; ++i)
|
||||
{
|
||||
if (i != current_tab_index)
|
||||
paintTab(painter, i);
|
||||
}
|
||||
|
||||
// Current tab is painted last as, depending on the [system] style, it is possible that the
|
||||
// decoration is required to occlude the adjacent tab underneath.
|
||||
paintTab(painter, current_tab_index);
|
||||
}
|
||||
|
||||
private:
|
||||
void paintTab(QStylePainter& painter, const int tab_index)
|
||||
{
|
||||
painter.save();
|
||||
|
||||
initStyleOption(&option, i);
|
||||
QStyleOptionTab option;
|
||||
initStyleOption(&option, tab_index);
|
||||
painter.drawControl(QStyle::CE_TabBarTabShape, option);
|
||||
|
||||
const QSize size{option.rect.size().transposed()};
|
||||
@ -40,7 +54,7 @@ protected:
|
||||
rect.moveCenter(option.rect.center());
|
||||
option.rect = rect;
|
||||
|
||||
const QPoint center{tabRect(i).center()};
|
||||
const QPoint center{tabRect(tab_index).center()};
|
||||
painter.translate(center);
|
||||
painter.rotate(90.0);
|
||||
painter.translate(-center);
|
||||
@ -48,7 +62,6 @@ protected:
|
||||
|
||||
painter.restore();
|
||||
}
|
||||
}
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user