Documentation
¶
Overview ¶
Package fluent gives native Win32 controls the Windows 11 (WinUI 3) look: text boxes, flat borders, subtle and standard buttons, a rounded input surface and the Explorer selection of tables. The controls stay SWT widgets; the frame is painted in their non-client area from a window subclass.
Index ¶
- Constants
- func Button(b *swt.Button, subtle, circle, border bool)
- func ButtonOf(c *swt.Control) *swt.Button
- func ExtraHeight(t *swt.Text) int
- func FlatBorder(c *swt.Control)
- func Glass(c *swt.Composite, on bool)
- func GlassBorder(c *swt.Control, on bool)
- func GlassFocusRing(ctl *swt.Control, on bool)
- func GlassRadius(c *swt.Composite, r float64)
- func Shell(s *swt.Shell)
- func Table(t *swt.Table)
- func Text(t *swt.Text)
- func Unframe(c *swt.Control, s *surface)
- type Palette
- type RGB
Constants ¶
const Capsule = -1
Capsule is the radius that makes the shorter side a half circle, as look.Capsule.
Variables ¶
This section is empty.
Functions ¶
func Button ¶
Button repaints a push button in the WinUI 3 style. Each flag adds to what an earlier call set.
func ExtraHeight ¶
ExtraHeight is the height in points the frame takes from the client area of a multi-line Text.
func FlatBorder ¶
FlatBorder replaces the 3D edge (WS_EX_CLIENTEDGE) by a flat 1 px hairline with square corners.
func Glass ¶
Glass turns the surface on or off; on, the Text fields inside c lose their frame and take the fill.
func GlassBorder ¶
GlassBorder sets the hairline of the surface of c, a container or a push button.
func GlassFocusRing ¶
func GlassRadius ¶
func Shell ¶
Shell hides the focus rectangles of a window until the keyboard is used, as Windows 11 apps do: a click on a Link, Button, check box, Table or Tree leaves no dotted rectangle. The rule is one display filter, not a change of each widget: a mouse press sets UISF_HIDEFOCUS on the window of the control, Tab, an arrow key or Space clears it.
func Table ¶
Table hooks EraseItem so SWT paints the Explorer selection once per row, not per cell (the seams between columns), drops the dotted focus rectangle until a key is used, and draws images of right and centre columns aligned.
Types ¶
type Palette ¶
type Palette struct {
Dark bool
Accent RGB
OnAccent RGB
Text RGB
Disabled RGB
Fill RGB // input surface
Black RGB // the colour that tints light surfaces: black on light, white on dark
}
Palette holds the WinUI 3 colours of the light or the dark theme and the system accent.
func Current ¶
Current returns the palette for the content of d: dark when look.SetDarkContent turned it on.
func (Palette) StrongStroke ¶
StrongStroke is the bottom edge of an input at rest, WinUI's ControlStrongStroke.