From 8121414be1a31d3a5ae40bdcf9802e11b36e2134 Mon Sep 17 00:00:00 2001 From: parker Date: Mon, 11 Aug 2025 01:37:39 +0100 Subject: [PATCH] feat(geometrySpreadsheet): add icons --- .../GeometrySpreadsheetMenuBar.cpp | 15 +-- static/icons/attributeBase.svg | 76 +++++++++++ static/icons/attributeGlobal.svg | 76 +++++++++++ static/icons/attributePoint.svg | 81 ++++++++++++ static/icons/attributePrimitive.svg | 76 +++++++++++ static/icons/attributeVertex.svg | 121 ++++++++++++++++++ static/resources.qrc | 5 + 7 files changed, 442 insertions(+), 8 deletions(-) create mode 100644 static/icons/attributeBase.svg create mode 100644 static/icons/attributeGlobal.svg create mode 100644 static/icons/attributePoint.svg create mode 100644 static/icons/attributePrimitive.svg create mode 100644 static/icons/attributeVertex.svg diff --git a/src/Gui/GeometrySpreadsheetPanel/GeometrySpreadsheetMenuBar.cpp b/src/Gui/GeometrySpreadsheetPanel/GeometrySpreadsheetMenuBar.cpp index 0b6fe82..1c66af4 100644 --- a/src/Gui/GeometrySpreadsheetPanel/GeometrySpreadsheetMenuBar.cpp +++ b/src/Gui/GeometrySpreadsheetPanel/GeometrySpreadsheetMenuBar.cpp @@ -30,7 +30,6 @@ GeoSheetModeButton::GeoSheetModeButton(QWidget* parent) // } // )"); - setIcon(QIcon(":/node-icons/grid.svg")); } void GeoSheetModeButton::enterEvent(QEnterEvent *event) @@ -68,8 +67,7 @@ void GeoSheetModeButton::paintEvent(QPaintEvent* event) QPixmap pixmap = buttonIcon.pixmap(size); - QPoint center = event->rect().center() - QPoint(size.width() / 2, size.height() / 2); - // QPoint center = QPoint(0,0); + QPoint center = rect().center() - QPoint(size.width() / 2, size.height() / 2); painter.drawPixmap(center, pixmap); } @@ -104,19 +102,20 @@ GeoSheetMenuBarModeSelection::GeoSheetMenuBarModeSelection(QWidget *parent, Qt:: modeButtonGroup_.setExclusive(true); - auto newButton = [this, &buttonBgLayout](const char* tooltip="") + auto newButton = [this, &buttonBgLayout](const char* tooltip="", const char* iconPath=":/icons/attributePoint.svg") { auto newButton = new GeoSheetModeButton(); newButton->setToolTip(tooltip); + newButton->setIcon(QIcon(iconPath)); modeButtonGroup_.addButton(newButton); buttonBgLayout->addWidget(newButton); return newButton; }; - pointButton = newButton("Point Attributes"); - vertexButton = newButton("Vertex Attributes"); - primitiveButton = newButton("Primitive Attributes"); - globalButton = newButton("Global Attributes"); + pointButton = newButton("Point Attributes", ":/icons/attributePoint.svg"); + vertexButton = newButton("Vertex Attributes", ":/icons/attributeVertex.svg"); + primitiveButton = newButton("Primitive Attributes", ":/icons/attributePrimitive.svg"); + globalButton = newButton("Global Attributes", ":/icons/attributeGlobal.svg"); pointButton->setChecked(true); diff --git a/static/icons/attributeBase.svg b/static/icons/attributeBase.svg new file mode 100644 index 0000000..7b27707 --- /dev/null +++ b/static/icons/attributeBase.svg @@ -0,0 +1,76 @@ + + + + diff --git a/static/icons/attributeGlobal.svg b/static/icons/attributeGlobal.svg new file mode 100644 index 0000000..83a219c --- /dev/null +++ b/static/icons/attributeGlobal.svg @@ -0,0 +1,76 @@ + + + + diff --git a/static/icons/attributePoint.svg b/static/icons/attributePoint.svg new file mode 100644 index 0000000..c496ad0 --- /dev/null +++ b/static/icons/attributePoint.svg @@ -0,0 +1,81 @@ + + + + diff --git a/static/icons/attributePrimitive.svg b/static/icons/attributePrimitive.svg new file mode 100644 index 0000000..59fbcdd --- /dev/null +++ b/static/icons/attributePrimitive.svg @@ -0,0 +1,76 @@ + + + + diff --git a/static/icons/attributeVertex.svg b/static/icons/attributeVertex.svg new file mode 100644 index 0000000..84c013b --- /dev/null +++ b/static/icons/attributeVertex.svg @@ -0,0 +1,121 @@ + + + + diff --git a/static/resources.qrc b/static/resources.qrc index e25bec4..21592b0 100644 --- a/static/resources.qrc +++ b/static/resources.qrc @@ -1,5 +1,10 @@ node-icons/grid.svg + icons/attributePoint.svg + icons/attributeVertex.svg + icons/attributePrimitive.svg + icons/attributeGlobal.svg + icons/attributeBase.svg