Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mesonium
gajim
Commits
aedc06ae
Commit
aedc06ae
authored
3 years ago
by
Daniel Brötzmann
Committed by
Philipp Hörist
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
MUCUserStatus: Add styling
parent
6ec56a1e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gajim/gtk/conversation/rows/muc_user_status.py
+24
-12
24 additions, 12 deletions
gajim/gtk/conversation/rows/muc_user_status.py
with
24 additions
and
12 deletions
gajim/gtk/conversation/rows/muc_user_status.py
+
24
−
12
View file @
aedc06ae
...
...
@@ -20,10 +20,15 @@
from
gajim.common.i18n
import
_
from
gajim.common.const
import
AvatarSize
from
gajim.common
import
helpers
from
gajim.common.styling
import
process
from
.widgets
import
SimpleLabel
from
.base
import
BaseRow
from
..message_widget
import
MessageWidget
from
...avatar
import
get_show_circle
class
MUCUserStatus
(
BaseRow
):
def
__init__
(
self
,
account
,
user_contact
,
is_self
):
...
...
@@ -38,15 +43,26 @@ def __init__(self, account, user_contact, is_self):
avatar_placeholder
.
set_size_request
(
AvatarSize
.
ROSTER
,
-
1
)
self
.
grid
.
attach
(
avatar_placeholder
,
0
,
0
,
1
,
1
)
icon_name
=
'
feather-info-symbolic
'
icon
=
Gtk
.
Image
.
new_from_icon_name
(
icon_name
,
Gtk
.
IconSize
.
MENU
)
self
.
grid
.
attach
(
icon
,
1
,
0
,
1
,
1
)
show_icon
=
Gtk
.
Image
()
show_icon
.
set_opacity
(
0.6
)
surface
=
get_show_circle
(
user_contact
.
show
.
value
,
AvatarSize
.
SHOW_CIRCLE
,
self
.
get_scale_factor
())
show_icon
.
set_from_surface
(
surface
)
self
.
grid
.
attach
(
show_icon
,
1
,
0
,
1
,
1
)
self
.
_label
=
SimpleLabel
()
self
.
_label
.
set_text
(
self
.
_make_text
(
user_contact
,
is_self
))
self
.
_label
.
set_text
(
self
.
_make_
show_
text
(
user_contact
,
is_self
))
self
.
_label
.
get_style_context
().
add_class
(
'
gajim-status-message
'
)
self
.
grid
.
attach
(
self
.
_label
,
2
,
0
,
1
,
1
)
if
user_contact
.
status
is
not
None
:
result
=
process
(
user_contact
.
status
)
message_widget
=
MessageWidget
(
account
)
message_widget
.
add_content
(
result
)
self
.
grid
.
attach
(
message_widget
,
2
,
1
,
1
,
1
)
timestamp_widget
=
self
.
create_timestamp_widget
(
self
.
timestamp
)
timestamp_widget
.
set_hexpand
(
True
)
timestamp_widget
.
set_halign
(
Gtk
.
Align
.
END
)
...
...
@@ -56,18 +72,14 @@ def __init__(self, account, user_contact, is_self):
self
.
show_all
()
@staticmethod
def
_make_text
(
user_contact
,
is_self
):
def
_make_
show_
text
(
user_contact
,
is_self
):
nick
=
user_contact
.
name
status
=
user_contact
.
status
status
=
''
if
status
is
None
else
'
- %s
'
%
status
show
=
helpers
.
get_uf_show
(
user_contact
.
show
.
value
)
if
is_self
:
message
=
_
(
'
You are now {show}{status}
'
).
format
(
show
=
show
,
status
=
status
)
message
=
_
(
'
You are now {show}
'
).
format
(
show
=
show
)
else
:
message
=
_
(
'
{nick} is now {show}{status}
'
).
format
(
nick
=
nick
,
show
=
show
,
status
=
status
)
message
=
_
(
'
{nick} is now {show}
'
).
format
(
nick
=
nick
,
show
=
show
)
return
message
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment