pycforge-sdk 0.6.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pycforge_sdk/__init__.py +6 -0
- pycforge_sdk/__main__.py +3 -0
- pycforge_sdk/catalogue.py +287 -0
- pycforge_sdk/cli.py +114 -0
- pycforge_sdk/connection.py +136 -0
- pycforge_sdk/discovery.py +227 -0
- pycforge_sdk/editing.py +84 -0
- pycforge_sdk/engine_launch.py +45 -0
- pycforge_sdk/engine_worker.py +53 -0
- pycforge_sdk/gui/__init__.py +1 -0
- pycforge_sdk/gui/__main__.py +3 -0
- pycforge_sdk/gui/app.py +36 -0
- pycforge_sdk/gui/dialogs.py +310 -0
- pycforge_sdk/gui/editor.py +412 -0
- pycforge_sdk/gui/help/index.html +9 -0
- pycforge_sdk/gui/identity.py +139 -0
- pycforge_sdk/gui/jobs.py +146 -0
- pycforge_sdk/gui/reference.py +39 -0
- pycforge_sdk/gui/resources/sdk-mark.png +0 -0
- pycforge_sdk/gui/scanner.py +134 -0
- pycforge_sdk/gui/startup.py +118 -0
- pycforge_sdk/gui/visual/__init__.py +1 -0
- pycforge_sdk/gui/visual/action_contract.py +550 -0
- pycforge_sdk/gui/visual/icons.py +117 -0
- pycforge_sdk/gui/visual/qt_actions.py +501 -0
- pycforge_sdk/gui/visual/qt_branding.py +47 -0
- pycforge_sdk/gui/visual/qt_dialog_chrome.py +337 -0
- pycforge_sdk/gui/visual/qt_file_icons.py +130 -0
- pycforge_sdk/gui/visual/qt_icons.py +80 -0
- pycforge_sdk/gui/visual/qt_screen_geometry.py +166 -0
- pycforge_sdk/gui/visual/qt_title_controls.py +333 -0
- pycforge_sdk/gui/visual/qt_window_chrome.py +314 -0
- pycforge_sdk/gui/visual/qt_window_resize.py +93 -0
- pycforge_sdk/gui/visual/qt_workspace_widgets.py +448 -0
- pycforge_sdk/gui/visual/resources/icons/128/add-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/brand-mark.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/bundle-search.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/cancel.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/check.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/chevron-right.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/close.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/collapse-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/command-palette.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/convert.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/copy.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/cut.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/decision-trace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/details.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/diagnostics.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/duplicate-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/exit.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/expand-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/export.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/find.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/go-to-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/go-to-output.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/go-to-source.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/help.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/history.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/indent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/link-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/mappings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/move-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/move-line-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/move-line-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/move-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/next.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/open.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/outdent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/outline.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/paste.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/previous.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/primary-module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/redo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/remove-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/replace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/save-as.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/save.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/select-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/settings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/show-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/split-view.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/summary.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/telemetry.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/toggle-comment.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/toggle-fold.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/tools.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/undo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/128/whitespace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/add-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/brand-mark.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/bundle-search.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/cancel.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/check.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/chevron-right.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/close.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/collapse-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/command-palette.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/convert.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/copy.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/cut.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/decision-trace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/details.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/diagnostics.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/duplicate-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/exit.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/expand-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/export.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/find.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/go-to-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/go-to-output.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/go-to-source.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/help.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/history.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/indent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/link-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/mappings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/move-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/move-line-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/move-line-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/move-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/next.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/open.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/outdent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/outline.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/paste.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/previous.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/primary-module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/redo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/remove-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/replace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/save-as.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/save.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/select-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/settings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/show-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/split-view.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/summary.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/telemetry.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/toggle-comment.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/toggle-fold.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/tools.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/undo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/16/whitespace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/add-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/brand-mark.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/bundle-search.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/cancel.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/check.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/chevron-right.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/close.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/collapse-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/command-palette.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/convert.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/copy.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/cut.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/decision-trace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/details.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/diagnostics.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/duplicate-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/exit.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/expand-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/export.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/find.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/go-to-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/go-to-output.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/go-to-source.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/help.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/history.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/indent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/link-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/mappings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/move-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/move-line-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/move-line-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/move-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/next.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/open.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/outdent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/outline.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/paste.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/previous.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/primary-module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/redo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/remove-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/replace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/save-as.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/save.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/select-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/settings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/show-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/split-view.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/summary.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/telemetry.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/toggle-comment.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/toggle-fold.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/tools.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/undo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/20/whitespace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/add-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/brand-mark.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/bundle-search.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/cancel.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/check.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/chevron-right.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/close.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/collapse-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/command-palette.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/convert.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/copy.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/cut.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/decision-trace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/details.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/diagnostics.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/duplicate-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/exit.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/expand-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/export.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/find.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/go-to-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/go-to-output.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/go-to-source.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/help.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/history.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/indent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/link-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/mappings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/move-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/move-line-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/move-line-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/move-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/next.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/open.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/outdent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/outline.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/paste.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/previous.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/primary-module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/redo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/remove-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/replace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/save-as.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/save.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/select-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/settings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/show-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/split-view.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/summary.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/telemetry.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/toggle-comment.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/toggle-fold.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/tools.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/undo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/24/whitespace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/add-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/brand-mark.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/bundle-search.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/cancel.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/check.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/chevron-right.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/close.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/collapse-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/command-palette.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/convert.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/copy.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/cut.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/decision-trace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/details.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/diagnostics.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/duplicate-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/exit.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/expand-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/export.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/find.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/go-to-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/go-to-output.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/go-to-source.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/help.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/history.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/indent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/link-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/mappings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/move-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/move-line-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/move-line-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/move-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/next.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/open.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/outdent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/outline.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/paste.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/previous.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/primary-module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/redo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/remove-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/replace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/save-as.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/save.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/select-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/settings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/show-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/split-view.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/summary.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/telemetry.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/toggle-comment.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/toggle-fold.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/tools.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/undo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/256/whitespace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/add-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/brand-mark.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/bundle-search.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/cancel.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/check.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/chevron-right.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/close.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/collapse-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/command-palette.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/convert.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/copy.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/cut.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/decision-trace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/details.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/diagnostics.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/duplicate-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/exit.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/expand-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/export.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/find.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/go-to-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/go-to-output.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/go-to-source.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/help.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/history.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/indent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/link-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/mappings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/move-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/move-line-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/move-line-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/move-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/next.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/open.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/outdent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/outline.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/paste.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/previous.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/primary-module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/redo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/remove-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/replace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/save-as.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/save.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/select-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/settings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/show-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/split-view.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/summary.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/telemetry.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/toggle-comment.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/toggle-fold.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/tools.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/undo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/32/whitespace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/add-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/brand-mark.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/bundle-search.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/cancel.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/check.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/chevron-right.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/close.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/collapse-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/command-palette.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/convert.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/copy.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/cut.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/decision-trace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/details.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/diagnostics.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/duplicate-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/exit.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/expand-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/export.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/find.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/go-to-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/go-to-output.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/go-to-source.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/help.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/history.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/indent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/link-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/mappings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/move-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/move-line-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/move-line-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/move-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/next.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/open.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/outdent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/outline.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/paste.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/previous.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/primary-module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/redo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/remove-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/replace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/save-as.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/save.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/select-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/settings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/show-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/split-view.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/summary.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/telemetry.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/toggle-comment.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/toggle-fold.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/tools.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/undo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/48/whitespace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/add-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/brand-mark.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/bundle-search.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/cancel.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/check.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/chevron-right.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/close.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/collapse-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/command-palette.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/convert.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/copy.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/cut.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/decision-trace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/details.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/diagnostics.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/duplicate-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/exit.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/expand-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/export.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/find.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/go-to-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/go-to-output.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/go-to-source.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/help.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/history.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/indent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/link-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/mappings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/move-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/move-line-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/move-line-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/move-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/next.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/open.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/outdent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/outline.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/paste.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/previous.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/primary-module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/redo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/remove-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/replace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/save-as.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/save.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/select-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/settings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/show-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/split-view.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/summary.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/telemetry.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/toggle-comment.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/toggle-fold.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/tools.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/undo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/64/whitespace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/add-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/brand-mark.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/bundle-search.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/cancel.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/check.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/chevron-right.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/close.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/collapse-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/command-palette.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/convert.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/copy.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/cut.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/decision-trace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/details.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/diagnostics.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/duplicate-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/exit.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/expand-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/export.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/find.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/go-to-line.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/go-to-output.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/go-to-source.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/help.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/history.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/indent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/link-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/mappings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/move-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/move-line-down.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/move-line-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/move-up.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/next.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/open.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/outdent.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/outline.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/paste.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/previous.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/primary-module.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/redo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/remove-document.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/replace.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/save-as.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/save.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/select-all.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/settings.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/show-c.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/split-view.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/summary.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/telemetry.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/toggle-comment.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/toggle-fold.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/tools.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/undo.png +0 -0
- pycforge_sdk/gui/visual/resources/icons/96/whitespace.png +0 -0
- pycforge_sdk/gui/visual/theme.py +204 -0
- pycforge_sdk/gui/visual/theme_steel_stylesheet.py +901 -0
- pycforge_sdk/gui/visual/theme_stylesheet.py +597 -0
- pycforge_sdk/gui/visual/theme_workspace_stylesheet.py +169 -0
- pycforge_sdk/gui/visual/visual_tokens.py +146 -0
- pycforge_sdk/gui/widgets.py +68 -0
- pycforge_sdk/gui/window.py +559 -0
- pycforge_sdk/native.py +42 -0
- pycforge_sdk/package_metadata.py +21 -0
- pycforge_sdk/process.py +58 -0
- pycforge_sdk/project.py +143 -0
- pycforge_sdk/readiness.py +106 -0
- pycforge_sdk/results.py +45 -0
- pycforge_sdk/service.py +454 -0
- pycforge_sdk/workbench.py +88 -0
- pycforge_sdk-0.6.3.dist-info/METADATA +221 -0
- pycforge_sdk-0.6.3.dist-info/RECORD +559 -0
- pycforge_sdk-0.6.3.dist-info/WHEEL +5 -0
- pycforge_sdk-0.6.3.dist-info/entry_points.txt +5 -0
- pycforge_sdk-0.6.3.dist-info/licenses/LICENSE +674 -0
- pycforge_sdk-0.6.3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
"""Reusable frameless chrome for every PyCForge dialog.
|
|
2
|
+
|
|
3
|
+
The titlebar exposes a deliberately empty toolbar host. Future dialog-specific
|
|
4
|
+
icon actions can be added there without replacing the drag surface or window
|
|
5
|
+
controls.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from PySide6.QtCore import QEvent, QObject, QPoint, QRect, QSize, Qt, QTimer
|
|
11
|
+
from PySide6.QtWidgets import (
|
|
12
|
+
QDialog,
|
|
13
|
+
QFrame,
|
|
14
|
+
QHBoxLayout,
|
|
15
|
+
QLabel,
|
|
16
|
+
QSizePolicy,
|
|
17
|
+
QVBoxLayout,
|
|
18
|
+
QWidget,
|
|
19
|
+
QAbstractButton,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
from .qt_icons import load_pycforge_icon
|
|
23
|
+
from .qt_branding import BrandElidedLabel
|
|
24
|
+
from .qt_window_chrome import _ResizeHandle, _WindowControlButton
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class DialogTitleBar(QFrame):
|
|
28
|
+
"""Accessible drag surface with an extensible icon-toolbar slot."""
|
|
29
|
+
|
|
30
|
+
def __init__(self, controller: "DialogWindowChrome") -> None:
|
|
31
|
+
super().__init__(controller.dialog)
|
|
32
|
+
self.controller = controller
|
|
33
|
+
self.setObjectName("DialogTitleBar")
|
|
34
|
+
self.setProperty("dialogChrome", True)
|
|
35
|
+
self.setMinimumHeight(38)
|
|
36
|
+
self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
|
37
|
+
self.setAccessibleName("Dialog title and controls")
|
|
38
|
+
self.setAccessibleDescription("Drag to move the dialog." + (
|
|
39
|
+
" Double-click to maximize or restore." if controller.maximizable else ""
|
|
40
|
+
))
|
|
41
|
+
|
|
42
|
+
layout = QHBoxLayout(self)
|
|
43
|
+
layout.setDirection(QHBoxLayout.Direction.LeftToRight)
|
|
44
|
+
layout.setContentsMargins(10, 3, 0, 3)
|
|
45
|
+
layout.setSpacing(7)
|
|
46
|
+
self.brand = QLabel()
|
|
47
|
+
self.brand.setObjectName("DialogTitleBrand")
|
|
48
|
+
self.brand.setPixmap(controller.dialog.windowIcon().pixmap(
|
|
49
|
+
QSize(22, 22), self.devicePixelRatioF()))
|
|
50
|
+
self.brand.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
|
|
51
|
+
layout.addWidget(self.brand)
|
|
52
|
+
|
|
53
|
+
self.title = BrandElidedLabel(controller.dialog.windowTitle(), mode=Qt.TextElideMode.ElideRight)
|
|
54
|
+
self.title.setObjectName("DialogTitleText")
|
|
55
|
+
self.title.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
|
|
56
|
+
self.title.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Preferred)
|
|
57
|
+
layout.addWidget(self.title, 1)
|
|
58
|
+
|
|
59
|
+
self.toolbar_host = QWidget()
|
|
60
|
+
self.toolbar_host.setObjectName("DialogTitleToolbar")
|
|
61
|
+
self.toolbar_host.setAccessibleName("Dialog titlebar tools")
|
|
62
|
+
self.toolbar_layout = QHBoxLayout(self.toolbar_host)
|
|
63
|
+
self.toolbar_layout.setContentsMargins(0, 0, 4, 0)
|
|
64
|
+
self.toolbar_layout.setSpacing(2)
|
|
65
|
+
layout.addWidget(self.toolbar_host)
|
|
66
|
+
|
|
67
|
+
self.maximize_button = None
|
|
68
|
+
if controller.maximizable:
|
|
69
|
+
self.maximize_button = _WindowControlButton(
|
|
70
|
+
"maximize",
|
|
71
|
+
"Maximize dialog",
|
|
72
|
+
"Maximize this PyCForge dialog",
|
|
73
|
+
controller.toggle_maximized,
|
|
74
|
+
self,
|
|
75
|
+
)
|
|
76
|
+
layout.addWidget(self.maximize_button)
|
|
77
|
+
self.close_button = _WindowControlButton(
|
|
78
|
+
"close",
|
|
79
|
+
"Close dialog",
|
|
80
|
+
"Close this PyCForge dialog",
|
|
81
|
+
controller.dialog.reject,
|
|
82
|
+
self,
|
|
83
|
+
)
|
|
84
|
+
layout.addWidget(self.close_button)
|
|
85
|
+
|
|
86
|
+
def add_toolbar_widget(self, widget: QWidget) -> None:
|
|
87
|
+
"""Place action buttons left and passive title information in its host."""
|
|
88
|
+
|
|
89
|
+
if isinstance(widget, QAbstractButton):
|
|
90
|
+
self.add_left_toolbar_widget(widget)
|
|
91
|
+
else:
|
|
92
|
+
self.toolbar_layout.addWidget(widget)
|
|
93
|
+
|
|
94
|
+
def add_left_toolbar_widget(self, widget: QWidget) -> None:
|
|
95
|
+
"""Place a dialog-specific action before the title and brand mark."""
|
|
96
|
+
self.layout().insertWidget(0, widget)
|
|
97
|
+
|
|
98
|
+
def sync_title(self) -> None:
|
|
99
|
+
title = self.controller.dialog.windowTitle()
|
|
100
|
+
self.title.set_full_text(title)
|
|
101
|
+
self.title.setToolTip(title)
|
|
102
|
+
self.title.setAccessibleDescription(title)
|
|
103
|
+
|
|
104
|
+
def sync_window_state(self) -> None:
|
|
105
|
+
if self.maximize_button is None:
|
|
106
|
+
return
|
|
107
|
+
if self.controller.dialog.isMaximized():
|
|
108
|
+
self.maximize_button.set_kind(
|
|
109
|
+
"restore", "Restore dialog", "Restore this PyCForge dialog"
|
|
110
|
+
)
|
|
111
|
+
else:
|
|
112
|
+
self.maximize_button.set_kind(
|
|
113
|
+
"maximize", "Maximize dialog", "Maximize this PyCForge dialog"
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
def mouseDoubleClickEvent(self, event) -> None: # noqa: N802 - Qt API
|
|
117
|
+
if event.button() == Qt.MouseButton.LeftButton and self.controller.maximizable:
|
|
118
|
+
self.controller.toggle_maximized()
|
|
119
|
+
event.accept()
|
|
120
|
+
return
|
|
121
|
+
super().mouseDoubleClickEvent(event)
|
|
122
|
+
|
|
123
|
+
def mousePressEvent(self, event) -> None: # noqa: N802 - Qt API
|
|
124
|
+
if event.button() == Qt.MouseButton.LeftButton:
|
|
125
|
+
self.controller.begin_move(self, event.globalPosition().toPoint())
|
|
126
|
+
event.accept()
|
|
127
|
+
return
|
|
128
|
+
super().mousePressEvent(event)
|
|
129
|
+
|
|
130
|
+
def mouseMoveEvent(self, event) -> None: # noqa: N802 - Qt API
|
|
131
|
+
if self.controller.continue_move(event.globalPosition().toPoint()):
|
|
132
|
+
event.accept()
|
|
133
|
+
return
|
|
134
|
+
super().mouseMoveEvent(event)
|
|
135
|
+
|
|
136
|
+
def mouseReleaseEvent(self, event) -> None: # noqa: N802 - Qt API
|
|
137
|
+
if self.controller.finish_move():
|
|
138
|
+
event.accept()
|
|
139
|
+
return
|
|
140
|
+
super().mouseReleaseEvent(event)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class DialogWindowChrome(QObject):
|
|
144
|
+
"""Own frameless dialog movement, resizing, and title synchronization."""
|
|
145
|
+
|
|
146
|
+
def __init__(self, dialog: QDialog, layout: QVBoxLayout, *, resizable: bool,
|
|
147
|
+
maximizable: bool = False) -> None:
|
|
148
|
+
super().__init__(dialog)
|
|
149
|
+
self.dialog = dialog
|
|
150
|
+
# ``_ResizeHandle`` is shared with the main-window chrome and expects
|
|
151
|
+
# its controller to expose the controlled top-level as ``window``.
|
|
152
|
+
self.window = dialog
|
|
153
|
+
self.resizable = bool(resizable)
|
|
154
|
+
if maximizable and not self.resizable:
|
|
155
|
+
raise ValueError("A maximizable dialog must also be resizable")
|
|
156
|
+
self.maximizable = bool(maximizable)
|
|
157
|
+
self._manual_move: tuple[QPoint, QPoint] | None = None
|
|
158
|
+
self._manual_surface: QWidget | None = None
|
|
159
|
+
self._initial_focus_target: QWidget | None = None
|
|
160
|
+
self._focus_timer = QTimer(self)
|
|
161
|
+
self._focus_timer.setSingleShot(True)
|
|
162
|
+
self._focus_timer.timeout.connect(self._restore_initial_focus)
|
|
163
|
+
dialog.setWindowFlag(Qt.WindowType.FramelessWindowHint, True)
|
|
164
|
+
dialog.setWindowFlag(Qt.WindowType.WindowMaximizeButtonHint, self.maximizable)
|
|
165
|
+
dialog.setWindowFlag(Qt.WindowType.WindowMinimizeButtonHint, False)
|
|
166
|
+
dialog.setWindowFlag(Qt.WindowType.NoDropShadowWindowHint, False)
|
|
167
|
+
dialog.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
|
|
168
|
+
if dialog.windowIcon().isNull():
|
|
169
|
+
dialog.setWindowIcon(load_pycforge_icon("brand-mark"))
|
|
170
|
+
try:
|
|
171
|
+
dialog.setSizeGripEnabled(False)
|
|
172
|
+
except AttributeError:
|
|
173
|
+
pass
|
|
174
|
+
self.title_bar = DialogTitleBar(self)
|
|
175
|
+
layout.insertWidget(0, self.title_bar)
|
|
176
|
+
dialog.installEventFilter(self)
|
|
177
|
+
self.resize_handles = self._build_resize_handles() if self.resizable else ()
|
|
178
|
+
self._sync_handles()
|
|
179
|
+
|
|
180
|
+
def eventFilter(self, watched, event) -> bool: # noqa: N802 - Qt API
|
|
181
|
+
if watched is not getattr(self, "dialog", None):
|
|
182
|
+
return False
|
|
183
|
+
event_type = event.type()
|
|
184
|
+
if event_type == QEvent.Type.WindowTitleChange:
|
|
185
|
+
self.title_bar.sync_title()
|
|
186
|
+
elif event_type in {QEvent.Type.Hide, QEvent.Type.WindowDeactivate}:
|
|
187
|
+
for button in (self.title_bar.close_button, self.title_bar.maximize_button):
|
|
188
|
+
if button is not None:
|
|
189
|
+
button.clear_pointer_state()
|
|
190
|
+
elif event_type in {
|
|
191
|
+
QEvent.Type.Resize,
|
|
192
|
+
QEvent.Type.Show,
|
|
193
|
+
QEvent.Type.WindowStateChange,
|
|
194
|
+
}:
|
|
195
|
+
self.title_bar.sync_window_state()
|
|
196
|
+
self._sync_handles()
|
|
197
|
+
if event_type == QEvent.Type.Show:
|
|
198
|
+
if not self.resizable:
|
|
199
|
+
# Constructors finish their screen-aware layout before Show.
|
|
200
|
+
# Compact prompts have neither resize handles nor an OS
|
|
201
|
+
# resize path; content-rich dialogs opt in independently.
|
|
202
|
+
self.dialog.setFixedSize(self.dialog.size())
|
|
203
|
+
# A frameless title control is inserted before the dialog body
|
|
204
|
+
# in the focus chain. Windows can therefore restore focus to
|
|
205
|
+
# that control and leave its hover-equivalent underline lit.
|
|
206
|
+
# Defer until Qt completes activation, then restore the
|
|
207
|
+
# dialog-owned content target only when chrome owns focus.
|
|
208
|
+
self._focus_timer.start(0)
|
|
209
|
+
return False
|
|
210
|
+
|
|
211
|
+
def set_initial_focus_target(self, target: QWidget) -> None:
|
|
212
|
+
"""Keep first/reopened focus in dialog content, not titlebar chrome."""
|
|
213
|
+
|
|
214
|
+
if not isinstance(target, QWidget):
|
|
215
|
+
raise TypeError("initial dialog focus target must be a QWidget")
|
|
216
|
+
if target.window() is not self.dialog:
|
|
217
|
+
raise ValueError("initial dialog focus target must belong to the dialog")
|
|
218
|
+
if target.focusPolicy() == Qt.FocusPolicy.NoFocus:
|
|
219
|
+
raise ValueError("initial dialog focus target must accept focus")
|
|
220
|
+
self._initial_focus_target = target
|
|
221
|
+
target.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
|
|
222
|
+
|
|
223
|
+
def _restore_initial_focus(self) -> None:
|
|
224
|
+
target = self._initial_focus_target
|
|
225
|
+
if target is None or not self.dialog.isVisible():
|
|
226
|
+
return
|
|
227
|
+
focused = self.dialog.focusWidget()
|
|
228
|
+
controls = {
|
|
229
|
+
self.title_bar.maximize_button,
|
|
230
|
+
self.title_bar.close_button,
|
|
231
|
+
}
|
|
232
|
+
if focused is None or focused in controls:
|
|
233
|
+
target.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
|
|
234
|
+
|
|
235
|
+
def toggle_maximized(self) -> None:
|
|
236
|
+
if not self.maximizable:
|
|
237
|
+
return
|
|
238
|
+
self.dialog.showNormal() if self.dialog.isMaximized() else self.dialog.showMaximized()
|
|
239
|
+
self.title_bar.sync_window_state()
|
|
240
|
+
self._sync_handles()
|
|
241
|
+
|
|
242
|
+
def begin_move(self, surface: QWidget, global_position: QPoint) -> None:
|
|
243
|
+
handle = self.dialog.windowHandle()
|
|
244
|
+
if handle is not None:
|
|
245
|
+
try:
|
|
246
|
+
if handle.startSystemMove():
|
|
247
|
+
return
|
|
248
|
+
except (AttributeError, RuntimeError):
|
|
249
|
+
pass
|
|
250
|
+
self._manual_move = (global_position, self.dialog.frameGeometry().topLeft())
|
|
251
|
+
self._manual_surface = surface
|
|
252
|
+
surface.grabMouse()
|
|
253
|
+
|
|
254
|
+
def continue_move(self, global_position: QPoint) -> bool:
|
|
255
|
+
if self._manual_move is None:
|
|
256
|
+
return False
|
|
257
|
+
start, origin = self._manual_move
|
|
258
|
+
self.dialog.move(origin + global_position - start)
|
|
259
|
+
return True
|
|
260
|
+
|
|
261
|
+
def finish_move(self) -> bool:
|
|
262
|
+
if self._manual_move is None:
|
|
263
|
+
return False
|
|
264
|
+
surface = self._manual_surface
|
|
265
|
+
self._manual_move = None
|
|
266
|
+
self._manual_surface = None
|
|
267
|
+
if surface is not None:
|
|
268
|
+
surface.releaseMouse()
|
|
269
|
+
return True
|
|
270
|
+
|
|
271
|
+
def start_system_resize(self, edges: Qt.Edge) -> bool:
|
|
272
|
+
if not self.resizable or self.dialog.isMaximized():
|
|
273
|
+
return False
|
|
274
|
+
handle = self.dialog.windowHandle()
|
|
275
|
+
if handle is None:
|
|
276
|
+
return False
|
|
277
|
+
try:
|
|
278
|
+
return bool(handle.startSystemResize(edges))
|
|
279
|
+
except (AttributeError, RuntimeError):
|
|
280
|
+
return False
|
|
281
|
+
|
|
282
|
+
def _build_resize_handles(self) -> tuple[_ResizeHandle, ...]:
|
|
283
|
+
left, right = Qt.Edge.LeftEdge, Qt.Edge.RightEdge
|
|
284
|
+
top, bottom = Qt.Edge.TopEdge, Qt.Edge.BottomEdge
|
|
285
|
+
specs = (
|
|
286
|
+
("left edge", left, Qt.CursorShape.SizeHorCursor),
|
|
287
|
+
("right edge", right, Qt.CursorShape.SizeHorCursor),
|
|
288
|
+
("top edge", top, Qt.CursorShape.SizeVerCursor),
|
|
289
|
+
("bottom edge", bottom, Qt.CursorShape.SizeVerCursor),
|
|
290
|
+
("top-left corner", top | left, Qt.CursorShape.SizeFDiagCursor),
|
|
291
|
+
("top-right corner", top | right, Qt.CursorShape.SizeBDiagCursor),
|
|
292
|
+
("bottom-left corner", bottom | left, Qt.CursorShape.SizeBDiagCursor),
|
|
293
|
+
("bottom-right corner", bottom | right, Qt.CursorShape.SizeFDiagCursor),
|
|
294
|
+
)
|
|
295
|
+
return tuple(_ResizeHandle(self, *spec) for spec in specs)
|
|
296
|
+
|
|
297
|
+
def _sync_handles(self) -> None:
|
|
298
|
+
if not self.resize_handles:
|
|
299
|
+
return
|
|
300
|
+
if self.dialog.isMaximized() or self.dialog.isMinimized():
|
|
301
|
+
for handle in self.resize_handles:
|
|
302
|
+
handle.hide()
|
|
303
|
+
return
|
|
304
|
+
width, height, border, corner = self.dialog.width(), self.dialog.height(), 5, 10
|
|
305
|
+
geometries = (
|
|
306
|
+
QRect(0, corner, border, max(0, height - 2 * corner)),
|
|
307
|
+
QRect(width - border, corner, border, max(0, height - 2 * corner)),
|
|
308
|
+
QRect(corner, 0, max(0, width - 2 * corner), border),
|
|
309
|
+
QRect(corner, height - border, max(0, width - 2 * corner), border),
|
|
310
|
+
QRect(0, 0, corner, corner),
|
|
311
|
+
QRect(width - corner, 0, corner, corner),
|
|
312
|
+
QRect(0, height - corner, corner, corner),
|
|
313
|
+
QRect(width - corner, height - corner, corner, corner),
|
|
314
|
+
)
|
|
315
|
+
for handle, geometry in zip(self.resize_handles, geometries, strict=True):
|
|
316
|
+
handle.setGeometry(geometry)
|
|
317
|
+
handle.show()
|
|
318
|
+
handle.raise_()
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
def install_dialog_chrome(
|
|
322
|
+
dialog: QDialog,
|
|
323
|
+
layout: QVBoxLayout,
|
|
324
|
+
*,
|
|
325
|
+
resizable: bool = True,
|
|
326
|
+
maximizable: bool = False,
|
|
327
|
+
) -> DialogWindowChrome:
|
|
328
|
+
"""Install PyCForge chrome and retain it for the dialog lifetime."""
|
|
329
|
+
|
|
330
|
+
if not isinstance(dialog, QDialog) or not isinstance(layout, QVBoxLayout):
|
|
331
|
+
raise TypeError("dialog chrome requires a QDialog and QVBoxLayout")
|
|
332
|
+
chrome = DialogWindowChrome(dialog, layout, resizable=resizable, maximizable=maximizable)
|
|
333
|
+
dialog._dialog_window_chrome = chrome
|
|
334
|
+
return chrome
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
__all__ = ["DialogTitleBar", "DialogWindowChrome", "install_dialog_chrome"]
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"""Recognizable file badges drawn in the workspace's steel-blue palette."""
|
|
2
|
+
from functools import lru_cache
|
|
3
|
+
|
|
4
|
+
from PySide6.QtCore import QFileInfo, QPointF, QRectF, Qt
|
|
5
|
+
from PySide6.QtGui import QAbstractFileIconProvider, QColor, QIcon, QPainter, QPainterPath, QPen, QPixmap
|
|
6
|
+
|
|
7
|
+
from .qt_icons import load_pycforge_icon
|
|
8
|
+
from .visual_tokens import PYCFORGE_COLORS as COLORS
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@lru_cache(maxsize=4)
|
|
12
|
+
def file_type_icon(suffix: str) -> QIcon:
|
|
13
|
+
"""White folded page with a blue grid, eye or C, at native icon sizes."""
|
|
14
|
+
if suffix not in {'py', 'pcfproj', 'pcfplugin', 'c'}:
|
|
15
|
+
raise ValueError('unsupported file badge')
|
|
16
|
+
icon = QIcon()
|
|
17
|
+
for size in (16, 20, 24, 32, 48, 64, 96, 128):
|
|
18
|
+
pixmap = QPixmap(size, size)
|
|
19
|
+
pixmap.fill(Qt.GlobalColor.transparent)
|
|
20
|
+
painter = QPainter(pixmap)
|
|
21
|
+
painter.setRenderHint(QPainter.RenderHint.Antialiasing)
|
|
22
|
+
painter.scale(size / 24, size / 24)
|
|
23
|
+
page = QPainterPath()
|
|
24
|
+
page.moveTo(4, 1.5)
|
|
25
|
+
page.lineTo(14, 1.5)
|
|
26
|
+
page.lineTo(20, 7.5)
|
|
27
|
+
page.lineTo(20, 22.5)
|
|
28
|
+
page.lineTo(4, 22.5)
|
|
29
|
+
page.closeSubpath()
|
|
30
|
+
painter.setPen(QPen(QColor(COLORS.text_soft), 0.7))
|
|
31
|
+
painter.setBrush(QColor('#FFFFFF'))
|
|
32
|
+
painter.drawPath(page)
|
|
33
|
+
fold = QPainterPath()
|
|
34
|
+
fold.moveTo(14, 1.5)
|
|
35
|
+
fold.lineTo(14, 7.5)
|
|
36
|
+
fold.lineTo(20, 7.5)
|
|
37
|
+
painter.setBrush(QColor(COLORS.text))
|
|
38
|
+
painter.drawPath(fold)
|
|
39
|
+
|
|
40
|
+
# The deeper steel blue remains distinct against the white page even
|
|
41
|
+
# at the smallest tree-row size. It is an existing theme token.
|
|
42
|
+
blue = QColor(COLORS.selection_active)
|
|
43
|
+
painter.setPen(QPen(blue, 1.8, Qt.PenStyle.SolidLine,
|
|
44
|
+
Qt.PenCapStyle.RoundCap, Qt.PenJoinStyle.RoundJoin))
|
|
45
|
+
painter.setBrush(Qt.BrushStyle.NoBrush)
|
|
46
|
+
if suffix == 'py':
|
|
47
|
+
painter.setPen(Qt.PenStyle.NoPen)
|
|
48
|
+
painter.setBrush(blue)
|
|
49
|
+
for x in (7.2, 12.7):
|
|
50
|
+
for y in (10.2, 15.7):
|
|
51
|
+
painter.drawRoundedRect(QRectF(x, y, 4.1, 4.1), 0.65, 0.65)
|
|
52
|
+
elif suffix == 'pcfplugin':
|
|
53
|
+
painter.drawLine(QPointF(8, 12), QPointF(16, 18))
|
|
54
|
+
painter.drawLine(QPointF(8, 18), QPointF(16, 12))
|
|
55
|
+
painter.setBrush(blue)
|
|
56
|
+
for x, y in ((8, 12), (16, 12), (8, 18), (16, 18)):
|
|
57
|
+
painter.drawEllipse(QPointF(x, y), 1.7, 1.7)
|
|
58
|
+
elif suffix == 'pcfproj':
|
|
59
|
+
eye = QPainterPath()
|
|
60
|
+
eye.moveTo(6.2, 15)
|
|
61
|
+
eye.cubicTo(9.3, 10.2, 14.7, 10.2, 17.8, 15)
|
|
62
|
+
eye.cubicTo(14.7, 19.8, 9.3, 19.8, 6.2, 15)
|
|
63
|
+
painter.drawPath(eye)
|
|
64
|
+
painter.setPen(Qt.PenStyle.NoPen)
|
|
65
|
+
painter.setBrush(blue)
|
|
66
|
+
painter.drawEllipse(QPointF(12, 15), 1.8, 1.8)
|
|
67
|
+
else:
|
|
68
|
+
letter = QPainterPath()
|
|
69
|
+
letter.moveTo(16, 11.2)
|
|
70
|
+
letter.cubicTo(8.2, 7.4, 6.2, 20.7, 16, 18.4)
|
|
71
|
+
painter.setPen(QPen(blue, 2.4, Qt.PenStyle.SolidLine,
|
|
72
|
+
Qt.PenCapStyle.RoundCap, Qt.PenJoinStyle.RoundJoin))
|
|
73
|
+
painter.drawPath(letter)
|
|
74
|
+
painter.end()
|
|
75
|
+
for mode in (QIcon.Mode.Normal, QIcon.Mode.Active, QIcon.Mode.Selected):
|
|
76
|
+
icon.addPixmap(pixmap, mode)
|
|
77
|
+
return icon
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class PyCForgeFileIconProvider(QAbstractFileIconProvider):
|
|
81
|
+
"""Use theme artwork and distinct Python, project and C file badges."""
|
|
82
|
+
|
|
83
|
+
_CONTAINER_TYPES = frozenset(
|
|
84
|
+
{
|
|
85
|
+
QAbstractFileIconProvider.IconType.Computer,
|
|
86
|
+
QAbstractFileIconProvider.IconType.Desktop,
|
|
87
|
+
QAbstractFileIconProvider.IconType.Network,
|
|
88
|
+
QAbstractFileIconProvider.IconType.Drive,
|
|
89
|
+
QAbstractFileIconProvider.IconType.Folder,
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
def __init__(self) -> None:
|
|
94
|
+
super().__init__()
|
|
95
|
+
self._folder_icon = load_pycforge_icon("open")
|
|
96
|
+
self._source_icon = load_pycforge_icon("module")
|
|
97
|
+
self._file_icons = {suffix: file_type_icon(suffix)
|
|
98
|
+
for suffix in ('py', 'pcfproj', 'pcfplugin', 'c')}
|
|
99
|
+
|
|
100
|
+
def icon(
|
|
101
|
+
self,
|
|
102
|
+
value: QFileInfo | QAbstractFileIconProvider.IconType,
|
|
103
|
+
) -> QIcon:
|
|
104
|
+
if isinstance(value, QFileInfo):
|
|
105
|
+
if value.isDir():
|
|
106
|
+
return self._folder_icon
|
|
107
|
+
if value.fileName() == 'project.json':
|
|
108
|
+
return self._file_icons['pcfproj']
|
|
109
|
+
return self._file_icons.get(value.suffix().casefold(), self._source_icon)
|
|
110
|
+
if value in self._CONTAINER_TYPES:
|
|
111
|
+
return self._folder_icon
|
|
112
|
+
return self._source_icon
|
|
113
|
+
|
|
114
|
+
def type(self, info: QFileInfo) -> str:
|
|
115
|
+
if info.isDir():
|
|
116
|
+
return "Folder"
|
|
117
|
+
suffix = info.suffix().casefold()
|
|
118
|
+
if suffix == "py":
|
|
119
|
+
return "Python source"
|
|
120
|
+
if suffix == "c":
|
|
121
|
+
return "C source"
|
|
122
|
+
if suffix == "pcfproj":
|
|
123
|
+
return "PyCForge project"
|
|
124
|
+
if suffix == "pcfplugin":
|
|
125
|
+
return "PyCForge conversion import"
|
|
126
|
+
if info.fileName() == "project.json":
|
|
127
|
+
return "PyCForge SDK project"
|
|
128
|
+
return "Source file"
|
|
129
|
+
|
|
130
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"""High-DPI Qt helpers for packaged multi-resolution PNG icons."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from numbers import Real
|
|
6
|
+
|
|
7
|
+
from PySide6.QtCore import QSize
|
|
8
|
+
from PySide6.QtGui import QColor, QIcon, QPainter, QPixmap
|
|
9
|
+
|
|
10
|
+
from .icons import pycforge_icon_paths
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def load_pycforge_icon(name: str) -> QIcon:
|
|
14
|
+
"""Build a QIcon containing every packaged resolution for *name*."""
|
|
15
|
+
|
|
16
|
+
icon = QIcon()
|
|
17
|
+
for size, path in pycforge_icon_paths(name):
|
|
18
|
+
icon.addFile(
|
|
19
|
+
str(path),
|
|
20
|
+
QSize(size, size),
|
|
21
|
+
QIcon.Mode.Normal,
|
|
22
|
+
QIcon.State.Off,
|
|
23
|
+
)
|
|
24
|
+
if icon.isNull():
|
|
25
|
+
raise RuntimeError(f"raster icon could not be loaded: {name}")
|
|
26
|
+
return icon
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def render_icon_pixmap(
|
|
30
|
+
name: str,
|
|
31
|
+
logical_size: int,
|
|
32
|
+
device_pixel_ratio: Real = 1.0,
|
|
33
|
+
) -> QPixmap:
|
|
34
|
+
"""Render one logical icon at a DPR-aware physical display size."""
|
|
35
|
+
|
|
36
|
+
if (
|
|
37
|
+
isinstance(logical_size, bool)
|
|
38
|
+
or not isinstance(logical_size, int)
|
|
39
|
+
or not 1 <= logical_size <= 512
|
|
40
|
+
):
|
|
41
|
+
raise ValueError("logical icon size must be from 1 to 512 pixels")
|
|
42
|
+
if (
|
|
43
|
+
isinstance(device_pixel_ratio, bool)
|
|
44
|
+
or not isinstance(device_pixel_ratio, Real)
|
|
45
|
+
or not 1.0 <= float(device_pixel_ratio) <= 8.0
|
|
46
|
+
):
|
|
47
|
+
raise ValueError("device pixel ratio must be from 1.0 to 8.0")
|
|
48
|
+
pixmap = load_pycforge_icon(name).pixmap(
|
|
49
|
+
QSize(logical_size, logical_size),
|
|
50
|
+
float(device_pixel_ratio),
|
|
51
|
+
)
|
|
52
|
+
if pixmap.isNull():
|
|
53
|
+
raise RuntimeError(f"raster icon could not be rendered: {name}")
|
|
54
|
+
return pixmap
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def render_tinted_icon(
|
|
58
|
+
name: str,
|
|
59
|
+
logical_size: int,
|
|
60
|
+
color: str,
|
|
61
|
+
device_pixel_ratio: Real = 1.0,
|
|
62
|
+
) -> QIcon:
|
|
63
|
+
"""Render a packaged raster glyph as one solid semantic color."""
|
|
64
|
+
|
|
65
|
+
tint = QColor(color)
|
|
66
|
+
if not tint.isValid():
|
|
67
|
+
raise ValueError("icon tint must be a valid Qt color")
|
|
68
|
+
pixmap = render_icon_pixmap(name, logical_size, device_pixel_ratio)
|
|
69
|
+
painter = QPainter(pixmap)
|
|
70
|
+
try:
|
|
71
|
+
painter.setCompositionMode(
|
|
72
|
+
QPainter.CompositionMode.CompositionMode_SourceIn
|
|
73
|
+
)
|
|
74
|
+
painter.fillRect(pixmap.rect(), tint)
|
|
75
|
+
finally:
|
|
76
|
+
painter.end()
|
|
77
|
+
return QIcon(pixmap)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
__all__ = ["load_pycforge_icon", "render_icon_pixmap", "render_tinted_icon"]
|