Commit 59f0403f authored by Daniel Brötzmann's avatar Daniel Brötzmann

ChatControl: Use account badge

parent d03a45ce
Pipeline #5642 passed with stages
in 2 minutes and 36 seconds
......@@ -60,6 +60,7 @@ from gajim.gtk.util import get_show_in_roster
from gajim.gtk.util import get_show_in_systray
from gajim.gtk.util import get_hardware_key_codes
from gajim.gtk.util import get_builder
from gajim.gtk.util import generate_account_badge
from gajim.gtk.const import ControlType # pylint: disable=unused-import
from gajim.gtk.emoji_chooser import emoji_chooser
......@@ -140,11 +141,11 @@ class ChatControlBase(ChatCommandProcessor, CommandTools, EventHelper):
self._accounts = app.get_enabled_accounts_with_labels()
if len(self._accounts) > 1:
self.xml.account_image.set_tooltip_text(
app.get_account_label(self.account))
account_class = app.css_config.get_dynamic_class(self.account)
self.xml.account_image.get_style_context().add_class(account_class)
self.xml.account_image.show()
account_badge = generate_account_badge(self.account)
account_badge.set_tooltip_text(
_('Account: %s') % app.get_account_label(self.account))
self.xml.account_badge.add(account_badge)
account_badge.show()
# Init DND
self.TARGET_TYPE_URI_LIST = 80
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.2 -->
<!-- Generated with glade 3.36.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="gtk+" version="3.22"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">110</property>
<property name="step_increment">1</property>
......@@ -449,6 +449,25 @@
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="account_badge">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -546,20 +565,6 @@
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkImage" id="account_image">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="icon_name">org.gajim.Gajim-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">6</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -567,9 +572,6 @@
<property name="position">2</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
<style>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.2 -->
<!-- Generated with glade 3.36.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkMenu" id="formattings_menu">
......@@ -151,14 +151,17 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="account_image">
<object class="GtkBox" id="account_badge">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">end</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="valign">center</property>
<property name="margin_end">6</property>
<property name="hexpand">True</property>
<property name="icon_name">org.gajim.Gajim-symbolic</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">0</property>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment