feat: Invert home button icon color to white
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#include "ViewCube.h"
|
#include "ViewCube.h"
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
#include <QImage>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QOpenGLShaderProgram>
|
#include <QOpenGLShaderProgram>
|
||||||
@@ -229,7 +230,16 @@ void ViewCube::paint2D(QPainter& painter, int widgetWidth, int widgetHeight)
|
|||||||
m_homeButtonRect = QRect(viewCubeX - buttonMargin - buttonSize, viewCubeY, buttonSize, buttonSize);
|
m_homeButtonRect = QRect(viewCubeX - buttonMargin - buttonSize, viewCubeY, buttonSize, buttonSize);
|
||||||
|
|
||||||
if (m_homeButtonRenderer && m_homeButtonRenderer->isValid()) {
|
if (m_homeButtonRenderer && m_homeButtonRenderer->isValid()) {
|
||||||
m_homeButtonRenderer->render(&painter, m_homeButtonRect);
|
QImage image(m_homeButtonRect.size(), QImage::Format_ARGB32_Premultiplied);
|
||||||
|
image.fill(Qt::transparent);
|
||||||
|
|
||||||
|
QPainter imagePainter(&image);
|
||||||
|
m_homeButtonRenderer->render(&imagePainter);
|
||||||
|
imagePainter.end();
|
||||||
|
|
||||||
|
image.invertPixels(QImage::InvertRgb);
|
||||||
|
|
||||||
|
painter.drawImage(m_homeButtonRect, image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user