# protorayn/klipperscreen-theme-creator architecture

> Architecture diagram of the GitHub repository protorayn/klipperscreen-theme-creator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/protorayn/klipperscreen-theme-creator
- Repository: https://github.com/protorayn/klipperscreen-theme-creator

## Overview

KlipperScreen Theme Creator is a GTK visual editor for configuring theme styles and exporting a KlipperScreen-compatible CSS file. The workflow starts the GTK app, displays a clickable KlipperScreen-style preview, sends selected roles and edited properties through the inspector to the theme model, and applies regenerated preview CSS. Export uses that model to generate theme CSS, which the app writes to the user-selected file. The README also describes adjustable preview resolution and live editing of colors, opacity, borders, and radius. Edges reflect shown callbacks and calls; unsampled implementation details are omitted.

Main entry points: [`theme_creator/app.py`](https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/app.py) (Editor window), [`theme_creator/inspector/property_panel.py`](https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/inspector/property_panel.py) (Property inspector), [`theme_creator/preview/main_preview.py`](https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/preview/main_preview.py) (Clickable preview), [`theme_creator/main.py`](https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/main.py) (App entry point)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["GTK Editor UI"]
  node_entry["App entry point<br/>[main.py]"]
  node_window["Editor window<br/>[app.py]"]
  node_preview["Clickable preview<br/>[main_preview.py]"]
  node_inspector["Property inspector<br/>[property_panel.py]"]
end

subgraph group_state["Theme State"]
  node_model["Theme model<br/>[theme_model.py]"]
end

subgraph group_css["CSS Generation"]
  node_appcss["Editor styling<br/>[app_style.py]"]
  node_generator["CSS generator<br/>[css_generator.py]"]
end

node_user(("Theme editor user"))
node_file["Selected CSS file"]

node_user -->|"starts app"| node_entry
node_entry -->|"creates app"| node_window
node_window -->|"creates model"| node_model
node_window -->|"creates preview"| node_preview
node_window -->|"creates inspector"| node_inspector
node_preview -->|"reports selection"| node_window
node_inspector -->|"reports edits"| node_window
node_inspector -->|"reports resolution"| node_window
node_inspector -->|"requests export"| node_window
node_window -->|"updates state"| node_model
node_window -->|"sets resolution"| node_preview
node_window -->|"loads editor CSS"| node_appcss
node_window -->|"generates preview CSS"| node_generator
node_window -->|"generates theme CSS"| node_generator
node_window -->|"writes CSS"| node_file

click node_entry "https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/main.py"
click node_window "https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/app.py"
click node_preview "https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/preview/main_preview.py"
click node_inspector "https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/inspector/property_panel.py"
click node_model "https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/model/theme_model.py"
click node_appcss "https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/app_style.py"
click node_generator "https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/export/css_generator.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_window,node_preview,node_inspector,node_user toneBlue
class node_model toneAmber
class node_appcss,node_generator toneMint
class node_file toneIndigo
```

## Components

### GTK Editor UI

- [App entry point](https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/main.py): `theme_creator/main.py`
- [Editor window](https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/app.py): `theme_creator/app.py`
- [Clickable preview](https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/preview/main_preview.py): `theme_creator/preview/main_preview.py`
- [Property inspector](https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/inspector/property_panel.py): `theme_creator/inspector/property_panel.py`

### Theme State

- [Theme model](https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/model/theme_model.py): `theme_creator/model/theme_model.py`

### CSS Generation

- [Editor styling](https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/app_style.py): `theme_creator/app_style.py`
- [CSS generator](https://github.com/protorayn/klipperscreen-theme-creator/blob/main/theme_creator/export/css_generator.py): `theme_creator/export/css_generator.py`

### Other components

- **Theme editor user**
- **Selected CSS file**

## Connections

- Theme editor user → App entry point: starts app (evidence: `theme_creator/main.py`)
- App entry point → Editor window: creates app (evidence: `theme_creator/main.py`)
- Editor window → Theme model: creates model (evidence: `theme_creator/app.py`)
- Editor window → Clickable preview: creates preview (evidence: `theme_creator/app.py`)
- Editor window → Property inspector: creates inspector (evidence: `theme_creator/app.py`)
- Clickable preview → Editor window: reports selection (evidence: `theme_creator/preview/main_preview.py`)
- Property inspector → Editor window: reports edits (evidence: `theme_creator/inspector/property_panel.py`)
- Property inspector → Editor window: reports resolution (evidence: `theme_creator/inspector/property_panel.py`)
- Property inspector → Editor window: requests export (evidence: `theme_creator/inspector/property_panel.py`)
- Editor window → Theme model: updates state (evidence: `theme_creator/app.py`)
- Editor window → Clickable preview: sets resolution (evidence: `theme_creator/app.py`)
- Editor window → Editor styling: loads editor CSS (evidence: `theme_creator/app.py`)
- Editor window → CSS generator: generates preview CSS (evidence: `theme_creator/app.py`)
- Editor window → CSS generator: generates theme CSS (evidence: `theme_creator/app.py`)
- Editor window → Selected CSS file: writes CSS (evidence: `theme_creator/app.py`)
