JBrowser Source Docs
You are reading the documentation for JBrowser 2.0.2. The newest release is 2.0.3. Go to the latest documentation

jbrowser.ui.theme

Generated from the source code of JBrowser 2.0.2.

jbrowser/ui/theme.py · 458 lines

Theme engine: dark/light palettes with alpha-layered surfaces over Mica / Acrylic.

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…
TRANSITION_BASE ('#202020', '#f3f3f3')

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 Acrylic / Mica backdrop of the main window: the tint, black for incognito, or None for the plain material.

Theme.material_shown#

property material_shownsource

True when a see-through material (Mica / Acrylic) is chosen and Windows is drawing it.

Theme.set_see_through#

set_see_through(on: bool) -> Nonesource

Windows started or stopped drawing materials behind JBrowser (ui/backdrop.py LookGuard).

Theme.backdrop_layers#

backdrop_layers() -> list[QColor]source

What a translucent window paints over the system backdrop, bottom first: JBrowser's own base colour, then the tint wash. The base keeps dark windows dark and light ones light whatever Windows draws behind them; the frosted backdrop still shows through.

Theme.backdrop_color#

backdrop_color() -> QColorsource

backdrop_layers() flattened into one colour (with alpha), or the solid window colour. The ribbon, the bookmarks bar and the sidebar paint it under themselves (CompositionMode_Source), so their pixels never depend on the window background being repainted underneath them: when it wasn't, on some PCs, a rectangle of bare backdrop (light or dark) showed through until the window was minimised.

Theme.paint_base#

paint_base(p: QPainter, rect) -> Nonesource

Paint backdrop_color() over rect, replacing whatever was there.

Theme.surface#

surface(token: str) -> QColorsource

Surface color honoring the solid (no Mica) material.

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