From a6d46a82806b7a49883e5d19b267e8b294ccc1e8 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Tue, 17 Feb 2026 17:17:15 -0700 Subject: [PATCH] refactor: Update ViewCube home button icon and position --- icons/home.svg | 42 ++++++++++++++++++++++++++++++++++++++++++ resources.qrc | 1 + src/ViewCube.cpp | 6 +++--- 3 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 icons/home.svg diff --git a/icons/home.svg b/icons/home.svg new file mode 100644 index 0000000..f3d9550 --- /dev/null +++ b/icons/home.svg @@ -0,0 +1,42 @@ + + + + + + + diff --git a/resources.qrc b/resources.qrc index a11c90e..698a12f 100644 --- a/resources.qrc +++ b/resources.qrc @@ -7,6 +7,7 @@ icons/circle.svg icons/save-sketch.svg icons/cursor.svg + icons/home.svg src/shaders/simple.vert diff --git a/src/ViewCube.cpp b/src/ViewCube.cpp index 144c360..7ce0b44 100644 --- a/src/ViewCube.cpp +++ b/src/ViewCube.cpp @@ -10,7 +10,7 @@ ViewCube::ViewCube() { - m_homeButtonRenderer = new QSvgRenderer(QString(":/icons/rectangle.svg")); + m_homeButtonRenderer = new QSvgRenderer(QString(":/icons/home.svg")); for (int i = 0; i < 6; ++i) { m_faceTextures[i] = nullptr; } @@ -221,7 +221,7 @@ void ViewCube::paint2D(QPainter& painter, int widgetWidth, int widgetHeight) int viewCubeSize = 150; // logical pixels int buttonSize = 24; - int buttonMargin = 8; + int buttonMargin = -32; int viewCubeX = widgetWidth - viewCubeSize; int viewCubeY = 0; @@ -241,7 +241,7 @@ bool ViewCube::handleMousePress(const QPoint& pos, int widgetWidth, int widgetHe int viewCubeSize = 150; int buttonSize = 24; - int buttonMargin = 8; + int buttonMargin = -32; int viewCubeX = widgetWidth - viewCubeSize; int viewCubeY = 0; QRect homeButtonRect(viewCubeX - buttonMargin - buttonSize, viewCubeY, buttonSize, buttonSize);