zooui.windows.dialogwindows.svgpickerinputdialog module¶
SVG picker input dialog with color selection.
- class zooui.windows.dialogwindows.svgpickerinputdialog.OpenSVGPickerInputDialog[source]¶
Bases:
object- Constructor :
OpenSVGPickerInputDialog()
- Parameters :
None
OpenSVGPickerInputDialog() –> None
Gather SVG file selection through a dialog with color selection. Also gives a selection column of the last 20 used colors.
- Constructor :
OpenSVGPickerInputDialog()
- Parameters :
None
OpenSVGPickerInputDialog() –> None
Create a new OpenSVGPickerInputDialog for gathering SVG file selection with color selection.
Initializes the dialog with empty color, loads previously used colors from the color store file, or creates default colors (red, green, blue) if no color history exists. Also scans the SVG directory for available SVG files.
- DEFAULT_SVG_THICKNESS = '50'¶
- __init__()[source]¶
- Constructor :
OpenSVGPickerInputDialog()
- Parameters :
None
OpenSVGPickerInputDialog() –> None
Create a new OpenSVGPickerInputDialog for gathering SVG file selection with color selection.
Initializes the dialog with empty color, loads previously used colors from the color store file, or creates default colors (red, green, blue) if no color history exists. Also scans the SVG directory for available SVG files.
- shape_color¶
- selected_svg¶
- color_codes¶
- custom_color_input¶
- thickness_input¶
- _svg_buttons¶
- _svg_colors¶
- _svg_thicknesses¶
- _svg_contents¶
- _svg_renderers¶
- _modified_svg_files¶
- SVG_FILES = []¶
- SVG_NAMES = {}¶
- _modify_svg_file(svg_path, color=None, thickness=None)[source]¶
Modify an SVG file with new color and/or thickness using XML parsing.
- Parameters:
svg_path – Path to the original SVG file
color – Hex color code (without #) to apply to stroke and fill
thickness – Stroke width value
- Returns:
svg_{8_char_hex})
- Return type:
Cache hash of modified SVG (format
- _color_square(color_code)[source]¶
- Method :
OpenSVGPickerInputDialog._color_square(color_code)
- Parameters :
color_code : str
OpenSVGPickerInputDialog._color_square(color_code) –> QWidget
Creates a colored square widget.
- _color_button_click(color)[source]¶
- Method :
OpenSVGPickerInputDialog._color_button_click(color)
- Parameters :
color : str
OpenSVGPickerInputDialog._color_button_click(color) –> None
Handles color button click event.
- _color_button(color_code)[source]¶
- Method :
OpenSVGPickerInputDialog._color_button(color_code)
- Parameters :
color_code : str
OpenSVGPickerInputDialog._color_button(color_code) –> QWidget
Creates a color selection button.
- _create_modified_svg_renderer(svg_path, force_update=False)[source]¶
Create a modified SVG renderer with color and thickness applied. Uses XML parsing instead of regex for more reliable modification.
- Parameters:
svg_path – Path to the SVG file
force_update – If True, always create new renderer even if cached
- _apply_changes_to_svg()[source]¶
Apply both color and thickness changes to the selected SVG preview.
See Also¶
zooui/objects/mediaobjects/svgmediaobject - SVGMediaObject class for rendering SVG objects
zooui/windows/dialogwindows/modifysvginputdialog - Dialog for modifying existing SVG objects
../../usageinstructions/svgfeatures - User guide for SVG features