Skip to content
Snippets Groups Projects
Commit 51ae7b7c authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Add SimpleLabel

parent 5bd70028
No related branches found
No related tags found
No related merge requests found
...@@ -19,10 +19,9 @@ ...@@ -19,10 +19,9 @@
from gi.repository import Gtk from gi.repository import Gtk
from gajim.common.const import AvatarSize from gajim.common.const import AvatarSize
from gajim.common.styling import process
from .widgets import SimpleLabel
from .base import BaseRow from .base import BaseRow
from ..message_widget import MessageWidget
class InfoMessage(BaseRow): class InfoMessage(BaseRow):
...@@ -43,9 +42,7 @@ def __init__(self, account, text): ...@@ -43,9 +42,7 @@ def __init__(self, account, text):
timestamp_widget.set_valign(Gtk.Align.START) timestamp_widget.set_valign(Gtk.Align.START)
self.grid.attach(timestamp_widget, 2, 0, 1, 1) self.grid.attach(timestamp_widget, 2, 0, 1, 1)
result = process(text) self._label = SimpleLabel()
message_widget = MessageWidget(account)
message_widget.add_content(result)
self.grid.attach(message_widget, 1, 0, 1, 1) self.grid.attach(self._label, 1, 0, 1, 1)
self.show_all() self.show_all()
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
from datetime import datetime from datetime import datetime
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import Pango
from gajim.common.i18n import _ from gajim.common.i18n import _
from gajim.common.const import AvatarSize from gajim.common.const import AvatarSize
from .widgets import SimpleLabel
from .base import BaseRow from .base import BaseRow
...@@ -33,11 +33,7 @@ def __init__(self, type_, account, nick, reason=None, error=False): ...@@ -33,11 +33,7 @@ def __init__(self, type_, account, nick, reason=None, error=False):
self.timestamp = datetime.fromtimestamp(timestamp) self.timestamp = datetime.fromtimestamp(timestamp)
self.db_timestamp = timestamp self.db_timestamp = timestamp
self._label = Gtk.Label() self._label = SimpleLabel()
self._label.set_selectable(True)
self._label.set_line_wrap(True)
self._label.set_xalign(0)
self._label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
if type_ == 'muc-user-joined': if type_ == 'muc-user-joined':
text = self._make_join_message(nick) text = self._make_join_message(nick)
......
# This file is part of Gajim.
#
# Gajim is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation; version 3 only.
#
# Gajim is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
from gi.repository import Gtk
class SimpleLabel(Gtk.Label):
def __init__(self):
Gtk.Label.__init__(self)
self.set_selectable(True)
self.set_line_wrap(True)
self.set_xalign(0)
self.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment