zooui.windows.dialogwindows.modifysvginputdialog module

SVG modification dialog for changing color and thickness of SVG objects.

class zooui.windows.dialogwindows.modifysvginputdialog.ModifySVGInputDialog(svg_media_object)[source]

Bases: object

Constructor :

ModifySVGInputDialog(svg_media_object)

Parameters :

svg_media_object : SVGMediaObject

ModifySVGInputDialog(svg_media_object) –> None

Dialog for modifying color and thickness of existing SVG objects. Designed for simple shapes (arrows, triangles, circles, squares) that were added via svgpickerinputdialog.py.

Constructor :

ModifySVGInputDialog(svg_media_object)

Parameters :

svg_media_object : SVGMediaObject

ModifySVGInputDialog(svg_media_object) –> None

Initialize dialog for modifying an existing SVG object.

DEFAULT_COLOR = '000000'
DEFAULT_THICKNESS = '10'
__init__(svg_media_object)[source]
Constructor :

ModifySVGInputDialog(svg_media_object)

Parameters :

svg_media_object : SVGMediaObject

ModifySVGInputDialog(svg_media_object) –> None

Initialize dialog for modifying an existing SVG object.

modified_color
modified_thickness
color_codes
custom_color_input
thickness_input
preview_widget
_load_color_history()[source]

Load color history from color store file.

_validate_svg_source()[source]

Check if SVG is from safe source (SVG cache directory). Show warning dialog for other sources.

Returns:

True if safe or user confirms, False if user cancels

_show_source_warning_dialog()[source]

Warning: This SVG was not added via SVG Picker dialog. The modify dialog is designed for simple shapes from zooui/data/SVG/.

Default values will be used: color=black, stroke-width=10 Continue anyway?

_color_name_to_hex(color_name)[source]

Convert color name to hex code.

Parameters:

color_name – Color name (e.g., ‘black’, ‘red’) or hex code

Returns:

Hex color without # (e.g., ‘000000’)

_extract_current_color()[source]

Extract color from SVG content. For simple shapes, look for stroke or fill attributes. Returns hex color without # (e.g., ‘000000’ for black).

_extract_current_thickness()[source]

Extract stroke-width from SVG content. Returns string value (e.g., ‘8’).

_color_square(color_code)[source]

Create a colored square widget.

_color_button_click(color)[source]

Handle color button click event.

_color_button(color_code)[source]

Create a color selection button.

_svg_preview_widget()[source]

Create widget showing the SVG preview (300x300).

_get_current_svg_content()[source]

Get current SVG content with modifications applied.

_update_preview()[source]

Update the preview widget.

_apply_preview()[source]

Apply thickness changes to preview.

_reset_to_original()[source]

Reset to original values.

_pick_color_from_dialog()[source]

Open a QColorDialog to pick a custom color.

_modify_svg_file(color, thickness)[source]

Create modified SVG in cache.

Returns:

Cache hash of modified SVG

_main_dialog()[source]

Create and configure the main dialog window.

_run_dialog()[source]

Run the dialog and return result.

Returns:

  • ok: True if accepted, False if cancelled

  • cache_hash: New cache hash if modified, None if no changes

Return type:

(ok, cache_hash) where

See Also

  • zooui/objects/mediaobjects/svgmediaobject - SVGMediaObject class for rendering SVG objects

  • zooui/windows/dialogwindows/svgpickerinputdialog - Dialog for selecting new SVG objects

  • ../../usageinstructions/svgfeatures - User guide for SVG features