How suratlayek/align-view works
1. Project type
- This is a Python desktop application built around Qt/PyQt5.
- Its purpose is to display a semi-transparent image overlay on top of the user’s screen for tracing, alignment, and comparison work.
2. Entry point and application bootstrap
- align_view.py is the main runtime entry point.
- It is the place where the Qt application is started, the main window/overlay is created, and the UI is wired to behavior.
- For an architecture diagram, treat this as the top-level orchestrator.
3. Main UI boundary
- src/align_view_ui.py is a generated Python module produced from the Qt Designer file.
- src/resources/align_view_ui.ui is the source-of-truth UI layout.
- The UI boundary is separated from runtime logic: layout comes from the generated UI file, while interaction logic lives in the main Python code.
4. Overlay subsystem
- The core functional subsystem is the overlay window itself.
- It supports:
- image display
- opacity control
- scaling/zoom
- rotation
- moving/dragging
- lock/unlock behavior
- This is the primary “canvas” component and the main thing the user interacts with.
5. Input and interaction flow
- The overlay responds to mouse and keyboard input directly:
- drag to move
- wheel to zoom
- modified wheel gestures for rotation and opacity
- arrow-key nudging for pixel-level positioning
- Right-click exposes help/shortcut behavior.
- These interactions are likely handled in the app logic layer and update the overlay state in real time.
6. Image loading boundary
- The app accepts images as the content being overlaid.
- README indicates drag-and-drop image loading is supported, so file input is an important boundary between the OS file system and the overlay logic.
- The app is therefore not a generic editor; it is a single-image overlay tool with live transformation controls.
7. Styling and visual assets
- src/resources/adaptic.qss is the Qt stylesheet used for the app’s visual theme.
- src/resources_rc.py is the compiled Qt resource module that packages non-code assets into the app.
- src/resources/resources.qrc defines those packaged assets.
- This makes the UI presentation layer mostly self-contained and Qt-native.
8. Generated vs. hand-authored code boundary
- A key architectural boundary is between:
- hand-authored runtime code: align_view.py
- generated UI/resource code: src/align_view_ui.py, src/resources_rc.py
- That separation matters because UI changes are done in Qt Designer / resource files and then recompiled into Python.
9. Packaging and dependency layer
- requirements.txt defines the Python dependencies, which are centered on Qt and related runtime packages.
- The README also references a Windows installer release, so the project is designed to be distributable as a desktop app, not just run from source.
10. Ancillary files
- index.html is present alongside the Python app; it is likely a static asset or distribution-related page rather than part of the core runtime path.
- LICENSE and .gitignore are repository infrastructure, not functional subsystems.
11. Overall runtime data flow
- User launches align_view.py → Qt application initializes → generated UI and Qt resources are loaded → user opens or drops an image → the image is drawn in the overlay window → mouse/keyboard input updates transform state (position, scale, rotation, opacity) → the overlay is redrawn continuously.
- The app is essentially a single-process GUI tool with no obvious backend, database, or network service.
12. How to draw the architecture
- The diagram should have one main desktop app boundary containing:
- the bootstrap script
- the overlay/window UI
- input handling
- image transform state
- Qt-generated UI/resource assets
- Outside the app boundary, show the operating system as the source of mouse/keyboard/file-drop events and screen surface rendering.
Main entry points: align_view.py align_view.py · align_view_ui.py align_view_ui.py · resources_rc.py resources_rc.py · align_view_ui.ui align_view_ui.ui
Components 13
Desktop App
Core single-process Qt application
- align_view.py · Starts Qt, builds the overlay, and wires the app together
align_view.py - Overlay Window · Semi-transparent floating image overlay shown on screen
- Transform State · Tracks position, zoom, rotation, opacity, and lock state
- Input Handler · Handles mouse, wheel, keyboard, and shortcut behavior
- Image Loader · Accepts opened or dropped images and feeds the overlay
- align_view_ui.py · Python form generated from Qt Designer layout
src/align_view_ui.py - align_view_ui.ui · Source UI layout edited in Qt Designer
src/resources/align_view_ui.ui - adaptic.qss · Defines the app’s visual theme and widget styling
src/resources/adaptic.qss - resources.qrc · Declares packaged Qt assets for compilation
src/resources/resources.qrc - resources_rc.py · Compiled Qt resource module used at runtime
src/resources_rc.py
Operating System
OS-provided input, files, and display surface
- Mouse & Keys · System events used for dragging, zooming, rotation, and nudging
- Dropped Files · Dragged-in image files from the desktop or file manager
- Screen · The desktop surface where the overlay is rendered
Connections 15
- align_view.py → align_view_ui.py: loads UI · Bootstraps the generated Qt form into the app
- align_view.py → resources_rc.py: loads assets · Registers packaged Qt resources at startup
- align_view.py → Overlay Window: creates · Constructs the main overlay window
- align_view.py → Input Handler: wires · Connects UI actions and event handlers
- align_view.py → adaptic.qss: applies theme · Loads the Qt stylesheet for presentation
- align_view_ui.ui → align_view_ui.py: compiled to · Designer form is converted into the runtime Python UI module
- resources.qrc → resources_rc.py: compiled to · Qt resource manifest is compiled into the Python resource module
- Input Handler → Transform State: updates · Mouse and keyboard gestures mutate overlay transform state
- Transform State → Overlay Window: drives view · State changes are reflected in the rendered overlay
- Image Loader → Overlay Window: sets image · Loaded image content becomes the overlay’s canvas
- Mouse & Keys → Input Handler: events · Mouse, wheel, keyboard, and shortcut input enters from the OS
- Dropped Files → Image Loader: drop/open · Image files are provided through drag-and-drop or file selection
- Overlay Window → Screen: renders on · Overlay is drawn onto the desktop screen surface
- align_view_ui.py → Overlay Window: defines controls · Generated widgets provide the UI boundary for the overlay window
- resources_rc.py → Overlay Window: provides assets · Runtime resource module supplies packaged icons and assets