diff --git a/src/chat_control.py b/src/chat_control.py index a186aebe3..65f49cca6 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -648,16 +648,20 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): self.disconnect_style_event(banner_name_label) self.disconnect_style_event(self.banner_status_label) if bgcolor: - banner_eventbox.modify_bg(Gtk.StateType.NORMAL, - Gdk.color_parse(bgcolor)) + color = Gdk.RGBA() + Gdk.RGBA.parse(color, bgcolor) + banner_eventbox.override_background_color(Gtk.StateType.NORMAL, + color) default_bg = False else: default_bg = True if textcolor: - banner_name_label.modify_fg(Gtk.StateType.NORMAL, - Gdk.color_parse(textcolor)) - self.banner_status_label.modify_fg(Gtk.StateType.NORMAL, - Gdk.color_parse(textcolor)) + color = Gdk.RGBA() + Gdk.RGBA.parse(color, textcolor) + banner_name_label.override_background_color(Gtk.StateType.NORMAL, + color) + self.banner_status_label.override_background_color( + Gtk.StateType.NORMAL, color) default_fg = False else: default_fg = True @@ -1183,8 +1187,8 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): def update_font(self): font = Pango.FontDescription(gajim.config.get('conversation_font')) - self.conv_textview.tv.modify_font(font) - self.msg_textview.modify_font(font) + self.conv_textview.tv.override_font(font) + self.msg_textview.override_font(font) def update_tags(self): self.conv_textview.update_tags() @@ -2434,8 +2438,8 @@ class ChatControl(ChatControlBase): self.conv_textview.correct_last_sent_message(message, xhtml, self.get_our_nick(), old_txt) self.correcting = False - self.msg_textview.modify_base(Gtk.StateType.NORMAL, - self.old_message_tv_color) + self.msg_textview.override_background_color( + Gtk.StateType.NORMAL, self.old_message_tv_color) return self.print_conversation(message, self.contact.jid, encrypted=encrypted, xep0184_id=xep0184_id, xhtml=xhtml, diff --git a/src/conversation_textview.py b/src/conversation_textview.py index 880e7f635..a0d7b7125 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -240,7 +240,7 @@ class ConversationTextview(GObject.GObject): self.last_time_printout = 0 font = Pango.FontDescription(gajim.config.get('conversation_font')) - self.tv.modify_font(font) + self.tv.override_font(font) buffer_ = self.tv.get_buffer() end_iter = buffer_.get_end_iter() buffer_.create_mark('end', end_iter, False) diff --git a/src/dialogs.py b/src/dialogs.py index 41a9c65c3..101e93159 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -2919,7 +2919,9 @@ class PopupNotificationWindow: GLib.markup_escape_text(title)) # set colors [ http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html ] - self.window.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse('black')) + color = Gdk.RGBA() + Gdk.RGBA.parse(color, 'black') + self.window.override_background_color(Gtk.StateType.NORMAL, color) # default image if not path_to_image: @@ -2945,9 +2947,11 @@ class PopupNotificationWindow: bg_color = gajim.config.get('notif_status_color') else: # Unknown event! Shouldn't happen but deal with it bg_color = gajim.config.get('notif_other_color') - popup_bg_color = Gdk.color_parse(bg_color) - close_button.modify_bg(Gtk.StateType.NORMAL, popup_bg_color) - eventbox.modify_bg(Gtk.StateType.NORMAL, popup_bg_color) + popup_bg_color = Gdk.RGBA() + Gdk.RGBA.parse(popup_bg_color, bg_color) + close_button.override_background_color(Gtk.StateType.NORMAL, + popup_bg_color) + eventbox.override_background_color(Gtk.StateType.NORMAL, popup_bg_color) event_description_label.set_markup('%s' % GLib.markup_escape_text(text)) @@ -3337,8 +3341,9 @@ class XMLConsoleWindow: self.enabled = True self.xml.get_object('enable_checkbutton').set_active(True) - self.input_textview.modify_text( - Gtk.StateType.NORMAL, Gdk.color_parse(color)) + col = Gdk.RGBA() + Gdk.RGBA.parse(col, color) + self.input_textview.override_color(Gtk.StateType.NORMAL, col) if len(gajim.connections) > 1: title = _('XML Console for %s') % self.account diff --git a/src/disco.py b/src/disco.py index 47ded9094..05153188a 100644 --- a/src/disco.py +++ b/src/disco.py @@ -645,15 +645,18 @@ _('Without a connection, you can not browse available services')) textcolor = gajim.config.get_per('themes', theme, 'bannertextcolor') self.disconnect_style_event() if bgcolor: - color = Gdk.color_parse(bgcolor) - self.banner_eventbox.modify_bg(Gtk.StateType.NORMAL, color) + color = Gdk.RGBA() + Gdk.RGBA.parse(color, bgcolor) + self.banner_eventbox.override_background_color(Gtk.StateType.NORMAL, + color) default_bg = False else: default_bg = True if textcolor: - color = Gdk.color_parse(textcolor) - self.banner.modify_fg(Gtk.StateType.NORMAL, color) + color = Gdk.RGBA() + Gdk.RGBA.parse(color, textcolor) + self.banner.override_color(Gtk.StateType.NORMAL, color) default_fg = False else: default_fg = True diff --git a/src/gajim.py b/src/gajim.py index eb988a759..ee2cb73c8 100644 --- a/src/gajim.py +++ b/src/gajim.py @@ -193,7 +193,6 @@ if os.name == 'nt': warnings.filterwarnings('error', module='gtk') try: from gi.repository import GObject - GObject.threads_init() GObject.set_prgname('gajim') from gi.repository import Gtk from gi.repository import Gdk @@ -464,13 +463,6 @@ if __name__ == '__main__': interface.run() try: - if os.name != 'nt': - # This makes Gajim unusable under windows, and threads are used only - # for GPG, so not under windows - Gdk.threads_init() - Gdk.threads_enter() Gtk.main() - if os.name != 'nt': - Gdk.threads_leave() except KeyboardInterrupt: print('KeyboardInterrupt', file=sys.stderr) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 12134a6df..a64d4bb56 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -1958,8 +1958,8 @@ class GroupchatControl(ChatControlBase): self.last_sent_msg = msg if self.correcting: self.correcting = False - self.msg_textview.modify_base(Gtk.StateType.NORMAL, - self.old_message_tv_color) + self.msg_textview.override_background_color( + Gtk.StateType.NORMAL, self.old_message_tv_color) if self.correcting and self.last_sent_msg: correction_msg = self.last_sent_msg diff --git a/src/gtkexcepthook.py b/src/gtkexcepthook.py index bb31bde4b..d448058d9 100644 --- a/src/gtkexcepthook.py +++ b/src/gtkexcepthook.py @@ -59,7 +59,7 @@ def _info(type_, value, tb): # Details textview = Gtk.TextView() textview.set_editable(False) - textview.modify_font(Pango.FontDescription('Monospace')) + textview.override_font(Pango.FontDescription('Monospace')) sw = Gtk.ScrolledWindow() sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) sw.add(textview) diff --git a/src/gui_interface.py b/src/gui_interface.py index 5175f6996..f593f3a92 100644 --- a/src/gui_interface.py +++ b/src/gui_interface.py @@ -2591,7 +2591,7 @@ class Interface: sw = Gtk.ScrolledWindow() sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) view = IPythonView() - view.modify_font(Pango.FontDescription(font)) + view.override_font(Pango.FontDescription(font)) view.set_wrap_mode(Gtk.WrapMode.CHAR) sw.add(view) window.add(sw) diff --git a/src/ipython_view.py b/src/ipython_view.py index 609f2b5a2..1da9f9300 100644 --- a/src/ipython_view.py +++ b/src/ipython_view.py @@ -349,7 +349,7 @@ class ConsoleView(Gtk.TextView): Initialize console view """ GObject.GObject.__init__(self) - self.modify_font(Pango.FontDescription('Mono')) + self.override_font(Pango.FontDescription('Mono')) self.set_cursor_visible(True) self.text_buffer = self.get_buffer() self.mark = self.text_buffer.create_mark('scroll_mark', diff --git a/src/tooltips.py b/src/tooltips.py index c127dbfa1..c4977d3b1 100644 --- a/src/tooltips.py +++ b/src/tooltips.py @@ -151,7 +151,6 @@ class BaseTooltip: self.preferred_position = [pointer_x, preferred_y] self.widget_height = widget_height - self.win.ensure_style() self.win.show_all() def hide_tooltip(self): @@ -678,7 +677,6 @@ class RosterTooltip(NotificationAreaTooltip): self.win.destroy() self.win = None self.populate(self.cur_data) - self.win.ensure_style() self.win.show_all() def _append_pep_info(self, contact, properties):