Skip to content

Dialog primitive: per-backend native-look styling option #209

Description

@JDonaghy

Idea

The `quadraui::Dialog` primitive is functional but visually generic — it looks the same on every backend (a centered box with title, body, buttons). Some users would prefer dialogs that match their platform's native look:

  • GTK: rounded corners, GNOME / Adwaita button styling, header bar styling, OK/Cancel button order convention (Cancel on left, primary on right per GNOME HIG).
  • Win-GUI (future): Win11 dialog styling — rounded corners, Mica/Acrylic background, Yes/No button order convention.
  • macOS (future): NSAlert-like sheet styling — possibly even using AppKit if available behind a feature flag.

Approach options

  1. Severity-tinted theming. `DialogSeverity` (already in the primitive) drives an icon + accent. Cheap, doesn't change layout. Could ship soon.
  2. Per-backend stylesheet. Each backend's `draw_dialog` reads from a `DialogStyle` table that the theme owns. Lets users override colours / corner radius per platform without touching the primitive.
  3. Native widget escape hatch. A new `Backend::show_native_dialog(...)` trait method that bypasses the primitive entirely on backends with a strong native dialog facility (e.g. GTK4 `MessageDialog`, Win32 `MessageBoxW`, NSAlert). Loses cross-backend layout consistency, gains true native feel.
  4. Adwaita styling on GTK. Specific to GTK — render with rounded corners + Adwaita-like spacing without consulting native widgets. Lowest-friction first step.

Option (4) is the most pragmatic first pass — small change to `quadraui_gtk::draw_dialog`, no primitive contract change.

Surfaced by

Smoke testing of #205 slice 5 (`7768a25`). User comment: "some way to style these dialogs to make them look more native would be a great feature for later."

Priority

Low / nice-to-have. Functional dialogs ship today; this is polish.

Files

  • `src/gtk/quadraui_gtk.rs::draw_dialog` — first place to introduce GTK-specific styling
  • `quadraui/src/primitives/dialog.rs::DialogSeverity` — already exists, currently unused
  • (Future) `src/win_gui/quadraui_win.rs::draw_dialog` when Win-GUI gets a Dialog consumer

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestuiUI/rendering

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions