JBrowser Source Docs

jbrowser.ui.theme

Generated from the source code of JBrowser 2.0.3.

jbrowser/ui/theme.py · 411 lines

Theme engine: dark/light palettes with alpha-layered surfaces over JBrowser's own Frosted look (ui/frost.py) or a Solid colour. Windows are opaque; Windows' see-through materials are never used.

Constants#

Name Value
UI_FONT 'Segoe UI'
FALLBACK_FONT 'Segoe UI'
DARK {'window': '#1b1b1f', 'text': '#f2f2f5', 'text2': 'rgba(255,255,255,0.66)', 'text3': 'r…
LIGHT {'window': '#f3f3f3', 'text': '#1a1a1d', 'text2': 'rgba(0,0,0,0.62)', 'text3': 'rgba(0,…
TINTS {'rose': ('Rose', '#e8577a'), 'coral': ('Coral', '#ff7a59'), 'amber': ('Amber', '#f0a83…
MATERIALS ('frosted', 'solid')

Theme#

class Theme(QObject)source
Theme(settings: Settings, parent: QObject | None=None)

Signals

Signal Arguments
changed ()

Theme.set_incognito#

set_incognito(on: bool) -> Nonesource

The active space is incognito: switch to the black look (and back).

Theme.refresh#

refresh() -> Nonesource

Theme.c#

c(token: str) -> QColorsource

Theme.accent_text#

accent_text() -> QColorsource

Theme.accent_alpha#

accent_alpha(alpha: float) -> QColorsource

Theme.card_outline#

card_outline(alpha: float=0.9) -> QColorsource

Outline of the active card: a washed (paler, slightly see-through) version of the colour tint, or grey with No colour and in incognito spaces.

Theme.backdrop_wash#

backdrop_wash() -> QColor | Nonesource

Colour laid over the frosted picture: the tint, black for incognito, or None.

Theme.frost_look#

frost_look() -> tuplesource

What the frosted picture depends on besides the wallpaper: its tint and the colour wash.

Theme.paint_backdrop#

paint_backdrop(p: QPainter, widget, rect, layer: str | None=None) -> Nonesource

Paint the window's background under rect of widget: the Frosted picture (fitted to the widget's window, so every widget's part lines up), or the Solid colour. layer is a surface token laid over it (the canvas's), baked into the picture so it costs nothing extra.

Theme.surface#

surface(token: str) -> QColorsource

Surface colour: partly see-through over Frosted, opaque with Solid.

Theme.font_family#

font_family() -> strsource

Theme.apply#

apply() -> Nonesource

Theme.stylesheet#

stylesheet() -> strsource

Functions#

mix#

mix(base: QColor, other: QColor, amount: float) -> QColorsource

base moved amount (0…1) of the way towards other; keeps base's alpha.

solid#

solid(c: QColor) -> QColorsource

c fully opaque. For widgets drawn over web pages: Qt composites a partly transparent widget over a page far more see-through than its alpha suggests, so the page's text would show through.

parse_color#

parse_color(value: str) -> QColorsource

theme#

theme() -> Themesource