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

Commits:

3 changed files:

Changes:

  • gajim/chat_control.py
    ... ... @@ -416,7 +416,11 @@ class ChatControl(ChatControlBase):
    416 416
             pep = self.contact.pep
    
    417 417
             img = self._pep_images[pep_type]
    
    418 418
             if pep_type in pep:
    
    419
    -            img.set_from_pixbuf(gtkgui_helpers.get_pep_as_pixbuf(pep[pep_type]))
    
    419
    +            icon = gtkgui_helpers.get_pep_icon(pep[pep_type])
    
    420
    +            if isinstance(icon, str):
    
    421
    +                img.set_from_icon_name(icon, Gtk.IconSize.MENU)
    
    422
    +            else:
    
    423
    +                img.set_from_pixbuf(icon)
    
    420 424
                 img.set_tooltip_markup(pep[pep_type].as_markup_text())
    
    421 425
                 img.show()
    
    422 426
             else:
    

  • gajim/gtkgui_helpers.py
    ... ... @@ -383,7 +383,7 @@ def load_activity_icon(category, activity=None):
    383 383
         icon_list = _load_icon_list([activity], path)
    
    384 384
         return icon_list[activity]
    
    385 385
     
    
    386
    -def get_pep_as_pixbuf(pep_class):
    
    386
    +def get_pep_icon(pep_class):
    
    387 387
         if pep_class == PEPEventType.MOOD:
    
    388 388
             received_mood = pep_class.data['mood']
    
    389 389
             mood = received_mood if received_mood in MOODS else 'unknown'
    

  • gajim/roster_window.py
    ... ... @@ -1088,27 +1088,27 @@ class RosterWindow:
    1088 1088
             pep_dict = app.connections[account].pep
    
    1089 1089
             if app.config.get('show_mood_in_roster') and 'mood' in pep_dict:
    
    1090 1090
                 self.model[child_iter][Column.MOOD_PIXBUF] = \
    
    1091
    -                gtkgui_helpers.get_pep_as_pixbuf(pep_dict['mood'])
    
    1091
    +                gtkgui_helpers.get_pep_icon(pep_dict['mood'])
    
    1092 1092
             else:
    
    1093 1093
                 self.model[child_iter][Column.MOOD_PIXBUF] = None
    
    1094 1094
     
    
    1095 1095
             if app.config.get('show_activity_in_roster') and 'activity' in \
    
    1096 1096
             pep_dict:
    
    1097 1097
                 self.model[child_iter][Column.ACTIVITY_PIXBUF] = \
    
    1098
    -                gtkgui_helpers.get_pep_as_pixbuf(pep_dict['activity'])
    
    1098
    +                gtkgui_helpers.get_pep_icon(pep_dict['activity'])
    
    1099 1099
             else:
    
    1100 1100
                 self.model[child_iter][Column.ACTIVITY_PIXBUF] = None
    
    1101 1101
     
    
    1102 1102
             if app.config.get('show_tunes_in_roster') and 'tune' in pep_dict:
    
    1103 1103
                 self.model[child_iter][Column.TUNE_ICON] = \
    
    1104
    -                gtkgui_helpers.get_pep_as_pixbuf(pep_dict['tune'])
    
    1104
    +                gtkgui_helpers.get_pep_icon(pep_dict['tune'])
    
    1105 1105
             else:
    
    1106 1106
                 self.model[child_iter][Column.TUNE_ICON] = None
    
    1107 1107
     
    
    1108 1108
             if app.config.get('show_location_in_roster') and 'geoloc' in \
    
    1109 1109
             pep_dict:
    
    1110 1110
                 self.model[child_iter][Column.LOCATION_ICON] = \
    
    1111
    -                gtkgui_helpers.get_pep_as_pixbuf(pep_dict['geoloc'])
    
    1111
    +                gtkgui_helpers.get_pep_icon(pep_dict['geoloc'])
    
    1112 1112
             else:
    
    1113 1113
                 self.model[child_iter][Column.LOCATION_ICON] = None
    
    1114 1114
     
    
    ... ... @@ -1392,7 +1392,7 @@ class RosterWindow:
    1392 1392
     
    
    1393 1393
             pixbuf = None
    
    1394 1394
             if pep_type in contact.pep:
    
    1395
    -            pixbuf = gtkgui_helpers.get_pep_as_pixbuf(contact.pep[pep_type])
    
    1395
    +            pixbuf = gtkgui_helpers.get_pep_icon(contact.pep[pep_type])
    
    1396 1396
     
    
    1397 1397
             for child_iter in iters:
    
    1398 1398
                 self.model[child_iter][model_column] = pixbuf