[mathieui] make popup notification colors configurable. Fixes #7127

This commit is contained in:
Yann Leboulanger 2012-03-27 14:50:26 +02:00
parent 0ee415feff
commit 6ba89b3360
2 changed files with 18 additions and 9 deletions

View file

@ -99,6 +99,15 @@ class Config:
'statusmsgcolor': [ opt_color, '#4e9a06', _('Status message text color.'), True ],
'markedmsgcolor': [ opt_color, '#ff8080', '', True ],
'urlmsgcolor': [ opt_color, '#204a87', '', True ],
'notif_signin_color': [ opt_color, '#32CD32', _('Contact signed in notification color.') ], # limegreen
'notif_signout_color': [ opt_color, '#FF0000', _('Contact signout notification color') ], # red
'notif_message_color': [ opt_color, '#1E90FF', _('New message/email notification color.') ], # dodgerblue
'notif_ftrequest_color': [ opt_color, '#F0E68C', _('File transfer request notification color.') ], # khaki
'notif_fterror_color': [ opt_color, '#B22222', _('File transfer error notification color.') ], # firebrick
'notif_ftcomplete_color': [ opt_color, '#9ACD32', _('File transfer complete or stopped notification color.') ], # yellowgreen
'notif_invite_color': [ opt_color, '#D2B48C', _('Groupchat invitation notification color') ], # tan1
'notif_status_color': [ opt_color, '#D8BFD8', _('Status changed notification background color') ], # thistle2
'notif_other_color': [ opt_color, '#FFFFFF', _('Other dialogs color.') ], # white
'inmsgfont': [ opt_str, '', _('Incoming nickname font.'), True ],
'outmsgfont': [ opt_str, '', _('Outgoing nickname font.'), True ],
'inmsgtxtfont': [ opt_str, '', _('Incoming text font.'), True ],

View file

@ -2776,25 +2776,25 @@ class PopupNotificationWindow:
path_to_image = gtkgui_helpers.get_icon_path('gajim-chat_msg_recv', 48)
if event_type == _('Contact Signed In'):
bg_color = 'limegreen'
bg_color = gajim.config.get('notif_signin_color')
elif event_type == _('Contact Signed Out'):
bg_color = 'red'
bg_color = gajim.config.get('notif_signout_color')
elif event_type in (_('New Message'), _('New Single Message'),
_('New Private Message'), _('New E-mail')):
bg_color = 'dodgerblue'
bg_color = gajim.config.get('notif_message_color')
elif event_type == _('File Transfer Request'):
bg_color = 'khaki'
bg_color = gajim.config.get('notif_ftrequest_color')
elif event_type == _('File Transfer Error'):
bg_color = 'firebrick'
bg_color = gajim.config.get('notif_fterror_color')
elif event_type in (_('File Transfer Completed'),
_('File Transfer Stopped')):
bg_color = 'yellowgreen'
bg_color = gajim.config.get('notif_ftcomplete_color')
elif event_type == _('Groupchat Invitation'):
bg_color = 'tan1'
bg_color = gajim.config.get('notif_invite_color')
elif event_type == _('Contact Changed Status'):
bg_color = 'thistle2'
bg_color = gajim.config.get('notif_status_color')
else: # Unknown event! Shouldn't happen but deal with it
bg_color = 'white'
bg_color = gajim.config.get('notif_other_color')
popup_bg_color = gtk.gdk.color_parse(bg_color)
close_button.modify_bg(gtk.STATE_NORMAL, popup_bg_color)
eventbox.modify_bg(gtk.STATE_NORMAL, popup_bg_color)