Philipp Hörist pushed to branch master at gajim / gajim

Commits:

2 changed files:

Changes:

  • gajim/gtk/avatar.py
    ... ... @@ -97,22 +97,35 @@ def add_status_to_avatar(surface, show):
    97 97
         width = width / scale
    
    98 98
         height = height / scale
    
    99 99
     
    
    100
    -    clip_size = width / 6.5
    
    100
    +    clip_radius = width / 5.5
    
    101
    +    center_x = width - clip_radius
    
    102
    +    center_y = height - clip_radius
    
    103
    +
    
    101 104
         context.set_source_rgb(255, 255, 255)
    
    102 105
         context.set_operator(cairo.Operator.CLEAR)
    
    103
    -    context.arc(width - clip_size, height - clip_size, clip_size, 0, 2 * pi)
    
    106
    +    context.arc(center_x, center_y, clip_radius, 0, 2 * pi)
    
    104 107
         context.fill()
    
    105 108
     
    
    106 109
         css_color = get_css_show_class(show)
    
    107 110
         color = convert_rgb_string_to_float(
    
    108 111
             app.css_config.get_value(css_color, StyleAttr.COLOR))
    
    109
    -    show_size = width / 6.5
    
    110
    -    show_radius = show_size * 0.80
    
    112
    +
    
    113
    +    show_radius = clip_radius * 0.75
    
    114
    +
    
    111 115
         context.set_source_rgb(*color)
    
    112 116
         context.set_operator(cairo.Operator.OVER)
    
    113
    -    context.arc(width - show_size, height - show_size, show_radius, 0, 2 * pi)
    
    117
    +    context.arc(center_x, center_y, show_radius, 0, 2 * pi)
    
    114 118
         context.fill()
    
    115 119
     
    
    120
    +    if show == 'dnd':
    
    121
    +        line_length = clip_radius / 2
    
    122
    +        context.move_to(center_x - line_length, center_y)
    
    123
    +        context.line_to(center_x + line_length, center_y)
    
    124
    +
    
    125
    +        context.set_source_rgb(255, 255, 255)
    
    126
    +        context.set_line_width(clip_radius / 4)
    
    127
    +        context.stroke()
    
    128
    +
    
    116 129
         return context.get_target()
    
    117 130
     
    
    118 131
     
    

  • gajim/gtk/util.py
    ... ... @@ -677,9 +677,9 @@ def generate_account_badge(account):
    677 677
     def get_css_show_class(show):
    
    678 678
         if show in ('online', 'chat'):
    
    679 679
             return '.gajim-status-online'
    
    680
    -    if show in ('away', 'xa'):
    
    680
    +    if show == 'away':
    
    681 681
             return '.gajim-status-away'
    
    682
    -    if show == 'dnd':
    
    682
    +    if show in ('dnd', 'xa'):
    
    683 683
             return '.gajim-status-dnd'
    
    684 684
         # 'offline', 'not in roster', 'requested'
    
    685 685
         return '.gajim-status-offline'