Commit f7754487 authored by Philipp Hörist's avatar Philipp Hörist

Fix Layout issues with long status messages

Fixes #8652
parent f419127b
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<object class="GtkGrid" id="tooltip_grid">
......@@ -10,8 +10,8 @@
<object class="GtkLabel" id="nick">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
......@@ -26,10 +26,11 @@
<object class="GtkLabel" id="status">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="wrap">True</property>
<property name="wrap_mode">word-char</property>
<property name="max_width_chars">40</property>
<property name="xalign">0</property>
<attributes>
<attribute name="style" value="italic"/>
</attributes>
......@@ -44,9 +45,9 @@
<object class="GtkLabel" id="jid_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="label" translatable="yes">Jabber ID:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -69,9 +70,9 @@
<object class="GtkLabel" id="resource_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="label" translatable="yes">Resource:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -82,8 +83,8 @@
<object class="GtkLabel" id="affiliation">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -95,8 +96,8 @@
<object class="GtkLabel" id="user_show">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -108,6 +109,7 @@
<object class="GtkLabel" id="fillelement">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="vexpand">True</property>
</object>
<packing>
......@@ -120,8 +122,8 @@
<object class="GtkLabel" id="resource">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -132,8 +134,8 @@
<object class="GtkLabel" id="jid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
......
This diff is collapsed.
......@@ -31,6 +31,7 @@
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GLib
from gi.repository import Pango
import os
import time
from datetime import datetime
......@@ -207,6 +208,7 @@ class StatusTable:
self.table.insert_row(self.current_row)
self.text_label = Gtk.Label()
self.text_label.set_line_wrap(True)
self.text_label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
self.text_label.set_max_width_chars(35)
self.text_label.set_halign(Gtk.Align.START)
self.text_label.set_valign(Gtk.Align.START)
......
......@@ -404,11 +404,8 @@ class VcardWindow:
if self.contact.status:
stats += ': ' + self.contact.status
status_label = self.xml.get_object('status_label')
status_label.set_max_width_chars(15)
status_label.set_text(stats)
status_label_eventbox = self.xml.get_object('status_label_eventbox')
status_label_eventbox.set_tooltip_text(stats)
status_label.set_tooltip_text(stats)
def fill_jabber_page(self):
self.xml.get_object('nickname_label').set_markup(
......@@ -430,7 +427,6 @@ class VcardWindow:
else:
uf_sub = helpers.get_uf_sub(self.contact.sub)
subscription_label.set_text(uf_sub)
eb = self.xml.get_object('subscription_label_eventbox')
if self.contact.sub == 'from':
tt_text = _("This contact is interested in your presence information, but you are not interested in their presence")
elif self.contact.sub == 'to':
......@@ -439,16 +435,15 @@ class VcardWindow:
tt_text = _("The contact and you want to exchange presence information")
else: # None
tt_text = _("You and the contact have a mutual disinterest in each-others presence information")
eb.set_tooltip_text(tt_text)
subscription_label.set_tooltip_text(tt_text)
uf_ask = helpers.get_uf_ask(self.contact.ask)
ask_label.set_text(uf_ask)
eb = self.xml.get_object('ask_label_eventbox')
if self.contact.ask == 'subscribe':
tt_text = _("You are waiting contact's answer about your subscription request")
else:
tt_text = _("There is no pending subscription request.")
eb.set_tooltip_text(tt_text)
ask_label.set_tooltip_text(tt_text)
resources = '%s (%s)' % (self.contact.resource, str(
self.contact.priority))
......@@ -613,11 +608,8 @@ class ZeroconfVcardWindow:
if self.contact.status:
stats += ': ' + self.contact.status
status_label = self.xml.get_object('status_label')
status_label.set_max_width_chars(15)
status_label.set_text(stats)
status_label_eventbox = self.xml.get_object('status_label_eventbox')
status_label_eventbox.set_tooltip_text(stats)
status_label.set_tooltip_text(stats)
def fill_contact_page(self):
self.xml.get_object('nickname_label').set_markup(
......
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