Skip to content

Commit

Permalink
Surface: new SVG icon for the workbench, rename others
Browse files Browse the repository at this point in the history
Replace the hard-coded XPM icon in `InitGui.py` for the workbench
with an SVG file, which at this time is identical to the `Surface` icon.
Change `CMakeLists.txt` to properly install this new icon.

Rename all icons, so that all have the `Surface_` prefix.

Use the new icon names in the viewproviders and task panels.
  • Loading branch information
vocx-fc authored and yorikvanhavre committed Sep 30, 2020
1 parent 7208e75 commit 7bf6f72
Show file tree
Hide file tree
Showing 12 changed files with 346 additions and 94 deletions.
12 changes: 10 additions & 2 deletions src/Mod/Surface/Gui/CMakeLists.txt
Expand Up @@ -76,11 +76,19 @@ SET(SurfaceGui_SRCS
# ViewProviderCut.h
)

SET(SurfaceGuiIcon_SVG
Resources/icons/Surface_Workbench.svg
)

link_directories(${OCC_LIBRARY_DIR})
add_library(SurfaceGui SHARED ${SurfaceGui_SRCS})
add_library(SurfaceGui SHARED ${SurfaceGui_SRCS} ${SurfaceGuiIcon_SVG})
target_link_libraries(SurfaceGui ${SurfaceGui_LIBS})

SET_BIN_DIR(SurfaceGui SurfaceGui /Mod/Surface)
SET_PYTHON_PREFIX_SUFFIX(SurfaceGui)


fc_copy_sources(SurfaceGui "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Surface" ${SurfaceGuiIcon_SVG})

install(TARGETS SurfaceGui DESTINATION ${CMAKE_INSTALL_LIBDIR})
INSTALL(FILES ${SurfaceGuiIcon_SVG} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/Surface/Resources/icons")

2 changes: 1 addition & 1 deletion src/Mod/Surface/Gui/Command.cpp
Expand Up @@ -169,7 +169,7 @@ CmdSurfaceGeomFillSurface::CmdSurfaceGeomFillSurface()
sToolTipText = QT_TR_NOOP("Creates a surface from two, three or four boundary edges");
sWhatsThis = "Surface_GeomFillSurface";
sStatusTip = sToolTipText;
sPixmap = "BSplineSurf";
sPixmap = "Surface_BSplineSurface";
}

bool CmdSurfaceGeomFillSurface::isActive(void)
Expand Down
15 changes: 9 additions & 6 deletions src/Mod/Surface/Gui/Resources/Surface.qrc
@@ -1,10 +1,13 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>icons/BezSurf.svg</file>
<file>icons/BSplineSurf.svg</file>
<RCC>
<qresource>
<file>icons/Surface_BezierSurface.svg</file>
<file>icons/Surface_BSplineSurface.svg</file>
<file>icons/Surface_Cut.svg</file>
<file>icons/Surface_Filling.svg</file>
<file>icons/Surface_Sections.svg</file>
<file>icons/Sewing.svg</file>
<file>icons/Surface_Sewing.svg</file>
<file>icons/Surface_Surface.svg</file>
<file>icons/Surface_Workbench.svg</file>
</qresource>
</RCC>
</RCC>

281 changes: 281 additions & 0 deletions src/Mod/Surface/Gui/Resources/icons/Surface_Workbench.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/Mod/Surface/Gui/TaskFilling.cpp
Expand Up @@ -102,7 +102,7 @@ void ViewProviderFilling::unsetEdit(int ModNum)

QIcon ViewProviderFilling::getIcon(void) const
{
return Gui::BitmapFactory().pixmap("BSplineSurf");
return Gui::BitmapFactory().pixmap("Surface_Filling");
}

void ViewProviderFilling::highlightReferences(ShapeType type, const References& refs, bool on)
Expand Down Expand Up @@ -529,7 +529,7 @@ void FillingPanel::on_listBoundary_itemDoubleClicked(QListWidgetItem* item)
const TopTools_ListOfShape& adj_faces = edge2Face.FindFromKey(edge);
if (adj_faces.Extent() > 0) {
int n = adj_faces.Extent();
ui->statusLabel->setText(tr("Edge has %n adjacent face(s)", 0, n));
ui->statusLabel->setText(tr("Edge has %n adjacent faces", 0, n));

// fill up the combo boxes
modifyBoundary(true);
Expand Down Expand Up @@ -818,7 +818,7 @@ TaskFilling::TaskFilling(ViewProviderFilling* vp, Surface::Filling* obj)
// first task box
widget1 = new FillingPanel(vp, obj);
Gui::TaskView::TaskBox* taskbox1 = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("BezSurf"),
Gui::BitmapFactory().pixmap("Surface_Filling"),
widget1->windowTitle(), true, 0);
taskbox1->groupLayout()->addWidget(widget1);
Content.push_back(taskbox1);
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Surface/Gui/TaskGeomFillSurface.cpp
Expand Up @@ -98,7 +98,7 @@ void ViewProviderGeomFillSurface::unsetEdit(int ModNum)

QIcon ViewProviderGeomFillSurface::getIcon(void) const
{
return Gui::BitmapFactory().pixmap("BSplineSurf");
return Gui::BitmapFactory().pixmap("Surface_BSplineSurface");
}

void ViewProviderGeomFillSurface::highlightReferences(bool on)
Expand Down Expand Up @@ -585,7 +585,7 @@ TaskGeomFillSurface::TaskGeomFillSurface(ViewProviderGeomFillSurface* vp, Surfac
widget = new GeomFillSurface(vp, obj);
widget->setWindowTitle(QObject::tr("Surface"));
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("BezSurf"),
Gui::BitmapFactory().pixmap("Surface_BSplineSurface"),
widget->windowTitle(), true, 0);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Surface/Gui/TaskSections.cpp
Expand Up @@ -100,7 +100,7 @@ void ViewProviderSections::unsetEdit(int ModNum)

QIcon ViewProviderSections::getIcon(void) const
{
return Gui::BitmapFactory().pixmap("BSplineSurf");
return Gui::BitmapFactory().pixmap("Surface_Sections");
}

void ViewProviderSections::highlightReferences(ShapeType type, const References& refs, bool on)
Expand Down

0 comments on commit 7bf6f72

Please sign in to comment.