feat(geometrySpreadsheet): add icons

This commit is contained in:
parker
2025-08-11 01:37:39 +01:00
parent 03fe287327
commit 8121414be1
7 changed files with 442 additions and 8 deletions

View File

@@ -30,7 +30,6 @@ GeoSheetModeButton::GeoSheetModeButton(QWidget* parent)
// } // }
// )"); // )");
setIcon(QIcon(":/node-icons/grid.svg"));
} }
void GeoSheetModeButton::enterEvent(QEnterEvent *event) void GeoSheetModeButton::enterEvent(QEnterEvent *event)
@@ -68,8 +67,7 @@ void GeoSheetModeButton::paintEvent(QPaintEvent* event)
QPixmap pixmap = buttonIcon.pixmap(size); QPixmap pixmap = buttonIcon.pixmap(size);
QPoint center = event->rect().center() - QPoint(size.width() / 2, size.height() / 2); QPoint center = rect().center() - QPoint(size.width() / 2, size.height() / 2);
// QPoint center = QPoint(0,0);
painter.drawPixmap(center, pixmap); painter.drawPixmap(center, pixmap);
} }
@@ -104,19 +102,20 @@ GeoSheetMenuBarModeSelection::GeoSheetMenuBarModeSelection(QWidget *parent, Qt::
modeButtonGroup_.setExclusive(true); 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(); auto newButton = new GeoSheetModeButton();
newButton->setToolTip(tooltip); newButton->setToolTip(tooltip);
newButton->setIcon(QIcon(iconPath));
modeButtonGroup_.addButton(newButton); modeButtonGroup_.addButton(newButton);
buttonBgLayout->addWidget(newButton); buttonBgLayout->addWidget(newButton);
return newButton; return newButton;
}; };
pointButton = newButton("Point Attributes"); pointButton = newButton("Point Attributes", ":/icons/attributePoint.svg");
vertexButton = newButton("Vertex Attributes"); vertexButton = newButton("Vertex Attributes", ":/icons/attributeVertex.svg");
primitiveButton = newButton("Primitive Attributes"); primitiveButton = newButton("Primitive Attributes", ":/icons/attributePrimitive.svg");
globalButton = newButton("Global Attributes"); globalButton = newButton("Global Attributes", ":/icons/attributeGlobal.svg");
pointButton->setChecked(true); pointButton->setChecked(true);

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -1,5 +1,10 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>node-icons/grid.svg</file> <file>node-icons/grid.svg</file>
<file>icons/attributePoint.svg</file>
<file>icons/attributeVertex.svg</file>
<file>icons/attributePrimitive.svg</file>
<file>icons/attributeGlobal.svg</file>
<file>icons/attributeBase.svg</file>
</qresource> </qresource>
</RCC> </RCC>