zooui.windows.dialogwindows.stringinputdialog module

String input dialog with color selection.

class zooui.windows.dialogwindows.stringinputdialog.OpenNewStringInputDialog(initial_text='')[source]

Bases: object

Constructor :

OpenNewStringInputDialog()

Parameters :

None

OpenNewStringInputDialog() –> None

Gather the string through a dialog and let select the color. Also gives a selection column of the last 20 used colors.

Constructor :

OpenNewStringInputDialog(initial_text)

Parameters :
initial_textstr

Optional text to pre-fill the text edit widget (e.g., OCR output).

OpenNewStringInputDialog(initial_text=””) –> None

Create a new OpenNewStringInputDialog for gathering string input with color selection.

If initial_text is provided, the text edit will be pre-filled with that content. This is used by the OCR screenshot feature to seed the dialog with tesseract output.

Initializes the dialog with empty string color, loads previously used colors from the color store file, or creates default colors (red, green, blue) if no color history exists.

__init__(initial_text='')[source]
Constructor :

OpenNewStringInputDialog(initial_text)

Parameters :
initial_textstr

Optional text to pre-fill the text edit widget (e.g., OCR output).

OpenNewStringInputDialog(initial_text=””) –> None

Create a new OpenNewStringInputDialog for gathering string input with color selection.

If initial_text is provided, the text edit will be pre-filled with that content. This is used by the OCR screenshot feature to seed the dialog with tesseract output.

Initializes the dialog with empty string color, loads previously used colors from the color store file, or creates default colors (red, green, blue) if no color history exists.

_color_square(color_code)[source]
Method :

OpenNewStringInputDialog._color_square(color_code)

Parameters :

color_code : str

OpenNewStringInputDialog._color_square(color_code) –> QWidget

Creates a colored square widget.

_color_button_click(color)[source]
Method :

OpenNewStringInputDialog._color_button_click(color)

Parameters :

color : str

OpenNewStringInputDialog._color_button_click(color) –> None

Handles color button click event.

_color_button(color_code)[source]
Method :

OpenNewStringInputDialog._color_button(color_code)

Parameters :

color_code : str

OpenNewStringInputDialog._color_button(color_code) –> QWidget

Creates a color selection button.

_pick_color_from_dialog()[source]

Open a QColorDialog to pick a custom color.

_main_dialog()[source]
Method :

OpenNewStringInputDialog._main_dialog()

Parameters :

None

OpenNewStringInputDialog._main_dialog() –> QDialog

Creates and configures the main dialog window.

_run_dialog()[source]
Method :

OpenNewStringInputDialog._run_dialog()

Parameters :

None

OpenNewStringInputDialog._run_dialog() –> Tuple[bool, str]

Runs the dialog and returns the result. Returns (ok, uri) where ok is True if accepted, uri is the formatted string.

See Also

  • zooui/objects/mediaobjects/stringmediaobject - StringMediaObject class

  • zooui/windows/dialogwindows/modifystringdialog - String modification dialog

  • zooui/windows/dialogwindows/dialogwindows - Dialog window base classes