Ticket #2633: roster_font_change.patch

File roster_font_change.patch, 5.9 kB (added by elrodeo, 2 years ago)
  • data/glade/preferences_window.glade

    diff -Naur gajim-0.10.1.orig/data/glade/preferences_window.glade gajim-0.10.1/data/glade/preferences_window.glade
    old new  
    308308                                  <property name="fill">False</property> 
    309309                                </packing> 
    310310                              </child> 
     311 
    311312                            </widget> 
    312313                            <packing> 
    313314                              <property name="padding">0</property> 
     
    315316                              <property name="fill">True</property> 
    316317                            </packing> 
    317318                          </child> 
     319 
     320                          <child> 
     321                            <widget class="GtkHBox" id="hbox2901"> 
     322                              <property name="visible">True</property> 
     323                              <property name="homogeneous">False</property> 
     324                              <property name="spacing">12</property> 
     325 
     326                              <child> 
     327                                <widget class="GtkLabel" id="font_label"> 
     328                                  <property name="visible">True</property> 
     329                                  <property name="label" translatable="yes">_Roster Font:</property> 
     330                                  <property name="use_underline">True</property> 
     331                                  <property name="use_markup">False</property> 
     332                                  <property name="justify">GTK_JUSTIFY_LEFT</property> 
     333                                  <property name="wrap">False</property> 
     334                                  <property name="selectable">False</property> 
     335                                  <property name="xalign">0</property> 
     336                                  <property name="yalign">0.5</property> 
     337                                  <property name="xpad">0</property> 
     338                                  <property name="ypad">0</property> 
     339                                  <property name="mnemonic_widget">roster_fontbutton</property> 
     340                                  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> 
     341                                  <property name="width_chars">-1</property> 
     342                                  <property name="single_line_mode">False</property> 
     343                                  <property name="angle">0</property> 
     344                                </widget> 
     345                                <packing> 
     346                                  <property name="padding">0</property> 
     347                                  <property name="expand">False</property> 
     348                                  <property name="fill">True</property> 
     349                                </packing> 
     350                              </child> 
     351 
     352                              <child> 
     353                                <widget class="GtkFontButton" id="roster_fontbutton"> 
     354                                  <property name="visible">True</property> 
     355                                  <property name="can_focus">True</property> 
     356                                  <property name="show_style">True</property> 
     357                                  <property name="show_size">True</property> 
     358                                  <property name="use_font">False</property> 
     359                                  <property name="use_size">False</property> 
     360                                  <property name="focus_on_click">True</property> 
     361                                  <signal name="font_set" handler="on_roster_fontbutton_font_set" last_modification_time="Sun, 07 Aug 2005 18:04:12 GMT"/> 
     362                                </widget> 
     363                                <packing> 
     364                                  <property name="padding">0</property> 
     365                                  <property name="expand">False</property> 
     366                                  <property name="fill">True</property> 
     367                                </packing> 
     368                              </child> 
     369                            </widget> 
     370                        </child> 
     371 
    318372                        </widget> 
    319373                      </child> 
    320374                    </widget> 
  • src/common/config.py

    diff -Naur gajim-0.10.1.orig/src/common/config.py gajim-0.10.1/src/common/config.py
    old new  
    150150                'file_transfers_port': [opt_int, 28011], 
    151151                'ft_override_host_to_send': [opt_str, '', _('Overrides the host we send for File Transfer in case of address translation/port forwarding.')],  
    152152                'conversation_font': [opt_str, ''], 
     153                'roster_font': [opt_str, ''], 
    153154                'use_kib_mib': [opt_bool, False, _('IEC standard says KiB = 1024 bytes, KB = 1000 bytes.')], 
    154155                'notify_on_all_muc_messages': [opt_bool, False], 
    155156                'trayicon_notification_on_new_messages': [opt_bool, True], 
  • src/config.py

    diff -Naur gajim-0.10.1.orig/src/config.py gajim-0.10.1/src/config.py
    old new  
    261261                        gajim.config.set('conversation_font', font) 
    262262                self.xml.get_widget('conversation_fontbutton').set_font_name(font) 
    263263 
     264                #Font for roster 
     265                roster_font = gajim.config.get('roster_font') 
     266                # try to set default font for the current desktop env 
     267                if roster_font == '': 
     268                        roster_font = gtkgui_helpers.get_default_font() 
     269                        if roster_font is None: 
     270                                roster_font = 'Sans 10' 
     271                        gajim.config.set('roster_font', roster_font) 
     272                self.xml.get_widget('roster_fontbutton').set_font_name(roster_font) 
     273 
    264274                # on new message 
    265275                only_in_roster = True 
    266276                if gajim.config.get('notify_on_new_message'): 
     
    653663                '''Update text font in Opened Chat Windows''' 
    654664                for win in gajim.interface.msg_win_mgr.windows(): 
    655665                        win.update_font() 
     666                gajim.interface.roster.update_font() 
    656667 
    657668        def on_incoming_msg_colorbutton_color_set(self, widget): 
    658669                self.on_preference_widget_color_set(widget, 'inmsgcolor') 
     
    669680        def on_conversation_fontbutton_font_set(self, widget): 
    670681                self.on_preference_widget_font_set(widget, 'conversation_font') 
    671682 
     683        def on_roster_fontbutton_font_set(self, widget): 
     684                self.on_preference_widget_font_set(widget, 'roster_font') 
     685 
    672686        def on_reset_colors_button_clicked(self, widget): 
    673687                for i in ('inmsgcolor', 'outmsgcolor', 'statusmsgcolor', 'urlmsgcolor'): 
    674688                        gajim.config.set(i, gajim.interface.default_values[i]) 
  • src/roster_window.py

    diff -Naur gajim-0.10.1.orig/src/roster_window.py gajim-0.10.1/src/roster_window.py
    old new  
    1919import gobject 
    2020import os 
    2121import time 
     22import pango 
    2223 
    2324import common.sleepy 
    2425import history_window 
     
    906907                        if ctrl.type_id == message_control.TYPE_GC: 
    907908                                ctrl.update_ui() 
    908909 
     910        def update_font(self): 
     911                font = pango.FontDescription(gajim.config.get('roster_font')) 
     912                self.tree.modify_font(font) 
     913 
    909914        def draw_roster(self): 
    910915                '''clear and draw roster''' 
    911916                # clear the model, only if it is not empty 
     
    34373442 
    34383443                self.collapsed_rows = gajim.config.get('collapsed_rows').split('\t') 
    34393444                self.tooltip = tooltips.RosterTooltip() 
     3445                self.update_font() 
    34403446                self.draw_roster() 
    34413447 
    34423448                if gajim.config.get('show_roster_on_startup'):