PCEF 0.1.1 documentation

Styling

«  Panels   ::   Contents   ::   PCEF Class diagram  »

Styling

This page contains documentation about module classes and functions related to styling.

Default style

class pcef.style.Style(name)[source]

Defines style options used by all pcef widgets to setup their style.

It mainly consists of a font definition, a pygments style and a series of colors used for various purposes.

A style can be serialised to a JSON file using pcef.style.toJSON() and pcef.style.fromJSON()

activeLineColor = None

The active line color

backgroundColor[source]

Returns the style background color as defined in the pygmentsStyle.

fontName = None

A default font

fontSize = None

A default font size

lineNbrColor = None

the line nbr color

marginColor = None

Right margin color (used by

panelSeparatorColor = None

A default Panel separator color

panelsBackgroundColor = None

A default Panel background color

pygmentsStyle = None

Pygments syntax highlighting style (used by SyntaxHighlighting Mode)

resetDefault()[source]

Reset the style to the default white style.

searchBackgroundColor = None

Search results background

searchColor = None

Search results foreground

selectionBackgroundColor = None

The selection background color

selectionTextColor = None

The selection text color

tokenColor(token)[source]

Gets a token color out of the pygmentsStyle. If the toke color is not found or null, the method returns ‘#000000’

Returns:The color string formatted as html color (#RRggBB)
Return type:str

Dark style

class pcef.styles.dark.PygmentsDarkStyle[source]

Pygments theme inspired by the darcula theme (Pycharm)

class pcef.styles.dark.DarkStyle[source]

Our default dark style

Functions

pcef.style.toJSON(style)[source]

Serialises a style to a json file

Parameters:style (pcef.style.Style) – style to serialise
pcef.style.fromJSON(filename)[source]
Returns:A style instance read from a json file
Parameters:filename – style json filename
Return type:pcef.style.Style or None
pcef.styles.getAllStyles()[source]

Returns the list of available styles

pcef.styles.addStyle(newStyle)[source]

Add a new style to the style map (can be loaded from a json file)

Parameters:newStyle – Style subclass instance
pcef.styles.getStyle(name='Default')[source]

Returns the style instance that match the style name

Parameters:name – style name
Returns:Style or None

«  Panels   ::   Contents   ::   PCEF Class diagram  »