View Issue Details

IDProjectCategoryView StatusLast Update
0004717FreeCADFeaturepublic2021-07-31 01:19
ReporterEvgeniy Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product Version0.20 
Summary0004717: Add ability for load ToolBar SVG icons from Python string, like as XPM
DescriptionDiscussion from forum

My view of how it should look like:

# default icon
Icon = """
/* SVG */
static const char *test_icon[]={
"<svg xmlns='http://www.w3.org/2000/svg' height='64' width='64'>",
"<rect height='64' width='64' fill='#204a87' />",
"</svg>"};
"""

# replace fill color
Icon.replace("fill='#204a87'","fill='#00FF00'")


# and icon with changed colors to toolbar

... Command creation code ...
    
def GetResources(self):
    return {"MenuText": "My Command",
        "Accel": "Ctrl+M",
        "ToolTip": "ToolTip command",
        "Pixmap"  : Icon}

Tagspython, SVG, toolbar, UI, workbench
FreeCAD InformationOS: Ubuntu 20.04.2 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.25281 (Git)
Build type: Release
Branch: master
Python version: 3.8.10
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.5.2

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-07-31 01:19 Evgeniy New Issue
2021-07-31 01:19 Evgeniy Tag Attached: python
2021-07-31 01:19 Evgeniy Tag Attached: SVG
2021-07-31 01:19 Evgeniy Tag Attached: toolbar
2021-07-31 01:19 Evgeniy Tag Attached: UI
2021-07-31 01:19 Evgeniy Tag Attached: workbench