Philipp Hörist pushed to branch gtk4 at gajim / gajim
Commits:
e6e034a8 by Philipp Hörist at 2024-10-05T16:54:43+02:00
refactor: Fix all css errors
- - - - -
6 changed files:
- gajim/data/style/default.css
- gajim/data/style/gajim.css
- gajim/gtk/css_config.py
- gajim/gtk/notification.py
- gajim/gtk/preferences.py
- typings/css_parser/serialize.pyi
Changes:
=====================================
gajim/data/style/default.css
=====================================
@@ -25,7 +25,7 @@ .gajim-command-error {
}
.gajim-command-output {
background-color: rgb(10, 50, 70);
- color: rgb(170, 180, 200)
+ color: rgb(170, 180, 200);
}
.gajim-mention-highlight {
background: rgb(255, 215, 194);
@@ -67,8 +67,8 @@ .gajim-status-connecting {
color: rgb(77, 166, 255);
}
.gajim-single-emoji-msg {
- font-size: 36pt
+ font-size: 36pt;
}
.gajim-emoji-msg {
- font-size: 24pt
+ font-size: 24pt;
}
=====================================
gajim/data/style/gajim.css
=====================================
@@ -470,7 +470,7 @@ .chatlist-row:selected label:not(.unread-counter){
.chatlist-row button {
min-width: 25px;
min-height: 25px;
- padding: 0px
+ padding: 0px;
}
.chatlist-row:selected button {
color: @theme_fg_color;
@@ -557,7 +557,7 @@ .search-view-header label {
}
/* MessageActionsBox */
-.message-actions-box { margin: 2px 13px 8px 8px }
+.message-actions-box { margin: 2px 13px 8px 8px; }
.message-actions-box-button {
padding: 0px 5px 0px 5px;
background-color: @theme_base_color;
@@ -714,7 +714,6 @@ .preview-image-button:hover {
padding: 0px;
border: none;
transition: none;
- -gtk-icon-effect: none;
-gtk-icon-shadow: none;
background-image: none;
text-shadow: none;
=====================================
gajim/gtk/css_config.py
=====================================
@@ -69,6 +69,7 @@ def __init__(self) -> None:
# Delete empty rules
css_parser.ser.prefs.keepEmptyRules = False
+ css_parser.ser.prefs.omitLastSemicolon = False
# Holds the currently selected theme in the Theme Editor
self._pre_css: CSSStyleSheet | None = None
@@ -152,6 +153,8 @@ def set_dark_theme(self, value: int | None = None) -> None:
return
value = self._system_style.prefer_dark
settings.set_property('gtk-application-prefer-dark-theme', bool(value))
+
+ def reload_css(self) -> None:
self._load_css()
def _load_css(self) -> None:
@@ -640,7 +643,7 @@ def refresh(self) -> None:
for index, account in enumerate(accounts):
color = app.settings.get_account_setting(account, 'account_color')
css_class = f'gajim_class_{index}'
- css += f'.{css_class} {{ background-color: {color} }}\n'
+ css += f'.{css_class} {{ background-color: {color}; }}\n'
self._dynamic_dict[account] = css_class
self._dynamic_provider.load_from_bytes(GLib.Bytes.new(css.encode()))
=====================================
gajim/gtk/notification.py
=====================================
@@ -239,7 +239,7 @@ def _add_background_color(self, event: events.Notification)
-> None:
bg_color = app.css_config.get_value(css_class, StyleAttr.COLOR)
bar_class = '''
.popup-bar {
- background-color: %s
+ background-color: %s;
}''' % bg_color
add_css_to_widget(self._ui.color_bar, bar_class)
self._ui.color_bar.get_style_context().add_class('popup-bar')
=====================================
gajim/gtk/preferences.py
=====================================
@@ -701,6 +701,7 @@ def _on_theme_changed(value: str, *args: Any) -> None:
@staticmethod
def _on_dark_theme(value: str, *args: Any) -> None:
app.css_config.set_dark_theme(int(value))
+ app.css_config.reload_css()
app.ged.raise_event(StyleChanged())
=====================================
typings/css_parser/serialize.pyi
=====================================
@@ -8,3 +8,4 @@ class CSSSerializer:
class Preferences:
keepEmptyRules: bool
+ omitLastSemicolon: bool
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/e6e034a82dd2dd7d7a640e2c09dfd2c422e0dd1d
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/e6e034a82dd2dd7d7a640e2c09dfd2c422e0dd1d
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]