Closed sturgman closed 4 years ago
The code responsible for savings styles / objects is located in the styles.py
file.
First, the code copies the object by pressing Ctrl+C:
Then the get(TARGET)
retrieves the content from the clipboard in the format specified by TARGET
, which is a constant equal to 'image/x-inkscape-svg'
. So this retrieves the svg code for the object.
Then the code writes this svg to a file located in the configuration directory (~/.config/inkscape-shortcut-manager/objects/name.svg
or /styles/name.svg
)
When you apply a style, this file gets copied to your clipboard and the program presses Ctrl+Shift+V
, which is 'paste style'.
Hopes this clears things up a bit!
That is awesome. Thank you so much for the explanation!
On Thu, Jun 25, 2020, 8:20 AM Gilles Castel notifications@github.com wrote:
The code responsible for savings styles / objects is located in the styles.py file.
First, the code copies the object by pressing Ctrl+C:
Then the get(TARGET) retrieves the content from the clipboard in the format specified by TARGET, which is a constant equal to 'image/x-inkscape-svg'. So this retrieves the svg code for the object.
Then the code writes this svg to a file located in the configuration directory (~/.config/inkscape-shortcut-manager/objects/name.svg or /styles/name.svg)
When you apply a style, this file gets copied to your clipboard and the program presses Ctrl+Shift+V, which is 'paste style'.
Hopes this clears things up a bit!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gillescastel/inkscape-shortcut-manager/issues/11#issuecomment-649506637, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7ODQFUECG4IKMG676L3Z3RYM6IBANCNFSM4OC6E24Q .
Could you explain what happens when a style is saved? Inkscape does not have a "style library" functionality as far as I know. Are you defining the styles in some kind of svg file and importing them somehow? Thank you!