Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
-
2f0432c7
by wurstsalat at 2021-11-06T12:58:12+01:00
-
6ebafbe3
by wurstsalat at 2021-11-06T16:15:33+01:00
-
5b235d5d
by wurstsalat at 2021-11-06T16:17:21+01:00
-
ab2c4fdb
by wurstsalat at 2021-11-06T16:42:41+01:00
-
70d22e52
by wurstsalat at 2021-11-06T17:02:06+01:00
-
d4397d84
by wurstsalat at 2021-11-06T17:02:09+01:00
-
db1de367
by wurstsalat at 2021-11-06T17:02:09+01:00
-
2f38e1d9
by wurstsalat at 2021-11-06T17:04:07+01:00
-
c21880dd
by wurstsalat at 2021-11-06T17:06:55+01:00
10 changed files:
- gajim/data/style/default-dark.css
- gajim/data/style/default.css
- gajim/gajim.py
- gajim/gtk/controls/base.py
- gajim/gtk/conversation/message_widget.py
- gajim/gtk/conversation/plain_widget.py
- gajim/gtk/conversation/rows/base.py
- gajim/gtk/conversation/rows/message.py
- gajim/gtk/message_input.py
- gajim/gtk/themes.py
Changes:
| ... | ... | @@ -5,8 +5,8 @@ .gajim-incoming-nickname { |
| 5 | 5 |
.gajim-outgoing-nickname {
|
| 6 | 6 |
color: rgb(40, 140, 210);
|
| 7 | 7 |
}
|
| 8 |
-.gajim-outgoing-message-text {
|
|
| 9 |
- color: rgb(200, 200, 200);
|
|
| 8 |
+.gajim-conversation-text text {
|
|
| 9 |
+ color: inherit;
|
|
| 10 | 10 |
}
|
| 11 | 11 |
.gajim-status-message {
|
| 12 | 12 |
color: rgb(140, 175, 210);
|
| ... | ... | @@ -25,36 +25,12 @@ .gajim-mention-highlight { |
| 25 | 25 |
.gajim-url {
|
| 26 | 26 |
color: rgb(60, 135, 220);
|
| 27 | 27 |
}
|
| 28 |
-.gajim-state-tab-muc-directed-msg {
|
|
| 29 |
- color: rgb(210, 70, 30);
|
|
| 30 |
-}
|
|
| 31 |
-.gajim-state-tab-muc-msg {
|
|
| 32 |
- color: rgb(80, 95, 230);
|
|
| 33 |
-}
|
|
| 34 | 28 |
.gajim-user-disconnected {
|
| 35 | 29 |
color: rgb(230, 170, 170);
|
| 36 | 30 |
}
|
| 37 | 31 |
.gajim-user-connected {
|
| 38 | 32 |
color: rgb(160, 200, 170);
|
| 39 | 33 |
}
|
| 40 |
-.gajim-roster-disconnected {
|
|
| 41 |
- background: rgb(80, 30, 30);
|
|
| 42 |
-}
|
|
| 43 |
-.gajim-roster-connected {
|
|
| 44 |
- background: rgb(30, 80, 50);
|
|
| 45 |
-}
|
|
| 46 |
-.gajim-state-composing {
|
|
| 47 |
- color: rgb(90, 180, 90);
|
|
| 48 |
-}
|
|
| 49 |
-.gajim-state-inactive {
|
|
| 50 |
- color: rgb(158, 158, 158);
|
|
| 51 |
-}
|
|
| 52 |
-.gajim-state-gone {
|
|
| 53 |
- color: rgb(128, 128, 128);
|
|
| 54 |
-}
|
|
| 55 |
-.gajim-state-paused {
|
|
| 56 |
- color: rgb(20, 210, 160);
|
|
| 57 |
-}
|
|
| 58 | 34 |
.gajim-msg-correcting text {
|
| 59 | 35 |
background: rgb(100, 100, 50);
|
| 60 | 36 |
}
|
| ... | ... | @@ -5,8 +5,8 @@ .gajim-incoming-nickname { |
| 5 | 5 |
.gajim-outgoing-nickname {
|
| 6 | 6 |
color: rgb(50, 90, 140);
|
| 7 | 7 |
}
|
| 8 |
-.gajim-outgoing-message-text {
|
|
| 9 |
- color: rgb(85, 85, 85);
|
|
| 8 |
+.gajim-conversation-text text {
|
|
| 9 |
+ color: inherit;
|
|
| 10 | 10 |
}
|
| 11 | 11 |
.gajim-status-message {
|
| 12 | 12 |
color: rgb(100, 130, 160);
|
| ... | ... | @@ -33,36 +33,12 @@ .gajim-mention-highlight { |
| 33 | 33 |
.gajim-url {
|
| 34 | 34 |
color: rgb(30, 75, 135);
|
| 35 | 35 |
}
|
| 36 |
-.gajim-state-tab-muc-directed-msg {
|
|
| 37 |
- color: rgb(210, 70, 30);
|
|
| 38 |
-}
|
|
| 39 |
-.gajim-state-tab-muc-msg {
|
|
| 40 |
- color: rgb(40, 40, 200);
|
|
| 41 |
-}
|
|
| 42 | 36 |
.gajim-user-disconnected {
|
| 43 | 37 |
color: rgb(230, 170, 170);
|
| 44 | 38 |
}
|
| 45 | 39 |
.gajim-user-connected {
|
| 46 | 40 |
color: rgb(160, 200, 170);
|
| 47 | 41 |
}
|
| 48 |
-.gajim-roster-disconnected {
|
|
| 49 |
- background: rgb(230, 170, 170);
|
|
| 50 |
-}
|
|
| 51 |
-.gajim-roster-connected {
|
|
| 52 |
- background: rgb(160, 200, 170);
|
|
| 53 |
-}
|
|
| 54 |
-.gajim-state-composing {
|
|
| 55 |
- color: rgb(40, 140, 40);
|
|
| 56 |
-}
|
|
| 57 |
-.gajim-state-inactive {
|
|
| 58 |
- color: rgb(158, 158, 158);
|
|
| 59 |
-}
|
|
| 60 |
-.gajim-state-gone {
|
|
| 61 |
- color: rgb(128, 128, 128);
|
|
| 62 |
-}
|
|
| 63 |
-.gajim-state-paused {
|
|
| 64 |
- color: rgb(20, 160, 120);
|
|
| 65 |
-}
|
|
| 66 | 42 |
.gajim-msg-correcting text {
|
| 67 | 43 |
background: rgb(240, 230, 170);
|
| 68 | 44 |
}
|
| ... | ... | @@ -115,7 +115,7 @@ def _init_gtk(): |
| 115 | 115 |
def _run_app():
|
| 116 | 116 |
from gajim.application import GajimApplication
|
| 117 | 117 |
application = GajimApplication()
|
| 118 |
- _install_sginal_handlers(application)
|
|
| 118 |
+ _install_signal_handlers(application)
|
|
| 119 | 119 |
application.run(sys.argv)
|
| 120 | 120 |
|
| 121 | 121 |
|
| ... | ... | @@ -137,9 +137,9 @@ def _set_proc_title(): |
| 137 | 137 |
libc.setproctitle('gajim')
|
| 138 | 138 |
|
| 139 | 139 |
|
| 140 |
-def _install_sginal_handlers(application):
|
|
| 140 |
+def _install_signal_handlers(application):
|
|
| 141 | 141 |
def sigint_cb(num, stack):
|
| 142 |
- print('SIGINT/SIGTERM received')
|
|
| 142 |
+ print(' SIGINT/SIGTERM received')
|
|
| 143 | 143 |
application.quit()
|
| 144 | 144 |
# ^C exits the application normally
|
| 145 | 145 |
signal.signal(signal.SIGINT, sigint_cb)
|
| ... | ... | @@ -1250,9 +1250,9 @@ def on_clear_formatting_menuitem_activate(self, _widget): |
| 1250 | 1250 |
self.msg_textview.clear_tags()
|
| 1251 | 1251 |
|
| 1252 | 1252 |
def _style_changed(self, *args):
|
| 1253 |
- self.update_tags()
|
|
| 1253 |
+ self.update_text_tags()
|
|
| 1254 | 1254 |
|
| 1255 |
- def update_tags(self):
|
|
| 1255 |
+ def update_text_tags(self):
|
|
| 1256 | 1256 |
self.conversation_view.update_text_tags()
|
| 1257 | 1257 |
|
| 1258 | 1258 |
@staticmethod
|
| ... | ... | @@ -61,3 +61,8 @@ def add_content(self, content): |
| 61 | 61 |
|
| 62 | 62 |
def clear(self):
|
| 63 | 63 |
self.foreach(self.remove)
|
| 64 |
+ |
|
| 65 |
+ def update_text_tags(self, *args):
|
|
| 66 |
+ for widget in self.get_children():
|
|
| 67 |
+ if not isinstance(widget, CodeWidget):
|
|
| 68 |
+ widget.update_text_tags()
|
| ... | ... | @@ -15,7 +15,6 @@ |
| 15 | 15 |
import logging
|
| 16 | 16 |
from urllib.parse import quote
|
| 17 | 17 |
|
| 18 |
-from gi.repository import GObject
|
|
| 19 | 18 |
from gi.repository import Gtk
|
| 20 | 19 |
from gi.repository import Pango
|
| 21 | 20 |
from gi.repository import Gdk
|
| ... | ... | @@ -55,6 +54,9 @@ def __init__(self, account, selectable): |
| 55 | 54 |
def add_content(self, block):
|
| 56 | 55 |
self._text_widget.print_text_with_styling(block)
|
| 57 | 56 |
|
| 57 |
+ def update_text_tags(self):
|
|
| 58 |
+ self._text_widget.update_text_tags()
|
|
| 59 |
+ |
|
| 58 | 60 |
|
| 59 | 61 |
class MessageLabel(Gtk.Label):
|
| 60 | 62 |
def __init__(self, account, selectable):
|
| ... | ... | @@ -68,6 +70,8 @@ def __init__(self, account, selectable): |
| 68 | 70 |
|
| 69 | 71 |
self._account = account
|
| 70 | 72 |
|
| 73 |
+ self.get_style_context().add_class('gajim-conversation-text')
|
|
| 74 |
+ |
|
| 71 | 75 |
def print_text_with_styling(self, block):
|
| 72 | 76 |
text = GLib.markup_escape_text(block.text.strip())
|
| 73 | 77 |
for uri in block.uris:
|
| ... | ... | @@ -81,17 +85,11 @@ def print_text_with_styling(self, block): |
| 81 | 85 |
self.set_markup(text)
|
| 82 | 86 |
self.set_attributes(attr_list)
|
| 83 | 87 |
|
| 88 |
+ def update_text_tags(self):
|
|
| 89 |
+ pass
|
|
| 84 | 90 |
|
| 85 |
-class MessageTextview(Gtk.TextView):
|
|
| 86 |
- |
|
| 87 |
- __gsignals__ = {
|
|
| 88 |
- 'quote': (
|
|
| 89 |
- GObject.SignalFlags.RUN_LAST | GObject.SignalFlags.ACTION,
|
|
| 90 |
- None,
|
|
| 91 |
- (str, )
|
|
| 92 |
- ),
|
|
| 93 |
- }
|
|
| 94 | 91 |
|
| 92 |
+class MessageTextview(Gtk.TextView):
|
|
| 95 | 93 |
def __init__(self, account):
|
| 96 | 94 |
Gtk.TextView.__init__(self)
|
| 97 | 95 |
self.set_hexpand(True)
|
| ... | ... | @@ -122,7 +120,7 @@ def __init__(self, account): |
| 122 | 120 |
# Keeps text selections for quoting and search actions
|
| 123 | 121 |
self._selected_text = ''
|
| 124 | 122 |
|
| 125 |
- self.get_style_context().add_class('gajim-conversation-font')
|
|
| 123 |
+ self.get_style_context().add_class('gajim-conversation-text')
|
|
| 126 | 124 |
|
| 127 | 125 |
# Create Tags
|
| 128 | 126 |
self._create_url_tags()
|
| ... | ... | @@ -147,12 +145,11 @@ def _create_url_tags(self): |
| 147 | 145 |
underline=Pango.Underline.SINGLE)
|
| 148 | 146 |
tag.connect('event', self._on_uri_clicked, tag)
|
| 149 | 147 |
|
| 150 |
- def update_tags(self):
|
|
| 148 |
+ def update_text_tags(self):
|
|
| 151 | 149 |
tag_table = self.get_buffer().get_tag_table()
|
| 152 |
- color = app.css_config.get_value('.gajim-url', StyleAttr.COLOR)
|
|
| 153 |
- |
|
| 150 |
+ url_color = app.css_config.get_value('.gajim-url', StyleAttr.COLOR)
|
|
| 154 | 151 |
for tag in URI_TAGS:
|
| 155 |
- tag_table.lookup(tag).set_property('foreground', color)
|
|
| 152 |
+ tag_table.lookup(tag).set_property('foreground', url_color)
|
|
| 156 | 153 |
|
| 157 | 154 |
def clear(self):
|
| 158 | 155 |
buffer_ = self.get_buffer()
|
| ... | ... | @@ -229,8 +226,7 @@ def _on_button_press(self, _widget, event): |
| 229 | 226 |
if tags:
|
| 230 | 227 |
# A tagged text fragment has been clicked
|
| 231 | 228 |
for tag in tags:
|
| 232 |
- tag_name = tag.get_property('name')
|
|
| 233 |
- if tag_name in URI_TAGS:
|
|
| 229 |
+ if tag.get_property('name') in URI_TAGS:
|
|
| 234 | 230 |
# Block regular context menu
|
| 235 | 231 |
return True
|
| 236 | 232 |
|
| ... | ... | @@ -353,6 +349,7 @@ def _on_uri_clicked(self, texttag, _widget, event, iter_, _kind): |
| 353 | 349 |
self._show_context_menu(uri)
|
| 354 | 350 |
return Gdk.EVENT_STOP
|
| 355 | 351 |
|
| 352 |
+ # TODO:
|
|
| 356 | 353 |
# self.plugin_modified = False
|
| 357 | 354 |
# app.plugin_manager.extension_point(
|
| 358 | 355 |
# 'hyperlink_handler', uri, self, self.get_toplevel())
|
| ... | ... | @@ -14,7 +14,6 @@ |
| 14 | 14 |
|
| 15 | 15 |
from datetime import datetime
|
| 16 | 16 |
|
| 17 |
-from gi.repository import Gdk
|
|
| 18 | 17 |
from gi.repository import GLib
|
| 19 | 18 |
from gi.repository import Gtk
|
| 20 | 19 |
from gi.repository import Pango
|
| ... | ... | @@ -23,8 +22,6 @@ |
| 23 | 22 |
from gajim.common.i18n import _
|
| 24 | 23 |
from gajim.common.helpers import from_one_line
|
| 25 | 24 |
|
| 26 |
-from ...util import convert_rgba_to_hex
|
|
| 27 |
-from ...util import text_to_color
|
|
| 28 | 25 |
from ...util import wrap_with_event_box
|
| 29 | 26 |
|
| 30 | 27 |
|
| ... | ... | @@ -59,10 +56,7 @@ def is_merged(self): |
| 59 | 56 |
return self._merged
|
| 60 | 57 |
|
| 61 | 58 |
def update_text_tags(self):
|
| 62 |
- return
|
|
| 63 |
- # TODO
|
|
| 64 |
- if self.textview is not None:
|
|
| 65 |
- self.textview.update_text_tags()
|
|
| 59 |
+ pass
|
|
| 66 | 60 |
|
| 67 | 61 |
@staticmethod
|
| 68 | 62 |
def create_timestamp_widget(timestamp: datetime) -> Gtk.Label:
|
| ... | ... | @@ -171,13 +171,15 @@ def __init__(self, |
| 171 | 171 |
|
| 172 | 172 |
self.show_all()
|
| 173 | 173 |
|
| 174 |
+ def update_text_tags(self):
|
|
| 175 |
+ self._message_widget.update_text_tags()
|
|
| 176 |
+ |
|
| 174 | 177 |
def _check_for_highlight(self, content):
|
| 175 | 178 |
needs_highlight = message_needs_highlight(
|
| 176 | 179 |
content.text,
|
| 177 | 180 |
self._contact.nickname,
|
| 178 | 181 |
self._client.get_own_jid().bare)
|
| 179 | 182 |
if needs_highlight:
|
| 180 |
- # TODO: add class to textview text (if message widget is TextView)
|
|
| 181 | 183 |
self.get_style_context().add_class(
|
| 182 | 184 |
'gajim-mention-highlight')
|
| 183 | 185 |
|
| ... | ... | @@ -258,10 +260,10 @@ def _get_encryption_image(self, additional_data, encryption_enabled=None): |
| 258 | 260 |
color = 'encrypted-color'
|
| 259 | 261 |
else:
|
| 260 | 262 |
icon, trust_tooltip, color = TRUST_SYMBOL_DATA[trust]
|
| 261 |
- tooltip = '%s\n%s' % (tooltip, trust_tooltip)
|
|
| 263 |
+ tooltip = f'{tooltip}\n{trust_tooltip}'
|
|
| 262 | 264 |
if fingerprint is not None:
|
| 263 | 265 |
fingerprint = format_fingerprint(fingerprint)
|
| 264 |
- tooltip = '%s\n<tt>%s</tt>' % (tooltip, fingerprint)
|
|
| 266 |
+ tooltip = f'{tooltip}\n<tt>{fingerprint}</tt>'
|
|
| 265 | 267 |
|
| 266 | 268 |
image = Gtk.Image.new_from_icon_name(icon, Gtk.IconSize.MENU)
|
| 267 | 269 |
image.set_tooltip_markup(tooltip)
|
| ... | ... | @@ -279,9 +281,6 @@ def _get_encryption_details(additional_data): |
| 279 | 281 |
trust = additional_data.get_value('encrypted', 'trust')
|
| 280 | 282 |
return name, fingerprint, trust
|
| 281 | 283 |
|
| 282 |
- def _on_quote_selection(self, _widget, text):
|
|
| 283 |
- self.get_parent().on_quote(text)
|
|
| 284 |
- |
|
| 285 | 284 |
@property
|
| 286 | 285 |
def has_receipt(self):
|
| 287 | 286 |
return self._has_receipt
|
| ... | ... | @@ -53,7 +53,7 @@ def __init__(self): |
| 53 | 53 |
self.set_right_margin(2)
|
| 54 | 54 |
self.set_pixels_above_lines(2)
|
| 55 | 55 |
self.set_pixels_below_lines(2)
|
| 56 |
- self.get_style_context().add_class('gajim-conversation-font')
|
|
| 56 |
+ self.get_style_context().add_class('gajim-conversation-text')
|
|
| 57 | 57 |
|
| 58 | 58 |
self.drag_dest_unset()
|
| 59 | 59 |
|
| ... | ... | @@ -34,143 +34,91 @@ |
| 34 | 34 |
StyleOption = namedtuple('StyleOption', 'label selector attr')
|
| 35 | 35 |
|
| 36 | 36 |
CSS_STYLE_OPTIONS = [
|
| 37 |
- StyleOption(_('Chatstate Composing'),
|
|
| 38 |
- '.gajim-state-composing',
|
|
| 39 |
- StyleAttr.COLOR),
|
|
| 37 |
+ StyleOption(_('Conversation: Text Font'),
|
|
| 38 |
+ '.gajim-conversation-text',
|
|
| 39 |
+ StyleAttr.FONT),
|
|
| 40 | 40 |
|
| 41 |
- StyleOption(_('Chatstate Inactive'),
|
|
| 42 |
- '.gajim-state-inactive',
|
|
| 41 |
+ StyleOption(_('Conversation: Text Color'),
|
|
| 42 |
+ '.gajim-conversation-text',
|
|
| 43 | 43 |
StyleAttr.COLOR),
|
| 44 | 44 |
|
| 45 |
- StyleOption(_('Chatstate Gone'),
|
|
| 46 |
- '.gajim-state-gone',
|
|
| 45 |
+ StyleOption(_('Conversation: URL Color'),
|
|
| 46 |
+ '.gajim-url',
|
|
| 47 | 47 |
StyleAttr.COLOR),
|
| 48 | 48 |
|
| 49 |
- StyleOption(_('Chatstate Paused'),
|
|
| 50 |
- '.gajim-state-paused',
|
|
| 49 |
+ StyleOption(_('Conversation: Nickname Color (Incoming)'),
|
|
| 50 |
+ '.gajim-incoming-nickname',
|
|
| 51 | 51 |
StyleAttr.COLOR),
|
| 52 | 52 |
|
| 53 |
- StyleOption(_('Group Chat Tab New Directed Message'),
|
|
| 54 |
- '.gajim-state-tab-muc-directed-msg',
|
|
| 53 |
+ StyleOption(_('Conversation: Nickname Color (Outgoing)'),
|
|
| 54 |
+ '.gajim-outgoing-nickname',
|
|
| 55 | 55 |
StyleAttr.COLOR),
|
| 56 | 56 |
|
| 57 |
- StyleOption(_('Group Chat Tab New Message'),
|
|
| 58 |
- '.gajim-state-tab-muc-msg',
|
|
| 59 |
- StyleAttr.COLOR),
|
|
| 57 |
+ StyleOption(_('Mention: Message Background Color'),
|
|
| 58 |
+ '.gajim-mention-highlight',
|
|
| 59 |
+ StyleAttr.BACKGROUND),
|
|
| 60 | 60 |
|
| 61 |
- StyleOption(_('Banner Foreground Color'),
|
|
| 62 |
- '.gajim-banner',
|
|
| 61 |
+ StyleOption(_('Status Message: Text Color'),
|
|
| 62 |
+ '.gajim-status-message',
|
|
| 63 | 63 |
StyleAttr.COLOR),
|
| 64 | 64 |
|
| 65 |
- StyleOption(_('Banner Background Color'),
|
|
| 66 |
- '.gajim-banner',
|
|
| 65 |
+ StyleOption(_('Status Message: Text Font'),
|
|
| 66 |
+ '.gajim-status-message',
|
|
| 67 |
+ StyleAttr.FONT),
|
|
| 68 |
+ |
|
| 69 |
+ StyleOption(_('Message Correction: Background Color'),
|
|
| 70 |
+ '.gajim-msg-correcting text',
|
|
| 67 | 71 |
StyleAttr.BACKGROUND),
|
| 68 | 72 |
|
| 69 |
- StyleOption(_('Banner Font'),
|
|
| 73 |
+ StyleOption(_('Chat Banner: Foreground Color'),
|
|
| 70 | 74 |
'.gajim-banner',
|
| 71 |
- StyleAttr.FONT),
|
|
| 72 |
- |
|
| 73 |
- StyleOption(_('Account Row Foreground Color'),
|
|
| 74 |
- '.gajim-account-row',
|
|
| 75 | 75 |
StyleAttr.COLOR),
|
| 76 | 76 |
|
| 77 |
- StyleOption(_('Account Row Background Color'),
|
|
| 78 |
- '.gajim-account-row',
|
|
| 77 |
+ StyleOption(_('Chat Banner: Background Color'),
|
|
| 78 |
+ '.gajim-banner',
|
|
| 79 | 79 |
StyleAttr.BACKGROUND),
|
| 80 | 80 |
|
| 81 |
- StyleOption(_('Account Row Font'),
|
|
| 82 |
- '.gajim-account-row',
|
|
| 81 |
+ StyleOption(_('Chat Banner: Text Font'),
|
|
| 82 |
+ '.gajim-banner',
|
|
| 83 | 83 |
StyleAttr.FONT),
|
| 84 | 84 |
|
| 85 |
- StyleOption(_('Group Row Foreground Color'),
|
|
| 85 |
+ StyleOption(_('Contact List: Group Foreground Color'),
|
|
| 86 | 86 |
'.gajim-group-row',
|
| 87 | 87 |
StyleAttr.COLOR),
|
| 88 | 88 |
|
| 89 |
- StyleOption(_('Group Row Background Color'),
|
|
| 89 |
+ StyleOption(_('Contact List: Group Background Color'),
|
|
| 90 | 90 |
'.gajim-group-row',
|
| 91 | 91 |
StyleAttr.BACKGROUND),
|
| 92 | 92 |
|
| 93 |
- StyleOption(_('Group Row Font'),
|
|
| 93 |
+ StyleOption(_('Contact List: Group Font'),
|
|
| 94 | 94 |
'.gajim-group-row',
|
| 95 | 95 |
StyleAttr.FONT),
|
| 96 | 96 |
|
| 97 |
- StyleOption(_('Contact Row Foreground Color'),
|
|
| 97 |
+ StyleOption(_('Contact List: Contact Foreground Color'),
|
|
| 98 | 98 |
'.gajim-contact-row',
|
| 99 | 99 |
StyleAttr.COLOR),
|
| 100 | 100 |
|
| 101 |
- StyleOption(_('Contact Row Background Color'),
|
|
| 101 |
+ StyleOption(_('Contact List: Contact Background Color'),
|
|
| 102 | 102 |
'.gajim-contact-row',
|
| 103 | 103 |
StyleAttr.BACKGROUND),
|
| 104 | 104 |
|
| 105 |
- StyleOption(_('Contact Row Font'),
|
|
| 105 |
+ StyleOption(_('Contact List: Contact Font'),
|
|
| 106 | 106 |
'.gajim-contact-row',
|
| 107 | 107 |
StyleAttr.FONT),
|
| 108 | 108 |
|
| 109 |
- StyleOption(_('Conversation Font'),
|
|
| 110 |
- '.gajim-conversation-font',
|
|
| 111 |
- StyleAttr.FONT),
|
|
| 112 |
- |
|
| 113 |
- StyleOption(_('Incoming Nickname Color'),
|
|
| 114 |
- '.gajim-incoming-nickname',
|
|
| 115 |
- StyleAttr.COLOR),
|
|
| 116 |
- |
|
| 117 |
- StyleOption(_('Outgoing Nickname Color'),
|
|
| 118 |
- '.gajim-outgoing-nickname',
|
|
| 119 |
- StyleAttr.COLOR),
|
|
| 120 |
- |
|
| 121 |
- StyleOption(_('Incoming Message Text Color'),
|
|
| 122 |
- '.gajim-incoming-message-text',
|
|
| 123 |
- StyleAttr.COLOR),
|
|
| 124 |
- |
|
| 125 |
- StyleOption(_('Incoming Message Text Font'),
|
|
| 126 |
- '.gajim-incoming-message-text',
|
|
| 127 |
- StyleAttr.FONT),
|
|
| 128 |
- |
|
| 129 |
- StyleOption(_('Outgoing Message Text Color'),
|
|
| 130 |
- '.gajim-outgoing-message-text',
|
|
| 131 |
- StyleAttr.COLOR),
|
|
| 132 |
- |
|
| 133 |
- StyleOption(_('Outgoing Message Text Font'),
|
|
| 134 |
- '.gajim-outgoing-message-text',
|
|
| 135 |
- StyleAttr.FONT),
|
|
| 136 |
- |
|
| 137 |
- StyleOption(_('Status Message Color'),
|
|
| 138 |
- '.gajim-status-message',
|
|
| 139 |
- StyleAttr.COLOR),
|
|
| 140 |
- |
|
| 141 |
- StyleOption(_('Status Message Font'),
|
|
| 142 |
- '.gajim-status-message',
|
|
| 143 |
- StyleAttr.FONT),
|
|
| 144 |
- |
|
| 145 |
- StyleOption(_('URL Color'),
|
|
| 146 |
- '.gajim-url',
|
|
| 147 |
- StyleAttr.COLOR),
|
|
| 148 |
- |
|
| 149 |
- StyleOption(_('Highlight Message Background'),
|
|
| 150 |
- '.gajim-mention-highlight',
|
|
| 151 |
- StyleAttr.BACKGROUND),
|
|
| 152 |
- |
|
| 153 |
- StyleOption(_('Message Correcting'),
|
|
| 154 |
- '.gajim-msg-correcting text',
|
|
| 155 |
- StyleAttr.BACKGROUND),
|
|
| 156 |
- |
|
| 157 |
- StyleOption(_('Contact Disconnected Background'),
|
|
| 158 |
- '.gajim-roster-disconnected',
|
|
| 159 |
- StyleAttr.BACKGROUND),
|
|
| 160 |
- |
|
| 161 |
- StyleOption(_('Contact Connected Background '),
|
|
| 162 |
- '.gajim-roster-connected',
|
|
| 163 |
- StyleAttr.BACKGROUND),
|
|
| 164 |
- StyleOption(_('Status Online Color'),
|
|
| 109 |
+ StyleOption(_('Status: Online Color'),
|
|
| 165 | 110 |
'.gajim-status-online',
|
| 166 | 111 |
StyleAttr.COLOR),
|
| 167 |
- StyleOption(_('Status Away Color'),
|
|
| 112 |
+ |
|
| 113 |
+ StyleOption(_('Status: Away Color'),
|
|
| 168 | 114 |
'.gajim-status-away',
|
| 169 | 115 |
StyleAttr.COLOR),
|
| 170 |
- StyleOption(_('Status DND Color'),
|
|
| 116 |
+ |
|
| 117 |
+ StyleOption(_('Status: DND Color'),
|
|
| 171 | 118 |
'.gajim-status-dnd',
|
| 172 | 119 |
StyleAttr.COLOR),
|
| 173 |
- StyleOption(_('Status Offline Color'),
|
|
| 120 |
+ |
|
| 121 |
+ StyleOption(_('Status: Offline Color'),
|
|
| 174 | 122 |
'.gajim-status-offline',
|
| 175 | 123 |
StyleAttr.COLOR),
|
| 176 | 124 |
]
|
| ... | ... | @@ -317,6 +265,14 @@ def _on_add_new_theme(self, *args): |
| 317 | 265 |
self._select_theme_row(iter_)
|
| 318 | 266 |
self._apply_theme(name)
|
| 319 | 267 |
|
| 268 |
+ def reload_roster_theme(self):
|
|
| 269 |
+ tree_selection = self._ui.theme_treeview.get_selection()
|
|
| 270 |
+ store, iter_ = tree_selection.get_selected()
|
|
| 271 |
+ if iter_ is None:
|
|
| 272 |
+ return
|
|
| 273 |
+ theme = store[iter_][Column.THEME]
|
|
| 274 |
+ self._apply_theme(theme)
|
|
| 275 |
+ |
|
| 320 | 276 |
@staticmethod
|
| 321 | 277 |
def _apply_theme(theme):
|
| 322 | 278 |
app.settings.set('roster_theme', theme)
|
| ... | ... | @@ -423,11 +379,13 @@ def _on_color_set(self, color_button): |
| 423 | 379 |
app.css_config.set_value(
|
| 424 | 380 |
self.option.selector, self.option.attr, color_string, pre=True)
|
| 425 | 381 |
app.nec.push_incoming_event(NetworkEvent('style-changed'))
|
| 382 |
+ self.get_toplevel().reload_roster_theme()
|
|
| 426 | 383 |
|
| 427 | 384 |
def _on_font_set(self, font_button):
|
| 428 | 385 |
desc = font_button.get_font_desc()
|
| 429 | 386 |
app.css_config.set_font(self.option.selector, desc, pre=True)
|
| 430 | 387 |
app.nec.push_incoming_event(NetworkEvent('style-changed'))
|
| 388 |
+ self.get_toplevel().reload_roster_theme()
|
|
| 431 | 389 |
|
| 432 | 390 |
def _on_remove(self, *args):
|
| 433 | 391 |
self.get_parent().remove(self)
|