# yadek/glow architecture

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

- Interactive diagram: https://gitdiagram.com/yadek/glow
- Repository: https://github.com/yadek/glow

## Overview

Glow is a Windows tray application for controlling external-monitor brightness and per-display night warmth. The principal workflow starts when the app creates its tray context; users open a popup to adjust master or individual display controls, which act on monitor brightness or night-mode state. Display discovery, stable EDID identity, persisted settings, and reapplication after system events support that workflow. The graph preserves documented startup, localization, theme, and update capabilities. Edges follow excerpts, SOURCE INDEX references, or README statements; unsampled implementation details are not inferred.

Main entry points: [`src/Glow/UI/BrightnessPopup.cs`](https://github.com/yadek/glow/blob/main/src/Glow/UI/BrightnessPopup.cs) (Brightness popup), [`src/Glow/UI/TrayContext.cs`](https://github.com/yadek/glow/blob/main/src/Glow/UI/TrayContext.cs) (Tray context), [`src/Glow/Monitors/DisplayManager.cs`](https://github.com/yadek/glow/blob/main/src/Glow/Monitors/DisplayManager.cs) (Display manager), [`src/Glow/NightShift/NightMode.cs`](https://github.com/yadek/glow/blob/main/src/Glow/NightShift/NightMode.cs) (Night mode)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_program["App entry<br/>[Program.cs]"]
  node_tray["Tray context<br/>[TrayContext.cs]"]
end

subgraph group_display["Display control"]
  node_displays["Display manager<br/>[DisplayManager.cs]"]
  node_catalog["Display catalog<br/>[DisplayCatalog.cs]"]
  node_brightness["DDC/CI brightness"]
  node_night["Night mode<br/>[NightMode.cs]"]
end

subgraph group_presentation["Tray interface"]
  node_popup["Brightness popup<br/>[BrightnessPopup.cs]"]
  node_slider["Brightness slider"]
  node_icon["Tray icon<br/>[GlowIcon.cs]"]
  node_glyph["Glyph icon<br/>[GlyphIcon.cs]"]
  node_panel["Rounded panel<br/>[RoundedPanel.cs]"]
  node_theme["Theme<br/>[Theme.cs]"]
  node_strings["Localization<br/>[Strings.cs]"]
end

subgraph group_platform["State and integrations"]
  node_native["Windows interop<br/>[NativeMethods.cs]"]
  node_settings["App settings<br/>[AppSettings.cs]"]
  node_registry[("Windows registry")]
  node_startup["Startup manager<br/>[StartupManager.cs]"]
  node_updater["Updater<br/>[Updater.cs]"]
end

node_user(("User"))
node_github["GitHub Releases"]
node_windows["Windows APIs"]

node_user -->|"interacts with"| node_tray
node_program -->|"runs"| node_tray
node_tray -->|"opens"| node_popup
node_tray -->|"manages"| node_displays
node_tray -->|"toggles and reapplies"| node_night
node_tray -->|"toggles"| node_startup
node_tray -->|"checks and launches"| node_updater
node_tray -->|"uses"| node_icon
node_popup -->|"reads displays"| node_displays
node_popup -->|"sets night mode"| node_night
node_popup -->|"reads and saves"| node_settings
node_popup -->|"uses"| node_slider
node_popup -->|"uses"| node_panel
node_popup -->|"uses"| node_glyph
node_popup -->|"reads styling"| node_theme
node_popup -.->|"uses labels"| node_strings
node_slider -->|"reads styling"| node_theme
node_displays -->|"enumerates"| node_catalog
node_displays -->|"attaches handles"| node_brightness
node_displays -->|"acquires monitor handles"| node_native
node_brightness -->|"controls brightness"| node_native
node_catalog -->|"enumerates displays"| node_native
node_night -->|"enumerates displays"| node_catalog
node_night -->|"loads and saves state"| node_settings
node_night -.->|"applies gamma ramps"| node_native
node_settings -->|"persists settings"| node_registry
node_startup -->|"sets startup entry"| node_registry
node_theme -->|"reads theme values"| node_registry
node_catalog -->|"reads EDID"| node_registry
node_native -->|"calls native APIs"| node_windows
node_updater -->|"checks releases"| node_github
node_updater -->|"downloads installer"| node_github
node_tray -->|"uses labels"| node_strings

click node_program "https://github.com/yadek/glow/blob/main/src/Glow/Program.cs"
click node_tray "https://github.com/yadek/glow/blob/main/src/Glow/UI/TrayContext.cs"
click node_popup "https://github.com/yadek/glow/blob/main/src/Glow/UI/BrightnessPopup.cs"
click node_slider "https://github.com/yadek/glow/blob/main/src/Glow/UI/BrightnessSlider.cs"
click node_icon "https://github.com/yadek/glow/blob/main/src/Glow/UI/GlowIcon.cs"
click node_glyph "https://github.com/yadek/glow/blob/main/src/Glow/UI/GlyphIcon.cs"
click node_panel "https://github.com/yadek/glow/blob/main/src/Glow/UI/RoundedPanel.cs"
click node_theme "https://github.com/yadek/glow/blob/main/src/Glow/UI/Theme.cs"
click node_strings "https://github.com/yadek/glow/blob/main/src/Glow/Localization/Strings.cs"
click node_displays "https://github.com/yadek/glow/blob/main/src/Glow/Monitors/DisplayManager.cs"
click node_catalog "https://github.com/yadek/glow/blob/main/src/Glow/Monitors/DisplayCatalog.cs"
click node_brightness "https://github.com/yadek/glow/blob/main/src/Glow/Monitors/BrightnessMonitor.cs"
click node_night "https://github.com/yadek/glow/blob/main/src/Glow/NightShift/NightMode.cs"
click node_native "https://github.com/yadek/glow/blob/main/src/Glow/Native/NativeMethods.cs"
click node_settings "https://github.com/yadek/glow/blob/main/src/Glow/Settings/AppSettings.cs"
click node_startup "https://github.com/yadek/glow/blob/main/src/Glow/Startup/StartupManager.cs"
click node_updater "https://github.com/yadek/glow/blob/main/src/Glow/Update/Updater.cs"

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_program,node_tray,node_user toneBlue
class node_displays,node_catalog,node_brightness,node_night toneAmber
class node_popup,node_slider,node_icon,node_glyph,node_panel,node_theme,node_strings,node_windows toneMint
class node_native,node_settings,node_registry,node_startup,node_updater toneRose
class node_github toneIndigo
```

## Components

### Application shell

- [App entry](https://github.com/yadek/glow/blob/main/src/Glow/Program.cs): `src/Glow/Program.cs`
- [Tray context](https://github.com/yadek/glow/blob/main/src/Glow/UI/TrayContext.cs): `src/Glow/UI/TrayContext.cs`

### Display control

- [Display manager](https://github.com/yadek/glow/blob/main/src/Glow/Monitors/DisplayManager.cs): `src/Glow/Monitors/DisplayManager.cs`
- [Display catalog](https://github.com/yadek/glow/blob/main/src/Glow/Monitors/DisplayCatalog.cs): `src/Glow/Monitors/DisplayCatalog.cs`
- [DDC/CI brightness](https://github.com/yadek/glow/blob/main/src/Glow/Monitors/BrightnessMonitor.cs): `src/Glow/Monitors/BrightnessMonitor.cs`
- [Night mode](https://github.com/yadek/glow/blob/main/src/Glow/NightShift/NightMode.cs): `src/Glow/NightShift/NightMode.cs`

### Tray interface

- [Brightness popup](https://github.com/yadek/glow/blob/main/src/Glow/UI/BrightnessPopup.cs): `src/Glow/UI/BrightnessPopup.cs`
- [Brightness slider](https://github.com/yadek/glow/blob/main/src/Glow/UI/BrightnessSlider.cs): `src/Glow/UI/BrightnessSlider.cs`
- [Tray icon](https://github.com/yadek/glow/blob/main/src/Glow/UI/GlowIcon.cs): `src/Glow/UI/GlowIcon.cs`
- [Glyph icon](https://github.com/yadek/glow/blob/main/src/Glow/UI/GlyphIcon.cs): `src/Glow/UI/GlyphIcon.cs`
- [Rounded panel](https://github.com/yadek/glow/blob/main/src/Glow/UI/RoundedPanel.cs): `src/Glow/UI/RoundedPanel.cs`
- [Theme](https://github.com/yadek/glow/blob/main/src/Glow/UI/Theme.cs): `src/Glow/UI/Theme.cs`
- [Localization](https://github.com/yadek/glow/blob/main/src/Glow/Localization/Strings.cs): `src/Glow/Localization/Strings.cs`

### State and integrations

- [Windows interop](https://github.com/yadek/glow/blob/main/src/Glow/Native/NativeMethods.cs): `src/Glow/Native/NativeMethods.cs`
- [App settings](https://github.com/yadek/glow/blob/main/src/Glow/Settings/AppSettings.cs): `src/Glow/Settings/AppSettings.cs`
- **Windows registry**
- [Startup manager](https://github.com/yadek/glow/blob/main/src/Glow/Startup/StartupManager.cs): `src/Glow/Startup/StartupManager.cs`
- [Updater](https://github.com/yadek/glow/blob/main/src/Glow/Update/Updater.cs): `src/Glow/Update/Updater.cs`

### Other components

- **User**
- **GitHub Releases**
- **Windows APIs**

## Connections

- User → Tray context: interacts with (evidence: `README.md`)
- App entry → Tray context: runs (evidence: `src/Glow/Program.cs`)
- Tray context → Brightness popup: opens (evidence: `src/Glow/UI/TrayContext.cs`)
- Tray context → Display manager: manages (evidence: `src/Glow/UI/TrayContext.cs`)
- Tray context → Night mode: toggles and reapplies (evidence: `src/Glow/UI/TrayContext.cs`)
- Tray context → Startup manager: toggles (evidence: `src/Glow/UI/TrayContext.cs`)
- Tray context → Updater: checks and launches (evidence: `src/Glow/UI/TrayContext.cs`)
- Tray context → Tray icon: uses (evidence: `src/Glow/UI/TrayContext.cs`)
- Brightness popup → Display manager: reads displays (evidence: `src/Glow/UI/BrightnessPopup.cs`)
- Brightness popup → Night mode: sets night mode (evidence: `src/Glow/UI/BrightnessPopup.cs`)
- Brightness popup → App settings: reads and saves (evidence: `src/Glow/UI/BrightnessPopup.cs`)
- Brightness popup → Brightness slider: uses (evidence: `src/Glow/UI/BrightnessPopup.cs`)
- Brightness popup → Rounded panel: uses (evidence: `src/Glow/UI/BrightnessPopup.cs`)
- Brightness popup → Glyph icon: uses (evidence: `src/Glow/UI/BrightnessPopup.cs`)
- Brightness popup → Theme: reads styling (evidence: `src/Glow/UI/BrightnessPopup.cs`)
- Brightness popup → Localization: uses labels (evidence: `src/Glow/UI/BrightnessPopup.cs`)
- Brightness slider → Theme: reads styling (evidence: `src/Glow/UI/BrightnessSlider.cs`)
- Display manager → Display catalog: enumerates (evidence: `src/Glow/Monitors/DisplayManager.cs`)
- Display manager → DDC/CI brightness: attaches handles (evidence: `src/Glow/Monitors/DisplayManager.cs`)
- Display manager → Windows interop: acquires monitor handles (evidence: `src/Glow/Monitors/DisplayManager.cs`)
- DDC/CI brightness → Windows interop: controls brightness (evidence: `src/Glow/Monitors/BrightnessMonitor.cs`)
- Display catalog → Windows interop: enumerates displays (evidence: `src/Glow/Monitors/DisplayCatalog.cs`)
- Night mode → Display catalog: enumerates displays (evidence: `src/Glow/NightShift/NightMode.cs`)
- Night mode → App settings: loads and saves state (evidence: `src/Glow/NightShift/NightMode.cs`)
- Night mode → Windows interop: applies gamma ramps (evidence: `src/Glow/NightShift/NightMode.cs`)
- App settings → Windows registry: persists settings (evidence: `src/Glow/Settings/AppSettings.cs`)
- Startup manager → Windows registry: sets startup entry (evidence: `src/Glow/Startup/StartupManager.cs`)
- Theme → Windows registry: reads theme values (evidence: `src/Glow/UI/Theme.cs`)
- Display catalog → Windows registry: reads EDID (evidence: `src/Glow/Monitors/DisplayCatalog.cs`)
- Windows interop → Windows APIs: calls native APIs (evidence: `src/Glow/Native/NativeMethods.cs`)
- Updater → GitHub Releases: checks releases (evidence: `src/Glow/Update/Updater.cs`)
- Updater → GitHub Releases: downloads installer (evidence: `src/Glow/Update/Updater.cs`)
- Tray context → Localization: uses labels (evidence: `src/Glow/UI/TrayContext.cs`)
