fluent

package
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2026 License: EPL-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Rendered for windows/amd64

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

View Source
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

func Button(b *swt.Button, subtle, circle, border bool)

Button repaints a push button in the WinUI 3 style. Each flag adds to what an earlier call set.

func ButtonOf

func ButtonOf(c *swt.Control) *swt.Button

ButtonOf returns c as a push button, or nil.

func ExtraHeight

func ExtraHeight(t *swt.Text) int

ExtraHeight is the height in points the frame takes from the client area of a multi-line Text.

func FlatBorder

func FlatBorder(c *swt.Control)

FlatBorder replaces the 3D edge (WS_EX_CLIENTEDGE) by a flat 1 px hairline with square corners.

func Glass

func Glass(c *swt.Composite, on bool)

Glass turns the surface on or off; on, the Text fields inside c lose their frame and take the fill.

func GlassBorder

func GlassBorder(c *swt.Control, on bool)

GlassBorder sets the hairline of the surface of c, a container or a push button.

func GlassFocusRing

func GlassFocusRing(ctl *swt.Control, on bool)

func GlassRadius

func GlassRadius(c *swt.Composite, r float64)

func Shell

func Shell(s *swt.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

func Table(t *swt.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.

func Text

func Text(t *swt.Text)

Text gives t the WinUI 3 TextBox look: 4 px radius, hairline, strong bottom edge, accent line while focused. The native border goes; the frame is painted in the non-client area. Search fields keep SWT's look.

func Unframe

func Unframe(c *swt.Control, s *surface)

Unframe leaves the frame of a Text made by Text to the surface s around it; the text keeps clear of the rounded corners of s.

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

func Current(d *swt.Display) Palette

Current returns the palette for the content of d: dark when look.SetDarkContent turned it on.

func (Palette) Stroke

func (p Palette) Stroke(bg RGB) RGB

Stroke is the hairline of a surface: 12% of the tint over bg.

func (Palette) StrongStroke

func (p Palette) StrongStroke(bg RGB) RGB

StrongStroke is the bottom edge of an input at rest, WinUI's ControlStrongStroke.

type RGB

type RGB struct{ R, G, B uint8 }

RGB is an opaque colour.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL