diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-06-23 17:15:35 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-06-23 17:15:53 +0000 |
| commit | e82a32013c7837f830b11637182ce3da8a097372 (patch) | |
| tree | 3be83a1533bb0d22ca4c6ef1d89aa636fedf2d00 | |
| parent | Update macOS build pipeline (diff) | |
| download | inkscape-e82a32013c7837f830b11637182ce3da8a097372.tar.gz inkscape-e82a32013c7837f830b11637182ce3da8a097372.zip | |
Remove experimental code to work in MR and fixes for selectors
22 files changed, 126 insertions, 653 deletions
diff --git a/share/icons/CMakeLists.txt b/share/icons/CMakeLists.txt index 3080b2482..89bcddf43 100644 --- a/share/icons/CMakeLists.txt +++ b/share/icons/CMakeLists.txt @@ -1,5 +1,4 @@ add_subdirectory(application) add_subdirectory(hicolor) -add_subdirectory(nextgen) add_subdirectory(Tango) diff --git a/share/icons/nextgen/CMakeLists.txt b/share/icons/nextgen/CMakeLists.txt deleted file mode 100644 index 720a3a83e..000000000 --- a/share/icons/nextgen/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -set(THEME nextgen) -install(FILES "index.theme" DESTINATION ${INKSCAPE_SHARE_INSTALL}/icons/${THEME}) - -set(PIXMAP_SIZES "scalable" "symbolic") -set(CONTENT "actions") - -foreach(pixmap_size ${PIXMAP_SIZES}) - foreach(content ${CONTENT}) - FILE(GLOB PIXMAP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${pixmap_size}/${content}/*.png ${CMAKE_CURRENT_SOURCE_DIR}/${pixmap_size}/${content}/*.svg) - install(FILES ${PIXMAP_FILES} DESTINATION ${INKSCAPE_SHARE_INSTALL}/icons/${THEME}/${pixmap_size}/${content}) - endforeach(content) -endforeach(pixmap_size) - -if(WIN32) - install(CODE "execute_process(COMMAND gtk-update-icon-cache \${CMAKE_INSTALL_PREFIX}/${INKSCAPE_SHARE_INSTALL}/icons/${THEME})") -endif() diff --git a/share/icons/nextgen/index.theme b/share/icons/nextgen/index.theme deleted file mode 100644 index 5a7ed7623..000000000 --- a/share/icons/nextgen/index.theme +++ /dev/null @@ -1,64 +0,0 @@ -[Icon Theme] -Name=nextgen -Comment=next generation theme for inkscape -Hidden=true -Directories=scalable/actions,scalable/apps,symbolic/actions,symbolic/apps,16x16/apps,22x22/apps,24x24/apps,32x32/apps,48x48/apps,256x256/apps - -[scalable/actions] -MinSize=8 -Size=16 -MaxSize=512 -Context=Actions -Type=Scalable - -[scalable/apps] -MinSize=8 -Size=16 -MaxSize=512 -Context=Applications -Type=Scalable - -[symbolic/actions] -MinSize=8 -Size=16 -MaxSize=512 -Context=Actions -Type=Scalable - -[symbolic/apps] -MinSize=8 -Size=16 -MaxSize=512 -Context=Applications -Type=Scalable - -[16x16/apps] -Context=Applications -Size=16 -Type=Fixed - -[22x22/apps] -Context=Applications -Size=22 -Type=Fixed - -[24x24/apps] -Context=Applications -Size=24 -Type=Fixed - -[32x32/apps] -Context=Applications -Size=32 -Type=Fixed - -[48x48/apps] -Context=Applications -Size=48 -Type=Fixed - -[256x256/apps] -Context=Applications -Size=256 -Type=Fixed - diff --git a/share/icons/nextgen/scalable/actions/tool-measure.svg b/share/icons/nextgen/scalable/actions/tool-measure.svg deleted file mode 100644 index d52757ddb..000000000 --- a/share/icons/nextgen/scalable/actions/tool-measure.svg +++ /dev/null @@ -1,135 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.1" - id="svg1" - width="16" - height="16" - viewBox="0 0 16 16" - sodipodi:docname="tool-measure-symbolic.svg" - inkscape:version="1.0alpha2 (92053aa9ea, 2019-06-13)"> - <style id="style226"> - .success { fill:#4AD589; } - .warning { fill:#F57900; } - .error { fill:#cc0000; } - </style> - <metadata - id="metadata852"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs850" /> - <sodipodi:namedview - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - id="namedview" - showgrid="true" - inkscape:zoom="31.678384" - inkscape:cx="7.969267" - inkscape:cy="7.571171" - inkscape:window-width="1360" - inkscape:window-height="704" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:current-layer="svg1" - inkscape:document-rotation="0"> - <inkscape:grid - type="xygrid" - id="grid" /> - <style - id="style862">.success { fill:#25FF4E; } -.error { fill:#CC0000; } -.warning { fill:#FF25CE; } -</style> - </sodipodi:namedview> - <rect - style="opacity:0.60953183" - ry="0" - rx="0" - y="2" - x="8.0427818" - height="12.666823" - width="3.0714278" - id="rect878" - class="error" /> - <rect - style="opacity:0.78496546" - class="error" - id="rect856" - width="3.0714278" - height="12.666823" - x="5" - y="2" - rx="0" - ry="0" /> - <g - transform="matrix(0.666667,0,0,0.666667,-189.69806,-598.89953)" - id="tool-measure" - inkscape:label="00336"> - <path - inkscape:connector-curvature="0" - id="rect13362" - d="m 284.54709,898.3493 h 24 v 24 h -24 z" - style="opacity:0;fill:none" /> - <path - style="opacity:1" - d="m 290.6066,900.4247 v 20.9959 h 11.9246 v -17.1209 c 0,-1.8792 -1.1179,-3.875 -3.6875,-3.875 z m 2,2 h 6.1216 c 1.3125,0 1.8125,0.8107 1.8125,1.9375 v 15.0312 h -7.9341 z" - id="path13364" - inkscape:connector-curvature="0" /> - <path - inkscape:connector-curvature="0" - id="rect13370" - d="m 292.65979,903.36218 h 3.25001 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -3.25001 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13372" - d="m 292.65979,911.36218 h 3.25001 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -3.25001 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13376" - d="m 292.72229,917.36218 h 1.18751 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -1.18751 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13378" - d="m 292.72229,915.36218 h 1.18751 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -1.18751 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13380" - d="m 292.72229,913.36218 h 1.18751 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -1.18751 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13382" - d="m 292.72229,909.36218 h 1.18751 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -1.18751 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13384" - d="m 292.72229,907.36218 h 1.18751 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -1.18751 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13386" - d="m 292.72229,905.36218 h 1.18751 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -1.18751 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - </g> -</svg> diff --git a/share/icons/nextgen/symbolic/actions/dialog-align-and-distribute-symbolic.svg b/share/icons/nextgen/symbolic/actions/dialog-align-and-distribute-symbolic.svg deleted file mode 100644 index 836a13c7e..000000000 --- a/share/icons/nextgen/symbolic/actions/dialog-align-and-distribute-symbolic.svg +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) and export_objects.py --> -<svg xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg1" width="16" height="16" viewBox="0 0 16 16" sodipodi:docname="dialog-align-and-distribute-symbolic.svg"><sodipodi:namedview objecttolerance="10" gridtolerance="10" guidetolerance="10" id="namedview" showgrid="true" inkscape:zoom="0.6002936" inkscape:cx="732.67439" inkscape:cy="-567.94603" inkscape:window-width="1920" inkscape:window-height="1016" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" inkscape:current-layer="layer1"> - <inkscape:grid type="xygrid" id="grid"/> - </sodipodi:namedview> - <style id="style226"> - .success { fill:#4AD589; } - .warning { fill:#F57900; } - .error { fill:#cc0000; } - </style> - <g transform="translate(-135,-807.36218)" inkscape:label="00069" id="dialog-align-and-distribute"> - <path inkscape:connector-curvature="0" id="rect18735" d="m 135,807.36218 h 16 v 16 h -16 z" style="opacity:0;fill:none"/> - <path inkscape:connector-curvature="0" id="rect18737" d="m 136,808.36218 h 1 v 13 h -1 z" style="opacity:1"/> - <path inkscape:connector-curvature="0" id="rect18739" class="success" d="m 139,808.36218 h 7 v 3 h -7 z" style="opacity:1"/> - <path inkscape:connector-curvature="0" id="rect18741" class="warning" d="m 139,813.36218 h 10 v 3 h -10 z" style="opacity:1"/> - <path inkscape:connector-curvature="0" id="rect18743" class="error" d="m 139,-821.36218 h 6 v 3 h -6 z" style="opacity:1" transform="scale(1,-1)"/> - </g> - </svg> diff --git a/share/icons/nextgen/symbolic/actions/tool-measure-symbolic.svg b/share/icons/nextgen/symbolic/actions/tool-measure-symbolic.svg deleted file mode 100644 index d52757ddb..000000000 --- a/share/icons/nextgen/symbolic/actions/tool-measure-symbolic.svg +++ /dev/null @@ -1,135 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.1" - id="svg1" - width="16" - height="16" - viewBox="0 0 16 16" - sodipodi:docname="tool-measure-symbolic.svg" - inkscape:version="1.0alpha2 (92053aa9ea, 2019-06-13)"> - <style id="style226"> - .success { fill:#4AD589; } - .warning { fill:#F57900; } - .error { fill:#cc0000; } - </style> - <metadata - id="metadata852"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs850" /> - <sodipodi:namedview - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - id="namedview" - showgrid="true" - inkscape:zoom="31.678384" - inkscape:cx="7.969267" - inkscape:cy="7.571171" - inkscape:window-width="1360" - inkscape:window-height="704" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:current-layer="svg1" - inkscape:document-rotation="0"> - <inkscape:grid - type="xygrid" - id="grid" /> - <style - id="style862">.success { fill:#25FF4E; } -.error { fill:#CC0000; } -.warning { fill:#FF25CE; } -</style> - </sodipodi:namedview> - <rect - style="opacity:0.60953183" - ry="0" - rx="0" - y="2" - x="8.0427818" - height="12.666823" - width="3.0714278" - id="rect878" - class="error" /> - <rect - style="opacity:0.78496546" - class="error" - id="rect856" - width="3.0714278" - height="12.666823" - x="5" - y="2" - rx="0" - ry="0" /> - <g - transform="matrix(0.666667,0,0,0.666667,-189.69806,-598.89953)" - id="tool-measure" - inkscape:label="00336"> - <path - inkscape:connector-curvature="0" - id="rect13362" - d="m 284.54709,898.3493 h 24 v 24 h -24 z" - style="opacity:0;fill:none" /> - <path - style="opacity:1" - d="m 290.6066,900.4247 v 20.9959 h 11.9246 v -17.1209 c 0,-1.8792 -1.1179,-3.875 -3.6875,-3.875 z m 2,2 h 6.1216 c 1.3125,0 1.8125,0.8107 1.8125,1.9375 v 15.0312 h -7.9341 z" - id="path13364" - inkscape:connector-curvature="0" /> - <path - inkscape:connector-curvature="0" - id="rect13370" - d="m 292.65979,903.36218 h 3.25001 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -3.25001 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13372" - d="m 292.65979,911.36218 h 3.25001 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -3.25001 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13376" - d="m 292.72229,917.36218 h 1.18751 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -1.18751 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13378" - d="m 292.72229,915.36218 h 1.18751 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -1.18751 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13380" - d="m 292.72229,913.36218 h 1.18751 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -1.18751 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13382" - d="m 292.72229,909.36218 h 1.18751 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -1.18751 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13384" - d="m 292.72229,907.36218 h 1.18751 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -1.18751 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - <path - inkscape:connector-curvature="0" - id="rect13386" - d="m 292.72229,905.36218 h 1.18751 c 0.277,0 0.5,0.223 0.5,0.5 0,0.277 -0.223,0.5 -0.5,0.5 h -1.18751 c -0.277,0 -0.5,-0.223 -0.5,-0.5 0,-0.277 0.223,-0.5 0.5,-0.5 z" - style="opacity:1" /> - </g> -</svg> diff --git a/share/icons/nextgen/symbolic/actions/tool-spray-symbolic.svg b/share/icons/nextgen/symbolic/actions/tool-spray-symbolic.svg deleted file mode 100644 index 9b9cef1cb..000000000 --- a/share/icons/nextgen/symbolic/actions/tool-spray-symbolic.svg +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.1" - id="svg1" - width="16" - height="16" - viewBox="0 0 16 16" - sodipodi:docname="tool-spray-symbolic.svg" - inkscape:version="1.0alpha2 (33a359e035, 2019-06-16, custom)"> - <metadata - id="metadata2833"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs2831" /> - <sodipodi:namedview - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - id="namedview" - showgrid="true" - inkscape:zoom="12.342567" - inkscape:cx="15.844289" - inkscape:cy="14.659999" - inkscape:window-width="1360" - inkscape:window-height="704" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:current-layer="tool-spray" - inkscape:document-rotation="0"> - <inkscape:grid - type="xygrid" - id="grid" /> - </sodipodi:namedview> - <style id="style226"> - .success { fill:#4AD589; } - .warning { fill:#F57900; } - .error { fill:#cc0000; } - </style> - <g - transform="matrix(0.666667,0,0,0.666667,-190,-681.57467)" - id="tool-spray" - inkscape:label="00153"> - <path - inkscape:connector-curvature="0" - style="opacity:0;fill:none" - d="m 285,1022.362 h 24 v 24 h -24 z" - id="path5769" /> - <path - id="path6331-0" - d="m 303,1029.362 v -2 c -0.5069,-1.555 -3,-1 -3,0 v 2 z" - style="opacity:1" - inkscape:connector-curvature="0" /> - <path - style="opacity:1" - d="M 306.9558,1035.246 306,1034.362 h -9 l -0.9712,1.413 -0.029,6.587 c 2.8952,1.823 3.7348,4.575 11,2 z" - id="path6315-8" - inkscape:connector-curvature="0" /> - <path - id="path5211-1" - d="m 306,1033.362 -2,-3 h -5 l -2,3 z" - style="opacity:1" - inkscape:connector-curvature="0" /> - <path - class="success" - d="m 295.69202,1028.8909 a 0.4268517,0.4268517 0 0 1 -0.42685,0.427 0.4268517,0.4268517 0 0 1 -0.42685,-0.427 0.4268517,0.4268517 0 0 1 0.42685,-0.4268 0.4268517,0.4268517 0 0 1 0.42685,0.4268 z m -4.85558,2.0489 a 0.58746276,0.58746276 0 0 1 -0.58746,0.5876 0.58746276,0.58746276 0 0 1 -0.58746,-0.5876 0.58746276,0.58746276 0 0 1 0.58746,-0.5874 0.58746276,0.58746276 0 0 1 0.58746,0.5874 z m -0.69239,-4.1136 a 0.58746276,0.58746276 0 0 1 -0.58746,0.5876 0.58746276,0.58746276 0 0 1 -0.58746,-0.5876 0.58746276,0.58746276 0 0 1 0.58746,-0.5874 0.58746276,0.58746276 0 0 1 0.58746,0.5874 z m 3.23692,3.3646 a 0.40320532,0.40320532 0 0 1 -0.40321,0.4033 0.40320532,0.40320532 0 0 1 -0.4032,-0.4033 0.40320532,0.40320532 0 0 1 0.4032,-0.4032 0.40320532,0.40320532 0 0 1 0.40321,0.4032 z m -0.44802,-2.6881 a 0.40320532,0.40320532 0 0 1 -0.40321,0.4033 0.40320532,0.40320532 0 0 1 -0.4032,-0.4033 0.40320532,0.40320532 0 0 1 0.4032,-0.4032 0.40320532,0.40320532 0 0 1 0.40321,0.4032 z m -3.73326,1.3041 a 1.3102136,1.3102136 0 0 1 -1.31023,1.3104 1.3102136,1.3102136 0 0 1 -1.31021,-1.3104 1.3102136,1.3102136 0 0 1 1.31021,-1.31 1.3102136,1.3102136 0 0 1 1.31023,1.31 z m 0.97627,-4.0155 a 1.3102134,1.3102134 0 0 1 -1.3102,1.3105 1.3102134,1.3102134 0 0 1 -1.3102,-1.3105 1.3102134,1.3102134 0 0 1 1.3102,-1.31 1.3102134,1.3102134 0 0 1 1.3102,1.31 z m 0.71993,8.6872 a 1.3102134,1.3102134 0 0 1 -1.31021,1.3108 1.3102134,1.3102134 0 0 1 -1.3102,-1.3108 1.3102134,1.3102134 0 0 1 1.3102,-1.3101 1.3102134,1.3102134 0 0 1 1.31021,1.3101 z m 1.3326,-4.6721 a 0.88191682,0.88191682 0 0 1 -0.88193,0.882 0.88191682,0.88191682 0 0 1 -0.88191,-0.882 0.88191682,0.88191682 0 0 1 0.88191,-0.8818 0.88191682,0.88191682 0 0 1 0.88193,0.8818 z m 0.68938,-2.9065 a 0.88191672,0.88191672 0 0 1 -0.88191,0.8821 0.88191672,0.88191672 0 0 1 -0.88191,-0.8821 0.88191672,0.88191672 0 0 1 0.88191,-0.8818 0.88191672,0.88191672 0 0 1 0.88191,0.8818 z m 0.62291,5.8894 a 0.88191672,0.88191672 0 0 1 -0.88191,0.8823 0.88191672,0.88191672 0 0 1 -0.88191,-0.8823 0.88191672,0.88191672 0 0 1 0.88191,-0.8818 0.88191672,0.88191672 0 0 1 0.88191,0.8818 z m 0.70395,-2.9833 a 0.58746283,0.58746283 0 0 1 -0.58747,0.5875 0.58746283,0.58746283 0 0 1 -0.58746,-0.5875 0.58746283,0.58746283 0 0 1 0.58746,-0.5874 0.58746283,0.58746283 0 0 1 0.58747,0.5874 z m 0.62388,-1.9798 a 0.58746276,0.58746276 0 0 1 -0.58746,0.5876 0.58746276,0.58746276 0 0 1 -0.58746,-0.5876 0.58746276,0.58746276 0 0 1 0.58746,-0.5874 0.58746276,0.58746276 0 0 1 0.58746,0.5874 z m 0.3318,3.9721 a 0.58746276,0.58746276 0 0 1 -0.58746,0.5877 0.58746276,0.58746276 0 0 1 -0.58746,-0.5877 0.58746276,0.58746276 0 0 1 0.58746,-0.5874 0.58746276,0.58746276 0 0 1 0.58746,0.5874 z m 1.22645,-3.0714 a 0.4268517,0.4268517 0 0 1 -0.42685,0.427 0.4268517,0.4268517 0 0 1 -0.42685,-0.427 0.4268517,0.4268517 0 0 1 0.42685,-0.4268 0.4268517,0.4268517 0 0 1 0.42685,0.4268 z m 0,2.2082 a 0.4268517,0.4268517 0 0 1 -0.42685,0.427 0.4268517,0.4268517 0 0 1 -0.42685,-0.427 0.4268517,0.4268517 0 0 1 0.42685,-0.4268 0.4268517,0.4268517 0 0 1 0.42685,0.4268 z m 0.74191,-1.1291 a 0.40320532,0.40320532 0 0 1 -0.40321,0.4033 0.40320532,0.40320532 0 0 1 -0.4032,-0.4033 0.40320532,0.40320532 0 0 1 0.4032,-0.4032 0.40320532,0.40320532 0 0 1 0.40321,0.4032 z" - id="use30430" /> - </g> -</svg> diff --git a/share/icons/nextgen/symbolic/actions/tool-tweak-symbolic.svg b/share/icons/nextgen/symbolic/actions/tool-tweak-symbolic.svg deleted file mode 100644 index efe1b6b98..000000000 --- a/share/icons/nextgen/symbolic/actions/tool-tweak-symbolic.svg +++ /dev/null @@ -1,97 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - inkscape:version="1.0alpha2 (33a359e035, 2019-06-16, custom)" - sodipodi:docname="tool-tweak-symbolic.svg" - viewBox="0 0 16 16" - height="16" - width="16" - id="svg1" - version="1.1"> - <metadata - id="metadata943"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs941"> - <inkscape:path-effect - id="path-effect949" - allow_transforms="false" - method="bsplinespiro" - linkeditem="#path945" - effect="clone_original" /> - <inkscape:path-effect - attempt_force_join="true" - miter_limit="100" - linejoin_type="extrp_arc" - line_width="2" - linecap_type="butt" - is_visible="true" - id="path-effect947" - effect="join_type" /> - </defs> - <sodipodi:namedview - inkscape:document-rotation="0" - inkscape:current-layer="tool-tweak" - inkscape:window-maximized="1" - inkscape:window-y="27" - inkscape:window-x="0" - inkscape:window-height="704" - inkscape:window-width="1360" - inkscape:cy="14.485603" - inkscape:cx="8.5107553" - inkscape:zoom="15.84375" - showgrid="true" - id="namedview" - guidetolerance="10" - gridtolerance="10" - objecttolerance="10"> - <inkscape:grid - id="grid" - type="xygrid" /> - </sodipodi:namedview> - <style id="style226"> - .success { fill:#4AD589; } - .warning { fill:#F57900; } - .error { fill:#cc0000; } - </style> - <g - inkscape:label="00155" - id="tool-tweak" - transform="matrix(0.666667,0,0,0.666667,-190,-702.2414)"> - <path - style="opacity:0;fill:none" - d="m 285,1053.3621 h 24 v 24 h -24 z" - id="rect4400" - inkscape:connector-curvature="0" /> - <path - transform="translate(0.45564625,-0.53843343)" - inkscape:original-d="m 299.1929,1056.371 c -1.0952,-0.05 -2.1049,0.13 -2.7404,0.528 -5.4824,3.44 -2.3872,12.059 -10.4395,10.501 l -0.044,9.025 h 21.0312 l 0.044,-9.025 c -5.4826,1.244 -7.7633,-0.221 -8.8391,-2.661 -0.9536,-2.163 -0.193,-4.085 1.0834,-4.316 2.5235,-0.459 2.2613,1.245 3.7602,1.673 1.4248,0.407 1.8586,-0.955 0.8603,-3.083 -0.8381,-1.786 -2.8906,-2.557 -4.716,-2.642 z" - inkscape:path-effect="#path-effect947" - d="m 295.921,1056.0519 c -3.61141,2.2661 -3.9697,6.5991 -5.20799,8.8302 -0.70199,1.2649 -1.69758,2.0803 -4.51005,1.5361 a 12.437438,12.437438 0 0 1 -1.18377,-0.2899 l -0.0551,11.2967 h 23.03123 l 0.0552,-11.3117 a 24.948496,24.948496 0 0 1 -1.22757,0.3115 c -5.14723,1.1679 -6.85331,-0.1625 -7.7028,-2.0892 -0.79144,-1.7952 -0.0697,-2.8533 0.34733,-2.9287 2.08613,-0.3795 1.06949,1.0119 3.30658,1.6506 2.59277,0.7407 3.25967,-1.87 2.04025,-4.4693 -1.04408,-2.225 -3.51886,-3.1204 -5.57477,-3.2161 a 8.1529359,8.1529359 0 0 0 -0.024,-0 l -0.0226,0 a 1,1 0 0 0 0.0456,10e-4 c -1.1981,-0.055 -2.46463,0.1458 -3.31751,0.6799 z m 3.272,1.3191 a 1,1 0 0 0 -0.0465,-0 c 1.59489,0.074 3.22511,0.7209 3.85718,2.0678 0.45528,0.9705 0.49384,1.547 0.42371,1.7879 0,0 0.0649,-0.059 0.0649,-0.059 -0.0168,-0 -0.038,-0 -0.0644,-0.01 -0.0293,-0.01 -0.0641,-0.013 -0.10462,-0.025 -0.84047,-0.24 -1.30016,-2.2252 -4.21285,-1.6954 -2.13664,0.3867 -2.9361,3.1726 -1.82033,5.7034 1.3021,2.9533 4.15742,4.5529 9.97539,3.2328 a 1,1 0 0 0 -1.22127,-0.9801 l -0.044,9.025 a 1,1 0 0 0 0.99999,-0.9951 H 285.969 a 1,1 0 0 0 0.99999,1.0049 l 0.044,-9.025 a 1,1 0 0 0 -1.18995,0.9769 c 3.62937,0.7022 5.50842,-0.4926 6.63869,-2.5291 1.51008,-2.7208 1.5548,-6.2447 4.52155,-8.1062 0.41884,-0.2623 1.17171,-0.4218 2.16401,-0.3765 a 7.6406572,7.6406572 0 0 1 0.0221,0 z" - id="path945" - inkscape:connector-curvature="0" /> - <path - class="warning" - style="" - inkscape:connector-curvature="0" - transform="translate(0.45564625,-0.53843343)" - inkscape:original-d="M 0,0" - inkscape:path-effect="#path-effect949" - id="path951" - d="m 299.1929,1056.371 c -1.0952,-0.05 -2.1049,0.13 -2.7404,0.528 -5.4824,3.44 -2.3872,12.059 -10.4395,10.501 l -0.044,9.025 h 21.0312 l 0.044,-9.025 c -5.4826,1.244 -7.7633,-0.221 -8.8391,-2.661 -0.9536,-2.163 -0.193,-4.085 1.0834,-4.316 2.5235,-0.459 2.2613,1.245 3.7602,1.673 1.4248,0.407 1.8586,-0.955 0.8603,-3.083 -0.8381,-1.786 -2.8906,-2.557 -4.716,-2.642 z" /> - </g> -</svg> diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 7b250f6dd..1871bff85 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -54,6 +54,9 @@ #include "libnrtype/FontFactory.h" +#include "object/sp-root.h" +#include "object/sp-style-elem.h" + #include "svg/svg-color.h" #include "ui/dialog/debug.h" @@ -417,29 +420,12 @@ Application::add_gtk_css() if (prefs->getBool("/theme/symbolicIcons", false)) { if (!prefs->getBool("/theme/symbolicIconsDefaultColor", true)) { gchar colornamed[64]; - gchar colornamedsuccess[64]; - gchar colornamedwarning[64]; - gchar colornamederror[64]; gchar colornamed_inverse[64]; int colorset = prefs->getInt("/theme/symbolicColor", 0x2E3436ff); sp_svg_write_color(colornamed, sizeof(colornamed), colorset); - int colorsetsuccess = prefs->getInt("/theme/symbolicSuccessColor", 0x4AD589ff); - sp_svg_write_color(colornamedsuccess, sizeof(colornamedsuccess), colorsetsuccess); - int colorsetwarning = prefs->getInt("/theme/symbolicWarningColor", 0xF57900ff); - sp_svg_write_color(colornamedwarning, sizeof(colornamedwarning), colorsetwarning); - int colorseterror = prefs->getInt("/theme/symbolicErrorColor", 0xcc0000ff); - sp_svg_write_color(colornamederror, sizeof(colornamederror), colorseterror); // Use in case the special widgets have inverse theme background and symbolic int colorset_inverse = colorset ^ 0xffffff00; sp_svg_write_color(colornamed_inverse, sizeof(colornamed_inverse), colorset_inverse); - - css_str += "*{-gtk-icon-palette: success "; - css_str += colornamedsuccess; - css_str += ", warning "; - css_str += colornamedwarning; - css_str += ", error "; - css_str += colornamederror; - css_str += ";}"; css_str += "SPRuler, ruler-widget,"; css_str += ".bright image, .dark image"; css_str += "{color:"; @@ -479,6 +465,30 @@ Application::add_gtk_css() } } +void Application::readStyleSheets(bool forceupd) +{ + SPDocument *document = SP_ACTIVE_DOCUMENT; + Inkscape::XML::Node *root = document->getReprRoot(); + std::vector<Inkscape::XML::Node *> styles; + for (unsigned i = 0; i < root->childCount(); ++i) { + Inkscape::XML::Node *child = root->nthChild(i); + if (child && strcmp(child->name(), "svg:style") == 0) { + styles.insert(styles.begin(), child); + } + } + if (forceupd || styles.size() > 1) { + document->setStyleSheet(nullptr); + for (auto style : styles) { + gchar const *id = style->attribute("id"); + if (id) { + SPStyleElem *styleelem = dynamic_cast<SPStyleElem *>(document->getObjectById(id)); + styleelem->read_content(); + } + } + document->getRoot()->emitModified(SP_OBJECT_MODIFIED_CASCADE); + } +} + /* \brief Constructor for the application. * Creates a new Inkscape::Application. * diff --git a/src/inkscape.h b/src/inkscape.h index 815da0f1d..a673f0d49 100644 --- a/src/inkscape.h +++ b/src/inkscape.h @@ -124,6 +124,7 @@ public: void switch_desktops_prev (); void get_all_desktops (std::list< SPDesktop* >& listbuf); void reactivate_desktop (SPDesktop * desktop); + void readStyleSheets(bool forceupd = false); SPDesktop * find_desktop_by_dkey (unsigned int dkey); unsigned int maximum_dkey(); SPDesktop * next_desktop (); @@ -176,7 +177,9 @@ public: sigc::signal<void, SPDesktop *> signal_activate_desktop; // some desktop lost focus sigc::signal<void, SPDesktop *> signal_deactivate_desktop; - + // user change theme + sigc::signal<void> signal_change_theme; + // these are orphaned signals (nothing emits them and nothing connects to them) sigc::signal<void, SPDocument *> signal_destroy_document; sigc::signal<void, SPColor *, double /*opacity*/> signal_color_set; diff --git a/src/object/sp-style-elem.cpp b/src/object/sp-style-elem.cpp index 439a1b3cb..3b93ff190 100644 --- a/src/object/sp-style-elem.cpp +++ b/src/object/sp-style-elem.cpp @@ -188,10 +188,6 @@ import_style_cb (CRDocHandler *a_handler, std::cerr << "import_style_cb: No document!" << std::endl; return; } - if (!document->getStyleSheet()) { - std::cerr << "import_style_cb: No document style sheet!" << std::endl; - return; - } if (!document->getDocumentURI()) { std::cerr << "import_style_cb: Document URI is NULL" << std::endl; return; @@ -207,7 +203,15 @@ import_style_cb (CRDocHandler *a_handler, CRStatus const parse_status = cr_parser_parse_file (parser, reinterpret_cast<const guchar *>(import_file.c_str()), CR_UTF_8); if (parse_status == CR_OK) { - cr_stylesheet_append_import (document->getStyleSheet(), stylesheet); + if (!document->getStyleSheet()) { + // if the style is the first style sheet that we've seen, set the document's + // first style sheet to this style and create a cascade object with it. + document->setStyleSheet(stylesheet); + cr_cascade_set_sheet(document->getStyleCascade(), document->getStyleSheet(), ORIGIN_AUTHOR); + } else { + // If not the first, then chain up this style_sheet + cr_stylesheet_append_import(document->getStyleSheet(), stylesheet); + } } else { std::cerr << "import_style_cb: Could not parse: " << import_file << std::endl; cr_stylesheet_destroy (stylesheet); diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index fa975f8b9..569908868 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -79,10 +79,6 @@ R"=====( inkscape:window-height="480" /> </group> - <group id="theme" - gtkTheme="" iconTheme="" symbolicIcons="0" darkTheme="0" symbolicColor="0x2E3436ff" > - </group> - <group id="tools" bounding_box="0"> <group id="shapes" style="fill-rule:evenodd;" selcue="1" gradientdrag="1"> diff --git a/src/ui/dialog/dialog-manager.cpp b/src/ui/dialog/dialog-manager.cpp index 727e578e2..66a682de6 100644 --- a/src/ui/dialog/dialog-manager.cpp +++ b/src/ui/dialog/dialog-manager.cpp @@ -16,14 +16,14 @@ #include "ui/dialog/dialog-manager.h" -#include "ui/dialog/prototype.h" +#include "style.h" #include "ui/dialog/align-and-distribute.h" #include "ui/dialog/document-metadata.h" #include "ui/dialog/document-properties.h" #include "ui/dialog/extension-editor.h" #include "ui/dialog/fill-and-stroke.h" -#include "ui/dialog/filter-effects-dialog.h" #include "ui/dialog/filter-editor.h" +#include "ui/dialog/filter-effects-dialog.h" #include "ui/dialog/find.h" #include "ui/dialog/glyphs.h" #include "ui/dialog/inkscape-preferences.h" @@ -31,6 +31,7 @@ #include "ui/dialog/livepatheffect-editor.h" #include "ui/dialog/memory.h" #include "ui/dialog/messages.h" +#include "ui/dialog/prototype.h" #include "ui/dialog/symbols.h" #include "ui/dialog/tile.h" diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp index 2ba2856ff..3baec5106 100644 --- a/src/ui/dialog/dialog.cpp +++ b/src/ui/dialog/dialog.cpp @@ -74,11 +74,13 @@ Dialog::Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_pat INKSCAPE.signal_dialogs_hide.connect(sigc::mem_fun(*this, &Dialog::onHideF12)); INKSCAPE.signal_dialogs_unhide.connect(sigc::mem_fun(*this, &Dialog::onShowF12)); INKSCAPE.signal_shut_down.connect(sigc::mem_fun(*this, &Dialog::onShutdown)); + INKSCAPE.signal_change_theme.connect(sigc::mem_fun(*this, &Dialog::addTopWindowClasses)); Glib::wrap(gobj())->signal_event().connect(sigc::mem_fun(*this, &Dialog::_onEvent)); Glib::wrap(gobj())->signal_key_press_event().connect(sigc::mem_fun(*this, &Dialog::_onKeyPress)); read_geometry(); + addTopWindowClasses(); } Dialog::~Dialog() @@ -308,6 +310,31 @@ Dialog::_getSelection() return SP_ACTIVE_DESKTOP->getSelection(); } +void Dialog::addTopWindowClasses() +{ + SPDesktop *desktop = SP_ACTIVE_DESKTOP; + if (desktop) { + Gtk::Widget *canvas = Glib::wrap(GTK_WIDGET(desktop->canvas)); + Gtk::Window *toplevel_window = dynamic_cast<Gtk::Window *>(canvas->get_toplevel()); + if (toplevel_window) { + if (toplevel_window->get_style_context()->has_class("dark")) { + Glib::wrap(gobj())->get_style_context()->add_class("dark"); + Glib::wrap(gobj())->get_style_context()->remove_class("bright"); + } else { + Glib::wrap(gobj())->get_style_context()->add_class("bright"); + Glib::wrap(gobj())->get_style_context()->remove_class("dark"); + } + if (toplevel_window->get_style_context()->has_class("symbolic")) { + Glib::wrap(gobj())->get_style_context()->add_class("symbolic"); + Glib::wrap(gobj())->get_style_context()->remove_class("regular"); + } else { + Glib::wrap(gobj())->get_style_context()->remove_class("symbolic"); + Glib::wrap(gobj())->get_style_context()->add_class("regular"); + } + } + } +} + } // namespace Dialog } // namespace UI } // namespace Inkscape diff --git a/src/ui/dialog/dialog.h b/src/ui/dialog/dialog.h index 404f4f9a3..7b668a4ba 100644 --- a/src/ui/dialog/dialog.h +++ b/src/ui/dialog/dialog.h @@ -144,9 +144,11 @@ protected: sigc::connection _dialogs_hidden_connection; sigc::connection _dialogs_unhidden_connection; sigc::connection _shutdown_connection; + sigc::connection _change_theme_connection; -private: + private: Behavior::Behavior* _behavior; + void addTopWindowClasses(); Dialog() = delete; // no constructor without params diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 6151eeef0..0b7b68304 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -480,7 +480,7 @@ void InkscapePreferences::initPageTools() cb->init ( _("Show font samples in the drop-down list"), "/tools/text/show_sample_in_list", true); _page_text.add_line( false, "", *cb, "", _("Show font samples alongside font names in the drop-down list in Text bar")); - _font_dialog.init ( _("Show font substitution warning dialog"), "/options/font/substitutedlg", false); + _font_dialog.init ( _("Show font substitution inng dialog"), "/options/font/substitutedlg", false); _page_text.add_line( false, "", _font_dialog, "", _("Show font substitution warning dialog when requested fonts are not available on the system")); cb = Gtk::manage(new PrefCheckButton); @@ -651,28 +651,12 @@ void InkscapePreferences::symbolicStyling() Glib::ustring css_str = ""; if (prefs->getBool("/theme/symbolicIcons", false)) { gchar colornamed[64]; - gchar colornamedsuccess[64]; - gchar colornamedwarning[64]; - gchar colornamederror[64]; gchar colornamed_inverse[64]; int colorset = prefs->getInt("/theme/symbolicColor", 0x2E3436ff); sp_svg_write_color(colornamed, sizeof(colornamed), colorset); - int colorsetsuccess = prefs->getInt("/theme/symbolicSuccessColor", 0x4AD589ff); - sp_svg_write_color(colornamedsuccess, sizeof(colornamedsuccess), colorsetsuccess); - int colorsetwarning = prefs->getInt("/theme/symbolicWarningColor", 0xF57900ff); - sp_svg_write_color(colornamedwarning, sizeof(colornamedwarning), colorsetwarning); - int colorseterror = prefs->getInt("/theme/symbolicErrorColor", 0xcc0000ff); - sp_svg_write_color(colornamederror, sizeof(colornamederror), colorseterror); // Use in case the special widgets have inverse theme background and symbolic int colorset_inverse = colorset ^ 0xffffff00; sp_svg_write_color(colornamed_inverse, sizeof(colornamed_inverse), colorset_inverse); - css_str += "*{-gtk-icon-palette: success "; - css_str += colornamedsuccess; - css_str += ", warning "; - css_str += colornamedwarning; - css_str += ", error "; - css_str += colornamederror; - css_str += ";}"; css_str += "SPRuler, ruler-widget,"; css_str += ".bright image, .dark image"; css_str += "{color:"; @@ -694,6 +678,7 @@ void InkscapePreferences::symbolicStyling() window->get_style_context()->remove_class("symbolic"); } } + INKSCAPE.signal_change_theme.emit(); try { INKSCAPE.colorizeprovider->load_from_data(css_str); } catch (const Gtk::CssProviderError &ex) { @@ -732,9 +717,15 @@ void InkscapePreferences::themeChange() window->get_style_context()->add_class("bright"); window->get_style_context()->remove_class("dark"); } + INKSCAPE.signal_change_theme.emit(); } } +void InkscapePreferences::changeIconsColor(guint32 /*color*/) +{ + symbolicStyling(); +} + void InkscapePreferences::initPageUI() { Gtk::TreeModel::iterator iter_ui = this->AddPage(_page_ui, _("Interface"), PREFS_PAGE_UI); @@ -964,24 +955,15 @@ void InkscapePreferences::initPageUI() _symbolic_icons.signal_clicked().connect(sigc::mem_fun(*this, &InkscapePreferences::symbolicStyling)); _page_theme.add_line(true, "", _symbolic_icons, "", "", true); _symbolic_color.init(_("Color for symbolic icons:"), "/theme/symbolicColor", 0x2E3436ff); - _symbolic_success_color.init(_("Color for symbolic success icons:"), "/theme/symbolicSuccessColor", 0x4AD589ff); - _symbolic_warning_color.init(_("Color for symbolic warning icons:"), "/theme/symbolicWarningColor", 0xF57900ff); - _symbolic_error_color.init(_("Color for symbolic error icons:"), "/theme/symbolicErrorColor", 0xcc0000ff); Gtk::Label *_symbolic_color_label = Gtk::manage(new Gtk::Label(_("Change colors:"))); - Gtk::Button *apply_color = Gtk::manage(new Gtk::Button(_("Apply color"))); - apply_color->set_tooltip_text(_("Apply color to symbolic icons)")); - apply_color->signal_clicked().connect(sigc::mem_fun(*this, &InkscapePreferences::symbolicStyling)); Gtk::Button *theme_decide_color = Gtk::manage(new Gtk::Button(_("Theme decides"))); theme_decide_color->set_tooltip_text(_("Theme decide symbolic icon color)")); theme_decide_color->signal_clicked().connect(sigc::mem_fun(*this, &InkscapePreferences::symbolicDefaultColor)); Gtk::Box *icon_buttons = Gtk::manage(new Gtk::Box()); icon_buttons->pack_start(*_symbolic_color_label, true, true, 4); icon_buttons->pack_start(_symbolic_color, true, true, 4); - icon_buttons->pack_start(_symbolic_success_color, true, true, 4); - icon_buttons->pack_start(_symbolic_warning_color, true, true, 4); - icon_buttons->pack_start(_symbolic_error_color, true, true, 4); - icon_buttons->pack_start(*apply_color, true, true, 4); icon_buttons->pack_start(*theme_decide_color, true, true, 4); + _symbolic_color.connectChanged(sigc::mem_fun(this, &InkscapePreferences::changeIconsColor)); _page_theme.add_line(false,"", *icon_buttons, "", _("Color for symbolic icons, theme based or custom. Some icon color changes need reload"), false ); { Glib::ustring sizeLabels[] = { C_("Icon size", "Larger"), C_("Icon size", "Large"), C_("Icon size", "Small"), diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index c946eb6bd..3e0134e4d 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -246,14 +246,10 @@ protected: UI::Widget::PrefCheckButton _dark_theme; UI::Widget::PrefCheckButton _symbolic_icons; UI::Widget::PrefColorPicker _symbolic_color; - UI::Widget::PrefColorPicker _symbolic_warning_color; - UI::Widget::PrefColorPicker _symbolic_error_color; - UI::Widget::PrefColorPicker _symbolic_success_color; UI::Widget::PrefCombo _misc_small_toolbar; UI::Widget::PrefCombo _misc_small_secondary; UI::Widget::PrefCombo _misc_small_tools; UI::Widget::PrefCombo _menu_icons; - Gtk::Button _apply_theme; UI::Widget::PrefRadioButton _win_dockable; UI::Widget::PrefRadioButton _win_floating; @@ -591,6 +587,7 @@ protected: private: void themeChange(); + void changeIconsColor(guint32 /*color*/); void symbolicThemeCheck(); void symbolicStyling(); void symbolicDefaultColor(); diff --git a/src/ui/dialog/selectorsdialog.cpp b/src/ui/dialog/selectorsdialog.cpp index acb8eea6e..4300adacf 100644 --- a/src/ui/dialog/selectorsdialog.cpp +++ b/src/ui/dialog/selectorsdialog.cpp @@ -315,8 +315,16 @@ SelectorsDialog::SelectorsDialog() if ( col ) { col->add_attribute(addRenderer->property_icon(), _mColumns._colType); } - _treeView.append_column("CSS Selector", _mColumns._colSelector); + + Gtk::CellRendererText *label = Gtk::manage(new Gtk::CellRendererText()); + addCol = _treeView.append_column("CSS Selector", *label) - 1; + col = _treeView.get_column(addCol); + if (col) { + col->add_attribute(label->property_text(),_mColumns._colSelector); + col->add_attribute(label->property_weight(), _mColumns._colSelected); + } _treeView.set_expander_column(*(_treeView.get_column(1))); + // Signal handlers _treeView.signal_button_release_event().connect( // Needs to be release, not press. @@ -484,7 +492,6 @@ Inkscape::XML::Node *SelectorsDialog::_getStyleTextNode() return textNode; } - /** * Fill the Gtk::TreeStore from the svg:style element. */ @@ -585,6 +592,7 @@ void SelectorsDialog::_readStyleElement() row[_mColumns._colObj] = objVec; row[_mColumns._colProperties] = properties; row[_mColumns._colVisible] = true; + row[_mColumns._colSelected] = 400; // Add as children, objects that match selector. for (auto &obj : objVec) { Gtk::TreeModel::Row childrow = *(_store->append(row->children())); @@ -595,6 +603,7 @@ void SelectorsDialog::_readStyleElement() childrow[_mColumns._colObj] = std::vector<SPObject *>(1, obj); childrow[_mColumns._colProperties] = ""; // Unused childrow[_mColumns._colVisible] = true; // Unused + childrow[_mColumns._colSelected] = 400; } } @@ -628,7 +637,6 @@ void SelectorsDialog::_writeStyleElement() } _updating = true; SPDocument *document = SP_ACTIVE_DOCUMENT; - document->setStyleSheet(nullptr); Glib::ustring styleContent; for (auto& row: _store->children()) { Glib::ustring selector = row[_mColumns._colSelector]; @@ -645,10 +653,11 @@ void SelectorsDialog::_writeStyleElement() // harm in keeping it around ... Inkscape::XML::Node *textNode = _getStyleTextNode(); textNode->setContent(styleContent.c_str()); - + INKSCAPE.readStyleSheets(true); DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_SELECTORS, _("Edited style element.")); _updating = false; + g_debug("SelectorsDialog::_writeStyleElement(): | %s |", styleContent.c_str()); } @@ -811,6 +820,7 @@ void SelectorsDialog::_addToSelector(Gtk::TreeModel::Row row) childrow[_mColumns._colObj] = std::vector<SPObject *>(1, obj); childrow[_mColumns._colProperties] = ""; // Unused childrow[_mColumns._colVisible] = true; // Unused + childrow[_mColumns._colSelected] = 400; } objVec = _getObjVec(multiselector); row[_mColumns._colSelector] = multiselector; @@ -835,6 +845,7 @@ void SelectorsDialog::_removeFromSelector(Gtk::TreeModel::Row row) SPObject *obj = nullptr; Glib::ustring objectLabel = row[_mColumns._colSelector]; Gtk::TreeModel::iterator iter = row->parent(); + Inkscape::Selection *selection = getDesktop()->getSelection(); if (iter) { Gtk::TreeModel::Row parent = *iter; Glib::ustring multiselector = parent[_mColumns._colSelector]; @@ -871,10 +882,6 @@ void SelectorsDialog::_removeFromSelector(Gtk::TreeModel::Row row) // Add entry to style element _writeStyleElement(); - if (obj) { - obj->style->readFromObject(obj); - obj->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); - } } } @@ -1025,14 +1032,14 @@ void SelectorsDialog::_removeClass(SPObject *obj, const Glib::ustring &className void SelectorsDialog::_selectObjects(int eventX, int eventY) { g_debug("SelectorsDialog::_selectObjects: %d, %d", eventX, eventY); - getDesktop()->selection->clear(); Gtk::TreeViewColumn *col = _treeView.get_column(1); Gtk::TreeModel::Path path; int x2 = 0; int y2 = 0; // To do: We should be able to do this via passing in row. if (_treeView.get_path_at_pos(eventX, eventY, path, col, x2, y2)) { - if (col == _treeView.get_column(1)) { + if (col == _treeView.get_column(1) && x2 > 25) { + getDesktop()->selection->clear(); Gtk::TreeModel::iterator iter = _store->get_iter(path); if (iter) { Gtk::TreeModel::Row row = *iter; @@ -1159,6 +1166,7 @@ void SelectorsDialog::_addSelector() row[_mColumns._colObj] = objVec; row[_mColumns._colProperties] = ""; row[_mColumns._colVisible] = true; + row[_mColumns._colSelected] = 400; for (auto &obj : objVec) { Gtk::TreeModel::Row childrow = *(_store->append(row->children())); childrow[_mColumns._colSelector] = "#" + Glib::ustring(obj->getId()); @@ -1167,6 +1175,7 @@ void SelectorsDialog::_addSelector() childrow[_mColumns._colObj] = std::vector<SPObject *>(1, obj); childrow[_mColumns._colProperties] = ""; // Unused childrow[_mColumns._colVisible] = true; // Unused + childrow[_mColumns._colSelected] = 400; } // Add entry to style element _writeStyleElement(); @@ -1219,18 +1228,11 @@ bool SelectorsDialog::_handleButtonEvent(GdkEventButton *event) if (_treeView.get_path_at_pos(x, y, path, col, x2, y2)) { if (col == _treeView.get_column(0)) { - bool remove_parent = false; Gtk::TreeModel::iterator iter = _store->get_iter(path); Gtk::TreeModel::Row row = *iter; - Glib::RefPtr<Gtk::TreeSelection> sel = _treeView.get_selection(); - sel->select(row); - // Add or remove objects from a - Gtk::TreeModel::Row row_to_sel; if (!row.parent()) { - row_to_sel = row; _addToSelector(row); } else { - row_to_sel = *row.parent(); _removeFromSelector(row); } } @@ -1377,20 +1379,26 @@ void SelectorsDialog::_selectRow() } else { _style_dialog->setCurrentSelector(""); } - for (auto row : children) { - std::vector<SPObject *> objVec = row[_mColumns._colObj]; - if (obj) { - for (auto & i : objVec) { - if (obj->getId() == i->getId()) { + Gtk::TreeModel::Children subchildren = row->children(); + for (auto subrow : subchildren) { + subrow[_mColumns._colSelected] = 400; + } + } + for (auto obj: selection->items()) { + for (auto row : children) { + Gtk::TreeModel::Children subchildren = row->children(); + for (auto subrow : subchildren) { + std::vector<SPObject *> objVec = subrow[_mColumns._colObj]; + if (obj->getId() == objVec[0]->getId()) { _treeView.get_selection()->select(row); row[_mColumns._colVisible] = true; - break; + subrow[_mColumns._colSelected] = 700; } } - } - if (row[_mColumns._colExpand]) { - _treeView.expand_to_path(Gtk::TreePath(row)); + if (row[_mColumns._colExpand]) { + _treeView.expand_to_path(Gtk::TreePath(row)); + } } } } diff --git a/src/ui/dialog/selectorsdialog.h b/src/ui/dialog/selectorsdialog.h index 109ffaf22..4a0e8dc1b 100644 --- a/src/ui/dialog/selectorsdialog.h +++ b/src/ui/dialog/selectorsdialog.h @@ -80,6 +80,7 @@ class SelectorsDialog : public Widget::Panel { add(_colObj); add(_colProperties); add(_colVisible); + add(_colSelected); } Gtk::TreeModelColumn<Glib::ustring> _colSelector; // Selector or matching object id. Gtk::TreeModelColumn<bool> _colExpand; // Open/Close store row. @@ -87,6 +88,7 @@ class SelectorsDialog : public Widget::Panel { Gtk::TreeModelColumn<std::vector<SPObject *> > _colObj; // List of matching objects. Gtk::TreeModelColumn<Glib::ustring> _colProperties; // List of properties. Gtk::TreeModelColumn<bool> _colVisible; // Make visible or not. + Gtk::TreeModelColumn<gint> _colSelected; // Make selected. }; ModelColumns _mColumns; diff --git a/src/ui/dialog/styledialog.cpp b/src/ui/dialog/styledialog.cpp index fe9c6ed3b..3cdf5092b 100644 --- a/src/ui/dialog/styledialog.cpp +++ b/src/ui/dialog/styledialog.cpp @@ -130,17 +130,6 @@ class StyleDialog::NodeWatcher : public Inkscape::XML::NodeObserver { if (name == "id" || name == "class" || name == "style") { _styledialog->_nodeChanged(node); } - SPObject *obj = SP_ACTIVE_DOCUMENT->getObjectById(node.attribute("id")); - if (obj) { - for (auto iter : obj->style->properties()) { - if (iter->name == name) { - obj->style->readFromObject(obj); - obj->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); - _styledialog->_nodeChanged(node); - break; - } - } - } } } @@ -291,11 +280,11 @@ Inkscape::XML::Node *StyleDialog::_getStyleTextNode() styleNode = SP_ACTIVE_DOCUMENT->getReprDoc()->createElement("svg:style"); textNode = SP_ACTIVE_DOCUMENT->getReprDoc()->createTextNode(""); - styleNode->appendChild(textNode); - Inkscape::GC::release(textNode); - root->addChild(styleNode, nullptr); Inkscape::GC::release(styleNode); + + styleNode->appendChild(textNode); + Inkscape::GC::release(textNode); } if (_textNode != textNode) { @@ -307,6 +296,7 @@ Inkscape::XML::Node *StyleDialog::_getStyleTextNode() return textNode; } + Glib::RefPtr<Gtk::TreeModel> StyleDialog::_selectTree(Glib::ustring selector) { Gtk::Label *selectorlabel; @@ -915,7 +905,6 @@ void StyleDialog::_writeStyleElement(Glib::RefPtr<Gtk::TreeStore> store, Glib::u // We could test if styleContent is empty and then delete the style node here but there is no // harm in keeping it around ... SPDocument *document = SP_ACTIVE_DOCUMENT; - document->setStyleSheet(nullptr); std::string pos = std::to_string(selectorpos); std::string selectormatch = "("; for (selectorpos; selectorpos > 1; selectorpos--) { @@ -928,6 +917,7 @@ void StyleDialog::_writeStyleElement(Glib::RefPtr<Gtk::TreeStore> store, Glib::u std::string result; std::regex_replace(std::back_inserter(result), content.begin(), content.end(), e, "$1" + styleContent + "$3"); textNode->setContent(result.c_str()); + INKSCAPE.readStyleSheets(true); for (auto iter : document->getObjectsBySelector(selector)) { iter->style->readFromObject(iter); iter->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index a269ae094..37e522d5d 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -211,9 +211,9 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : // No results overlay_icon = sp_get_icon_image("searching", Gtk::ICON_SIZE_DIALOG); overlay_icon->set_pixel_size(110); - overlay_icon->get_style_context()->add_class("iconsymbolic"); overlay_icon->set_halign(Gtk::ALIGN_CENTER); overlay_icon->set_valign(Gtk::ALIGN_START); + overlay_icon->set_margin_top(45); overlay_title = new Gtk::Label(); diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index f228e3ecc..885cd5ed6 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -920,6 +920,7 @@ sp_desktop_widget_realize (GtkWidget *widget) window->get_style_context()->add_class("regular"); window->get_style_context()->remove_class("symbolic"); } + INKSCAPE.signal_change_theme.emit(); } #ifdef GDK_WINDOWING_QUARTZ |
