This commit is contained in:
itsmattkc
2021-04-02 15:29:25 +11:00
5 changed files with 33 additions and 29 deletions
+7 -4
View File
@@ -371,15 +371,18 @@ void NodeViewItem::DrawNodeTitle(QPainter* painter, QString text, const QRectF&
{
QFontMetrics fm = painter->fontMetrics();
painter->setRenderHint(QPainter::SmoothPixmapTransform);
// Draw right or down arrow based on expanded state
int icon_size = fm.height() / 2;
int icon_padding = title_bar_rect_.height() / 2 - icon_size / 2;
int icon_full_size = icon_size + icon_padding * 2;
const QIcon& expand_icon = IsExpanded() ? icon::TriDown : icon::TriRight;
expand_icon.paint(painter, QRect(title_bar_rect_.x() + icon_padding,
title_bar_rect_.y() + icon_padding,
icon_size,
icon_size));
int icon_size_scaled = icon_size * painter->transform().m11();
painter->drawPixmap(QRect(title_bar_rect_.x() + icon_padding,
title_bar_rect_.y() + icon_padding,
icon_size,
icon_size), expand_icon.pixmap(QSize(icon_size_scaled, icon_size_scaled)));
// Calculate how much space we have for text
int item_width = title_bar_rect_.width();
+5 -7
View File
@@ -50,9 +50,7 @@ MainWindow::MainWindow(QWidget *parent) :
taskbar_interface_ = nullptr;
#endif
#ifdef Q_OS_LINUX
checked_graphics_vendor_ = false;
#endif
first_show_ = true;
// Create empty central widget - we don't actually want a central widget (so we set its maximum
// size to 0,0) but some of Qt's docking/undocking fails without it
@@ -635,10 +633,10 @@ void MainWindow::showEvent(QShowEvent *e)
{
QMainWindow::showEvent(e);
QMetaObject::invokeMethod(Core::instance(), "CheckForAutoRecoveries", Qt::QueuedConnection);
if (first_show_) {
QMetaObject::invokeMethod(Core::instance(), "CheckForAutoRecoveries", Qt::QueuedConnection);
#ifdef Q_OS_LINUX
if (!checked_graphics_vendor_) {
// Check for nouveau since that driver really doesn't work with Olive
QOffscreenSurface surface;
surface.create();
@@ -651,9 +649,9 @@ void MainWindow::showEvent(QShowEvent *e)
QMetaObject::invokeMethod(this, "ShowNouveauWarning", Qt::QueuedConnection);
}
checked_graphics_vendor_ = true;
}
first_show_ = false;
#endif
}
}
template<typename T>
+1 -3
View File
@@ -156,9 +156,7 @@ private:
ITaskbarList3* taskbar_interface_;
#endif
#ifdef Q_OS_LINUX
bool checked_graphics_vendor_;
#endif
bool first_show_;
private slots:
void FocusedPanelChanged(PanelWidget* panel);