docs
Loading...
Searching...
No Matches
DividerStyle.h
Go to the documentation of this file.
1///
2/// Copyright (C) 2026 Ultralight, Inc. All rights reserved.
3/// A license is required for commercial use. https://ultralig.ht
4///
5#pragma once
6#include <AppCore/Defines.h>
7#include <Ultralight/Color.h>
8
9namespace ultralight {
10
11///
12/// Line thickness, colors, and grab width for draggable pane dividers.
13///
14/// Resizable Container%s place draggable dividers between direct children so users can adjust split
15/// panes in a window. DividerStyle controls the appearance of those dividers and the size of their
16/// pointer hit target.
17///
18/// Pass a style to Window::SetDividerStyle() to format dividers across the window:
19///
20/// ```
21/// window->SetDividerStyle({ .visual_thickness = 1, .color = "#3c3c3c" });
22/// ```
23///
24/// ## Window and Container Styles
25///
26/// You can configure dividers across the window or on an individual container:
27///
28/// - **Window::SetDividerStyle() sets the baseline for all dividers in the window.** Any field left
29/// unset (a zero width or an unset Color) falls back to the built-in defaults.
30/// - **Container::SetDividerStyle() overrides the window style for dividers between that
31/// container's direct children.** Any field left unset falls back to the window's style, while
32/// passing a default-constructed DividerStyle clears the override.
33///
34/// Set an override on a container to change specific properties:
35///
36/// ```
37/// RefPtr<Container> body =
38/// window->layout()->AddRow({ .key = "body", .resizable = true });
39/// body->SetDividerStyle({ .hover_color = "#0078d4" }); // the rest comes from the window
40/// ```
41///
42/// @note Dividers paint no line by default (an unset `color` lets the window background show
43/// through).
44///
45/// @see Window::SetDividerStyle(), Container::SetDividerStyle(), ContainerOptions::resizable
46///
48 ///
49 /// The width of the divider's pointer target, in logical px. (Default: 6)
50 ///
51 double hit_width = 0.0;
52
53 ///
54 /// The thickness of the painted divider line, in logical px. (Default: 1)
55 ///
56 double visual_thickness = 0.0;
57
58 ///
59 /// The color of the divider line. Unset means no line is painted and the window background
60 /// shows through.
61 ///
63
64 ///
65 /// The hover highlight color, painted over the divider while the pointer rests on it or drags
66 /// it. (Default: a half-opacity gray)
67 ///
69};
70
71} // namespace ultralight
An RGBA color value in a certain color space (with CSS parsing helpers).
Definition Color.h:69
Root namespace for every public Ultralight type, function, and enumeration.
Line thickness, colors, and grab width for draggable pane dividers.
Definition DividerStyle.h:47
double hit_width
The width of the divider's pointer target, in logical px.
Definition DividerStyle.h:51
Color color
The color of the divider line.
Definition DividerStyle.h:62
Color hover_color
The hover highlight color, painted over the divider while the pointer rests on it or drags it.
Definition DividerStyle.h:68
double visual_thickness
The thickness of the painted divider line, in logical px.
Definition DividerStyle.h:56