Tepl.Settings¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Tepl.Settings(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod get_range_uint(settings, key)¶
- Parameters:
settings (
Gio.Settings
) – aGio.Settings
.key (
str
) – a key part of settings.
- Returns:
whether the operation was successful.
- min:
the minimum value allowed by the range.
- max:
the maximum value allowed by the range.
- Return type:
This function introspects a
Gio.Settings
key to get its range, if the key as a “u” type (unsigned integer).False
is returned if the introspection failed.See
Gio.SettingsSchemaKey.get_range
() for more flexibility.New in version 6.2.
- classmethod get_singleton()¶
- Returns:
the
Tepl.Settings
singleton instance.- Return type:
New in version 6.2.
- get_selected_font()¶
- Returns:
the selected font name.
- Return type:
If
Tepl.Settings.provide_font_settings
() has *not* been called, this function always returns the current value of the system’s fixed width (monospace) font.If
Tepl.Settings.provide_font_settings
() *has* been called, this function returns the font name depending on the boolean value of use_default_font_key.See also the
Tepl.Settings
::font-changed
signal,Tepl.utils_override_font_string
() andTepl.prefs_create_font_component
().New in version 6.2.
- get_style_scheme_id()¶
- Returns:
the value of the
Tepl.Settings
:style-scheme-id
property.- Return type:
New in version 6.11.
- handle_theme_variant(theme_variant_settings, theme_variant_setting_key)¶
- Parameters:
theme_variant_settings (
Gio.Settings
orNone
) – aGio.Settings
object, orNone
.theme_variant_setting_key (
str
orNone
) – aGio.Settings
key of type enumTepl.SettingsThemeVariant
, orNone
.
This function permits to setup correctly the GTK theme variant to use.
If theme_variant_settings and theme_variant_setting_key are
None
, only the system’s settings will be taken into account.If theme_variant_settings and theme_variant_setting_key are provided, they are taken into account according to
Tepl.SettingsThemeVariant
.You should call this function only once, as subsequent calls are ignored (the setting used cannot be reconfigured).
New in version 6.10.
- peek_desktop_interface_settings()¶
- Returns:
the
Gio.Settings
for"org.gnome.desktop.interface"
.- Return type:
New in version 6.2.
- provide_font_settings(font_settings, use_default_font_key, editor_font_key)¶
- Parameters:
font_settings (
Gio.Settings
) – theGio.Settings
object containing the keys.use_default_font_key (
str
) – a key of type boolean.editor_font_key (
str
) – a key of type string.
This function can only be called once, to provide two keys:
use_default_font_key: must be of type boolean, to know whether to use the system’s font (the default font), or the editor font.
editor_font_key: must be of type string, containing the font name to have a different font for the text editor, rather than using the system’s font.
See
Tepl.Settings.get_selected_font
().New in version 6.2.
- provide_style_scheme_settings(style_scheme_settings, key_for_light_theme_variant, key_for_dark_theme_variant)¶
- Parameters:
style_scheme_settings (
Gio.Settings
) – theGio.Settings
object containing the keys.key_for_light_theme_variant (
str
) – a key of type string.key_for_dark_theme_variant (
str
) – a key of type string.
This function can only be called once, to provide two keys:
key_for_light_theme_variant: must be of type string, containing the ID of a
GtkSource.StyleScheme
that should be used when the GTK theme variant is light.key_for_dark_theme_variant: the same, but when the GTK theme variant is dark.
See
Tepl.Settings.get_style_scheme_id
().New in version 6.11.
Signal Details¶
- Tepl.Settings.signals.font_changed(settings)¶
- Signal Name:
font-changed
- Flags:
- Parameters:
settings (
Tepl.Settings
) – The object which received the signal
The
::font-changed
signal is emitted when the return value ofTepl.Settings.get_selected_font
() has potentially changed.It takes into account the use_default_font_key provided with
Tepl.Settings.provide_font_settings
() to avoid unnecessary signal emission. In other words, for example if use_default_font_key isFalse
, the signal is not emitted even if the default (system’s) font has been modified.The relation between this signal and a potential zoom in and zoom out feature, to temporarily make the font larger or smaller (so the zoom level not being stored in
Gio.Settings
): when this signal is emitted, it means that the user has explicitly changed the font setting, and as such he or she probably wants to use that font instead. So the expected behavior in that case is to reset the zoom level. But it’s left as an exercise for another class, sinceTepl.Settings
is only forGio.Settings
.New in version 6.2.
Property Details¶
- Tepl.Settings.props.style_scheme_id¶
-
See
Tepl.Settings.provide_style_scheme_settings
().The value of this property depends on whether the GTK theme is light or dark, and uses the corresponding
Gio.Settings
key.New in version 6.11.