style: break up long lines (#476)

This commit is contained in:
0xMRTT 2022-09-23 00:30:23 +02:00 committed by GitHub
commit 08625b6376
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 254 additions and 113 deletions

View file

@ -60,7 +60,10 @@ class GradienceApplication(Adw.Application):
settings = Gio.Settings.new(app_id)
def __init__(self):
super().__init__(application_id=app_id, flags=Gio.ApplicationFlags.FLAGS_NONE)
super().__init__(
application_id=app_id,
flags=Gio.ApplicationFlags.FLAGS_NONE
)
self.set_resource_base_path(rootdir)
self.portal = Xdp.Portal()
@ -177,9 +180,8 @@ class GradienceApplication(Adw.Application):
raise KeyError("variables")
if preset.get("palette") is None:
raise KeyError("palette")
presets_list[file_name.replace(".json", "")] = preset[
"name"
]
presets_list[file_name.replace(".json", "")] \
= preset["name"]
except Exception:
self.win.toast_overlay.add_toast(
Adw.Toast(title=_("Failed to load preset"))
@ -205,9 +207,8 @@ class GradienceApplication(Adw.Application):
raise KeyError("variables")
if preset.get("palette") is None:
raise KeyError("palette")
presets_list["user"][file_name.replace(".json", "")] = preset[
"name"
]
presets_list["user"][file_name.replace(".json", "")] \
= preset["name"]
except Exception:
self.win.toast_overlay.add_toast(
Adw.Toast(title=_("Failed to load preset"))
@ -397,44 +398,59 @@ class GradienceApplication(Adw.Application):
dark_theme = theme["schemes"]["dark"]
variable = {
"accent_color": self.rgba_from_argb(dark_theme.primary),
"accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer),
"accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer),
"accent_bg_color":
self.rgba_from_argb(dark_theme.primaryContainer),
"accent_fg_color":
self.rgba_from_argb(dark_theme.onPrimaryContainer),
"destructive_color": self.rgba_from_argb(dark_theme.error),
"destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer),
"destructive_bg_color":
self.rgba_from_argb(dark_theme.errorContainer),
"destructive_fg_color": self.rgba_from_argb(
dark_theme.onErrorContainer
),
"success_color": self.rgba_from_argb(dark_theme.tertiary),
"success_bg_color": self.rgba_from_argb(dark_theme.onTertiary),
"success_fg_color": self.rgba_from_argb(dark_theme.onTertiaryContainer),
"success_fg_color":
self.rgba_from_argb(dark_theme.onTertiaryContainer),
"warning_color": self.rgba_from_argb(dark_theme.secondary),
"warning_bg_color": self.rgba_from_argb(dark_theme.onSecondary),
"warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"),
"warning_bg_color":
self.rgba_from_argb(dark_theme.onSecondary),
"warning_fg_color":
self.rgba_from_argb(dark_theme.primary, "0.8"),
"error_color": self.rgba_from_argb(dark_theme.error),
"error_bg_color": self.rgba_from_argb(dark_theme.errorContainer),
"error_bg_color":
self.rgba_from_argb(dark_theme.errorContainer),
"error_fg_color": self.rgba_from_argb(dark_theme.onError),
"window_bg_color": self.rgba_from_argb(dark_theme.surface),
"window_fg_color": self.rgba_from_argb(dark_theme.onSurface),
"view_bg_color": self.rgba_from_argb(dark_theme.surface),
"view_fg_color": self.rgba_from_argb(dark_theme.onSurface),
"headerbar_bg_color": self.rgba_from_argb(dark_theme.surface),
"headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface),
"headerbar_fg_color":
self.rgba_from_argb(dark_theme.onSurface),
"headerbar_border_color": self.rgba_from_argb(
dark_theme.primary, "0.8"
),
"headerbar_backdrop_color": "@window_bg_color",
"headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow),
"card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"),
"card_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer),
"headerbar_shade_color":
self.rgba_from_argb(dark_theme.shadow),
"card_bg_color":
self.rgba_from_argb(dark_theme.primary, "0.05"),
"card_fg_color":
self.rgba_from_argb(dark_theme.onSecondaryContainer),
"card_shade_color": self.rgba_from_argb(dark_theme.shadow),
"dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer),
"dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer),
"popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer),
"dialog_bg_color":
self.rgba_from_argb(dark_theme.secondaryContainer),
"dialog_fg_color":
self.rgba_from_argb(dark_theme.onSecondaryContainer),
"popover_bg_color":
self.rgba_from_argb(dark_theme.secondaryContainer),
"popover_fg_color": self.rgba_from_argb(
dark_theme.onSecondaryContainer
),
"shade_color": self.rgba_from_argb(dark_theme.shadow),
"scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline),
"scrollbar_outline_color":
self.rgba_from_argb(dark_theme.outline),
}
else: # light
light_theme = theme["schemes"]["light"]
@ -443,31 +459,38 @@ class GradienceApplication(Adw.Application):
"accent_bg_color": self.rgba_from_argb(light_theme.primary),
"accent_fg_color": self.rgba_from_argb(light_theme.onPrimary),
"destructive_color": self.rgba_from_argb(light_theme.error),
"destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer),
"destructive_bg_color":
self.rgba_from_argb(light_theme.errorContainer),
"destructive_fg_color": self.rgba_from_argb(
light_theme.onErrorContainer
),
"success_color": self.rgba_from_argb(light_theme.tertiary),
"success_bg_color": self.rgba_from_argb(light_theme.tertiaryContainer),
"success_bg_color":
self.rgba_from_argb(light_theme.tertiaryContainer),
"success_fg_color": self.rgba_from_argb(
light_theme.onTertiaryContainer
),
"warning_color": self.rgba_from_argb(light_theme.secondary),
"warning_bg_color": self.rgba_from_argb(light_theme.secondaryContainer),
"warning_bg_color":
self.rgba_from_argb(light_theme.secondaryContainer),
"warning_fg_color": self.rgba_from_argb(
light_theme.onSecondaryContainer
),
"error_color": self.rgba_from_argb(light_theme.error),
"error_bg_color": self.rgba_from_argb(light_theme.errorContainer),
"error_bg_color":
self.rgba_from_argb(light_theme.errorContainer),
"error_fg_color": self.rgba_from_argb(light_theme.onError),
"window_bg_color": self.rgba_from_argb(light_theme.secondaryContainer),
"window_bg_color":
self.rgba_from_argb(light_theme.secondaryContainer),
"window_fg_color": self.rgba_from_argb(light_theme.onSurface),
"view_bg_color": self.rgba_from_argb(light_theme.secondaryContainer),
"view_bg_color":
self.rgba_from_argb(light_theme.secondaryContainer),
"view_fg_color": self.rgba_from_argb(light_theme.onSurface),
"headerbar_bg_color": self.rgba_from_argb(
light_theme.secondaryContainer
),
"headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface),
"headerbar_fg_color":
self.rgba_from_argb(light_theme.onSurface),
"headerbar_border_color": self.rgba_from_argb(
light_theme.primary, "0.8"
),
@ -475,19 +498,24 @@ class GradienceApplication(Adw.Application):
"headerbar_shade_color": self.rgba_from_argb(
light_theme.secondaryContainer
),
"card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"),
"card_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer),
"card_bg_color":
self.rgba_from_argb(light_theme.primary, "0.05"),
"card_fg_color":
self.rgba_from_argb(light_theme.onSecondaryContainer),
"card_shade_color": self.rgba_from_argb(light_theme.shadow),
"dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer),
"dialog_bg_color":
self.rgba_from_argb(light_theme.secondaryContainer),
"dialog_fg_color": self.rgba_from_argb(
light_theme.onSecondaryContainer
),
"popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer),
"popover_bg_color":
self.rgba_from_argb(light_theme.secondaryContainer),
"popover_fg_color": self.rgba_from_argb(
light_theme.onSecondaryContainer
),
"shade_color": self.rgba_from_argb(light_theme.shadow),
"scrollbar_outline_color": self.rgba_from_argb(light_theme.outline),
"scrollbar_outline_color":
self.rgba_from_argb(light_theme.outline),
}
for key in variable:
@ -585,7 +613,8 @@ class GradienceApplication(Adw.Application):
dialog = GradienceAppTypeDialog(
_("Apply this color scheme?"),
_(
"Warning: any custom CSS files for those app types will be irreversibly overwritten!"
"Warning: any custom CSS files for those app types will be \
irreversibly overwritten!"
),
"apply",
_("Apply"),
@ -625,7 +654,8 @@ class GradienceApplication(Adw.Application):
transient_for=self.props.active_window,
heading=_("Save preset as..."),
body=_(
"Saving preset to <tt>{0}</tt>. If that preset already exists, it will be overwritten!"
"Saving preset to <tt>{0}</tt>. If that preset already \
exists, it will be overwritten!"
).format(
os.path.join(
os.environ.get("XDG_CONFIG_HOME",
@ -652,7 +682,8 @@ class GradienceApplication(Adw.Application):
if len(preset_entry.get_text()) == 0:
dialog.set_body(
_(
"Saving preset to <tt>{0}</tt>. If that preset already exists, it will be overwritten!"
"Saving preset to <tt>{0}</tt>. If that preset \
already exists, it will be overwritten!"
).format(
os.path.join(
os.environ.get(
@ -668,7 +699,8 @@ class GradienceApplication(Adw.Application):
else:
dialog.set_body(
_(
"Saving preset to <tt>{0}</tt>. If that preset already exists, it will be overwritten!"
"Saving preset to <tt>{0}</tt>. If that preset \
already exists, it will be overwritten!"
).format(
os.path.join(
os.environ.get(
@ -695,7 +727,8 @@ class GradienceApplication(Adw.Application):
transient_for=self.props.active_window,
heading=_("You have unsaved changes!"),
body=_(
"Saving preset to <tt>{0}</tt>. If that preset already exists, it will be overwritten!"
"Saving preset to <tt>{0}</tt>. If that preset already \
exists, it will be overwritten!"
).format(
os.path.join(
os.environ.get("XDG_CONFIG_HOME",
@ -725,7 +758,8 @@ class GradienceApplication(Adw.Application):
if len(preset_entry.get_text()) == 0:
dialog.set_body(
_(
"Saving preset to <tt>{0}</tt>. If that preset already exists, it will be overwritten!"
"Saving preset to <tt>{0}</tt>. If that preset \
already exists, it will be overwritten!"
).format(
os.path.join(
os.environ.get(
@ -741,7 +775,8 @@ class GradienceApplication(Adw.Application):
else:
dialog.set_body(
_(
"Saving preset to <tt>{0}</tt>. If that preset already exists, it will be overwritten!"
"Saving preset to <tt>{0}</tt>. If that preset \
already exists, it will be overwritten!"
).format(
os.path.join(
os.environ.get(
@ -794,12 +829,16 @@ class GradienceApplication(Adw.Application):
pass
else:
with open(
os.path.join(gtk4_dir, "gtk.css.bak"), "w", encoding="utf-8"
os.path.join(gtk4_dir, "gtk.css.bak"),
"w",
encoding="utf-8"
) as file:
file.write(contents)
finally:
with open(
os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8"
os.path.join(gtk4_dir, "gtk.css"),
"w",
encoding="utf-8"
) as file:
file.write(gtk4_css)
@ -815,19 +854,25 @@ class GradienceApplication(Adw.Application):
contents = ""
try:
with open(
os.path.join(gtk3_dir, "gtk.css"), "r", encoding="utf-8"
os.path.join(gtk3_dir, "gtk.css"),
"r",
encoding="utf-8"
) as file:
contents = file.read()
except FileNotFoundError: # first run
pass
else:
with open(
os.path.join(gtk3_dir, "gtk.css.bak"), "w", encoding="utf-8"
os.path.join(gtk3_dir, "gtk.css.bak"),
"w",
encoding="utf-8"
) as file:
file.write(contents)
finally:
with open(
os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8"
os.path.join(gtk3_dir, "gtk.css"),
"w",
encoding="utf-8"
) as file:
file.write(gtk3_css)
@ -934,9 +979,9 @@ class GradienceApplication(Adw.Application):
],
artists=["David Lapshin https://github.com/daudix-UFO"],
designers=["David Lapshin https://github.com/daudix-UFO"],
# Translators: This is a place to put your credits (formats: "Name
# https://example.com" or "Name <email@example.com>", no quotes)
# and is not meant to be translated literally.
# Translators: This is a place to put your credits (formats:
# "Name https://example.com" or "Name <email@example.com>",
# no quotes) and is not meant to be translated literally.
# TODO: Automate this process using CI, because not everyone knows
# about this
translator_credits="""Maxime V https://www.transifex.com/user/profile/Adaoh/
@ -957,26 +1002,32 @@ class GradienceApplication(Adw.Application):
release_notes=_(
"""
<ul>
<li>Add AdwViewSwitcher in the header bar.</li>
<li>Move CSS to the "Advanced" tab</li>
<li>Move the rest to the "Colours" tab</li>
<li>Add Monet tab which generates a theme from a background</li>
<li>Add disk saved and disk unsaved icon in the header bar</li>
<li>Update about dialog</li>
<li>Change license to GNU GPLv3</li>
<li>Begin plugin support</li>
<li>Move preset selector to a drop-down called palette (icon palette)</li>
<li>Add ability to apply the theme onlyfor dark theme or oy for light theme</li>
<li>Automaticly use Adwaita-dark preset if the user prefered scheme is dark.</li>
<li>Added Flatpak CI build</li>
<li>Added issue template for bug and feature request </li>
<li>`Main` branch is now protected by GitHub branch protection. The development is done on `next` branch </li>
</ul>
"""
<li>Add AdwViewSwitcher in the header bar.</li>
<li>Move CSS to the "Advanced" tab</li>
<li>Move the rest to the "Colours" tab</li>
<li>Add Monet tab which generates a theme from a background
</li>
<li>Add disk saved and disk unsaved icon in the header bar</li>
<li>Update about dialog</li>
<li>Change license to GNU GPLv3</li>
<li>Begin plugin support</li>
<li>Move preset selector to a drop-down called palette (icon \
palette)</li>
<li>Add ability to apply the theme onlyfor dark theme or oy \
for light theme</li>
<li>Automaticly use Adwaita-dark preset if the user prefered \
scheme is dark.</li>
<li>Added Flatpak CI build</li>
<li>Added issue template for bug and feature request </li>
<li>`Main` branch is now protected by GitHub branch \
protection. The development is done on `next` branch </li>
</ul>
"""
),
comments=_(
"""
Gradience is a tool for customizing Libadwaita applications and the adw-gtk3 theme.
Gradience is a tool for customizing Libadwaita applications and the adw-gtk3 \
theme.
With Gradience you can:
- Change any color of Adwaita theme

View file

@ -58,7 +58,13 @@ def get_user_flatpak_path():
return GLib.build_filenamev([userDataDir, "flatpak"])
def user_save_keyfile(toast_overlay, settings, user_keyfile, filename, gtk_ver):
def user_save_keyfile(
toast_overlay,
settings,
user_keyfile,
filename,
gtk_ver
):
try:
user_keyfile.save_to_file(filename)
except GLib.GError as e:
@ -77,7 +83,13 @@ def user_save_keyfile(toast_overlay, settings, user_keyfile, filename, gtk_ver):
)
def global_save_keyfile(toast_overlay, settings, global_keyfile, filename, gtk_ver):
def global_save_keyfile(
toast_overlay,
settings,
global_keyfile,
filename,
gtk_ver
):
try:
global_keyfile.save_to_file(filename)
except GLib.GError as e:

View file

@ -22,7 +22,14 @@ class Preset:
name = "new_preset"
badges = {}
def __init__(self, name=None, repo=None, preset_path=None, text=None, preset=None):
def __init__(
self,
name=None,
repo=None,
preset_path=None,
text=None,
preset=None
):
if text: # load from ressource
self.load_preset(text=text)
elif preset: # css or dict

View file

@ -34,7 +34,13 @@ class GradienceOption(Adw.ActionRow):
explanation_button = Gtk.Template.Child("explanation-button")
explanation_label = Gtk.Template.Child("explanation-label")
def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs):
def __init__(self,
name,
title,
explanation,
adw_gtk3_support="yes",
**kwargs
):
super().__init__(**kwargs)
self.set_name(name)
@ -46,7 +52,8 @@ class GradienceOption(Adw.ActionRow):
elif adw_gtk3_support == "partial":
self.warning_button.add_css_class("warning")
self.warning_label.set_label(
_("This option is only partially supported by the adw-gtk3 theme.")
_("This option is only partially supported by the adw-gtk3 \
theme.")
)
elif adw_gtk3_support == "no":
self.warning_button.add_css_class("error")

View file

@ -59,9 +59,8 @@ class GradiencePaletteShades(Adw.ActionRow):
Gtk.Application.get_default().is_ready
and kwargs.get("update_from") == "color_value"
):
Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[
str(i)
]
Gtk.Application.get_default().palette[self.prefix][str(i)] = \
shades[str(i)]
if (
Gtk.Application.get_default().is_ready

View file

@ -94,7 +94,8 @@ class GradiencePluginsList:
group.set_title(_("Plugins"))
group.set_description(
_(
"Plugins add additional features to Gradience, plugins are made by Gradience community and can make issues."
"Plugins add additional features to Gradience, plugins are \
made by Gradience community and can make issues."
)
)
empty = True
@ -112,7 +113,8 @@ class GradiencePluginsList:
def save(self):
saved = {}
for pluginInfo in self.pm.getAllPlugins():
saved[pluginInfo.plugin_object.plugin_id] = pluginInfo.plugin_object.save()
saved[pluginInfo.plugin_object.plugin_id] = \
pluginInfo.plugin_object.save()
return saved
def validate(self):

View file

@ -117,7 +117,10 @@ class GradiencePresetRow(Adw.ExpanderRow):
self.delete_toast = Adw.Toast(title=_("Preset removed"))
self.delete_toast.set_button_label(_("Undo"))
self.delete_toast.connect("dismissed", self.on_delete_toast_dismissed)
self.delete_toast.connect("button-clicked", self.on_undo_button_clicked)
self.delete_toast.connect(
"button-clicked",
self.on_undo_button_clicked
)
self.toast_overlay.add_toast(self.delete_toast)

View file

@ -62,10 +62,10 @@ class GradiencePresetWindow(Adw.Window):
custom_presets = {}
official_repositories = {
_(
"Official"
): "https://github.com/GradienceTeam/Community/raw/next/official.json",
_("Curated"): "https://github.com/GradienceTeam/Community/raw/next/curated.json"
_("Official"):
"https://github.com/GradienceTeam/Community/raw/next/official.json",
_("Curated"):
"https://github.com/GradienceTeam/Community/raw/next/curated.json"
}
search_results_list = []
@ -291,7 +291,8 @@ class GradiencePresetWindow(Adw.Window):
Adw.Toast(title=_("Preset imported")))
else:
self.toast_overlay.add_toast(
Adw.Toast(title=_("Unsupported file format, must be .json"))
Adw.Toast(title=_("Unsupported file format, must be \
.json"))
)
self.reload_pref_group()
@ -329,9 +330,8 @@ class GradiencePresetWindow(Adw.Window):
raise KeyError("variables")
if preset.get("palette") is None:
raise KeyError("palette")
presets_list[file_name.replace(".json", "")] = preset[
"name"
]
presets_list[file_name.replace(".json", "")] = \
preset["name"]
except Exception:
self.toast_overlay.add_toast(
Adw.Toast(title=_("Failed to load preset"))
@ -356,9 +356,8 @@ class GradiencePresetWindow(Adw.Window):
raise KeyError("variables")
if preset.get("palette") is None:
raise KeyError("palette")
presets_list["user"][file_name.replace(".json", "")] = preset[
"name"
]
presets_list["user"][file_name.replace(".json", "")] \
= preset["name"]
except Exception:
self.toast_overlay.add_toast(
Adw.Toast(title=_("Failed to load preset"))
@ -380,7 +379,9 @@ class GradiencePresetWindow(Adw.Window):
self.preset_list.set_title(_("User Presets"))
self.preset_list.set_description(
_(
'See <a href="https://github.com/GradienceTeam/Community">GradienceTeam/Community</a> on Github for more presets'
'See \
<a href="https://github.com/GradienceTeam/Community">GradienceTeam/Community</a> \
on Github for more presets'
)
)
@ -405,7 +406,8 @@ class GradiencePresetWindow(Adw.Window):
self.preset_empty = Adw.ActionRow()
self.preset_empty.set_title(
_(
"No preset found! Use the import button to import one or search one on the Explore tab"
"No preset found! Use the import button to import one or \
search one on the Explore tab"
)
)
self.preset_list.add(self.preset_empty)

View file

@ -18,7 +18,13 @@
class GradienceSetting:
def __init__(self, name, title, value_type, explanation=None, default_value=None):
def __init__(self,
name,
title,
value_type,
explanation=None,
default_value=None
):
# TODO supported types:
# text
# integer

View file

@ -22,14 +22,19 @@ settings_schema = {
"name": "accent_colors",
"title": _("Accent Colors"),
"description": _(
"These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active."
"These colors are used across many different widgets, such as \
buttons, labels, and entries, to indicate that a widget is \
important, interactive, or currently active."
),
"variables": [
{
"name": "accent_color",
"title": _("Standalone Color"),
"explanation": _(
"The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."
"The standalone colors are similar to the background \
ones, but provide better contrast when used as \
foreground color on top of a neutral background - for \
example, colorful text in a window."
),
"adw_gtk3_support": "yes",
},
@ -49,14 +54,18 @@ settings_schema = {
"name": "destructive_colors",
"title": _("Destructive Colors"),
"description": _(
"These colors are used for buttons to indicate a dangerous action, such as deleting a file."
"These colors are used for buttons to indicate a dangerous \
action, such as deleting a file."
),
"variables": [
{
"name": "destructive_color",
"title": _("Standalone Color"),
"explanation": _(
"The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."
"The standalone colors are similar to the background \
ones, but provide better contrast when used as \
foreground color on top of a neutral background - for \
example, colorful text in a window."
),
"adw_gtk3_support": "yes",
},
@ -76,14 +85,19 @@ settings_schema = {
"name": "success_colors",
"title": _("Success Colors"),
"description": _(
"These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level."
"These colors are used across many different widgets, such as \
buttons, labels, entries, and level bars, to indicate a \
success or a high level."
),
"variables": [
{
"name": "success_color",
"title": _("Standalone Color"),
"explanation": _(
"The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."
"The standalone colors are similar to the background \
ones, but provide better contrast when used as \
foreground color on top of a neutral background - for \
example, colorful text in a window."
),
"adw_gtk3_support": "yes",
},
@ -103,14 +117,19 @@ settings_schema = {
"name": "warning_colors",
"title": _("Warning Colors"),
"description": _(
"These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level."
"These colors are used across many different widgets, such as \
buttons, labels, entries, and level bars, to indicate a \
warning or a low level."
),
"variables": [
{
"name": "warning_color",
"title": _("Standalone Color"),
"explanation": _(
"The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."
"The standalone colors are similar to the background \
ones, but provide better contrast when used as \
foreground color on top of a neutral background - for \
example, colorful text in a window."
),
"adw_gtk3_support": "yes",
},
@ -130,14 +149,18 @@ settings_schema = {
"name": "error_colors",
"title": _("Error Colors"),
"description": _(
"These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure."
"These colors are used across many different widgets, such as \
buttons, labels, and entries, to indicate a failure."
),
"variables": [
{
"name": "error_color",
"title": _("Standalone Color"),
"explanation": _(
"The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."
"The standalone colors are similar to the background \
ones, but provide better contrast when used as \
foreground color on top of a neutral background - for \
example, colorful text in a window."
),
"adw_gtk3_support": "yes",
},
@ -174,7 +197,8 @@ settings_schema = {
"name": "view_colors",
"title": _("View Colors"),
"description": _(
"These colors are used in a variety of widgets, such as text views and entries."
"These colors are used in a variety of widgets, such as text \
views and entries."
),
"variables": [
{
@ -193,7 +217,9 @@ settings_schema = {
"name": "headerbar_colors",
"title": _("Header Bar Colors"),
"description": _(
"These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars."
"These colors are used for header bars, as well as widgets \
that are meant to be visually attached to it, such as search \
bars or tab bars."
),
"variables": [
{
@ -210,7 +236,14 @@ settings_schema = {
"name": "headerbar_border_color",
"title": _("Border Color"),
"explanation": _(
"The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout."
"The border color has the same default value as a \
foreground color, but doesn't change along with it. \
This can be useful if a light window has a dark \
header bar with light text; in this case it may be \
desirable to keep the border dark. This variable is \
only used for vertical borders - for example, \
separators between the two header bars in a split \
header bar layout."
),
"adw_gtk3_support": "no",
},
@ -218,7 +251,12 @@ settings_schema = {
"name": "headerbar_backdrop_color",
"title": _("Backdrop Color"),
"explanation": _(
"The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color."
"The backdrop color is used instead of the background \
color when the window is not focused. By default it's \
an alias of the window's background color and changes \
together with it. When changing this variable, make \
sure to set it to a value matching your header bar \
background color."
),
"adw_gtk3_support": "yes",
},
@ -226,7 +264,9 @@ settings_schema = {
"name": "headerbar_shade_color",
"title": _("Shade Color"),
"explanation": _(
"The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window."
"The shade color is used to provide a dark border for \
header bars and similar widgets that separates them \
from the main window."
),
"adw_gtk3_support": "no",
},
@ -235,7 +275,8 @@ settings_schema = {
{
"name": "card_colors",
"title": _("Card Colors"),
"description": _("These colors are used for cards and boxed lists."),
"description": _("These colors are used for cards and boxed \
lists."),
"variables": [
{
"name": "card_bg_color",
@ -251,7 +292,9 @@ settings_schema = {
"name": "card_shade_color",
"title": _("Shade Color"),
"explanation": _(
"The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards."
"The shade color is used for shadows that are used by \
cards to separate themselves from the window \
background, as well as for row dividers in the cards."
),
"adw_gtk3_support": "no",
},
@ -300,7 +343,9 @@ settings_schema = {
"name": "shade_color",
"title": _("Shade Color"),
"explanation": _(
"The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders."
"The shade color is used by inline tab bars, as well \
as the transitions in leaflets and flaps, and info \
bar borders."
),
"adw_gtk3_support": "no",
},
@ -308,7 +353,9 @@ settings_schema = {
"name": "scrollbar_outline_color",
"title": _("Scrollbar Outline Color"),
"explanation": _(
"The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color."
"The scrollbar outline color is used by scrollbars to \
ensure that overlay scrollbars are visible regardless \
of the content color."
),
"adw_gtk3_support": "no",
},

View file

@ -142,7 +142,8 @@ class GradienceWelcomeWindow(Adw.Window):
self.btn_next.set_visible(True)
self.btn_install.set_visible(False)
if self.update:
self.window.last_opened_version = self.window.settings.set_string("last-opened-version", version)
self.window.last_opened_version = \
self.window.settings.set_string("last-opened-version", version)
self.btn_close.set_sensitive(True)
self.label_skip.set_visible(False)
self.next_page(index=5)

View file

@ -132,7 +132,8 @@ class GradienceMainWindow(Adw.ApplicationWindow):
self.monet_pref_group.set_title(_("Monet Engine"))
self.monet_pref_group.set_description(
_(
"Monet is an engine that generates a Material Design 3 palette from an image's color."
"Monet is an engine that generates a Material Design 3 \
palette from an image's color."
)
)
@ -268,7 +269,10 @@ class GradienceMainWindow(Adw.ApplicationWindow):
palette_pref_group.set_title(_("Palette Colors"))
palette_pref_group.set_description(
_(
'Named palette colors used by some applications. Default colors follow the <a href="https://developer.gnome.org/hig/reference/palette.html">GNOME Human Interface Guidelines</a>.'
'Named palette colors used by some applications. Default \
colors follow the \
<a href="https://developer.gnome.org/hig/reference/palette.html">\
GNOME Human Interface Guidelines</a>.'
)
)
for color in settings_schema["palette"]: