The formatter module#
A Formatter that uses parce.theme.Theme with QTextCharFormat.
- class Formatter(theme, factory=None)[source]#
Bases:
FormatterFormatter, inheriting from parce.Formatter, but using Qt text formats by default.
- font(widget=None)[source]#
Return the font of the default text format.
This font can then be used for a text editing widget. If widget is specified, resolves the application’s default font for the widget with the properties from the theme.
- palette(widget=None)[source]#
Return a QPalette with the following colors set:
QPalette.Textdefault foreground color
QPalette.Basedefault background color
QPalette.HighlightTextselection foreground color
QPalette.Highlightselection background color
QPalette.AlternateBasebackground color for the current line
If the theme supports it, the Inactive and Disabled color groups are set to their own colors. Otherwise, they just use the same colors.
If widget is specified, resolves the application’s default palette for the widget with the properties from the theme.