File: font_menu_callback.C

package info (click to toggle)
peruser 4b33-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,952 kB
  • ctags: 1,064
  • sloc: cpp: 22,367; perl: 2,733; makefile: 345; sh: 335
file content (69 lines) | stat: -rw-r--r-- 2,264 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <stdlib.h>
#include <stdio.h>

#include <gtk/gtk.h>

#include "npsummary.h"

void font_menu_callback( GtkWidget *widget, gpointer data )
{
   NP_Summary *summary = ( NP_Summary *)data;

   int size = ( int)gtk_object_get_data( GTK_OBJECT( widget ), "font" );

   switch( size )
   {
      case 0: 
         summary->unread_style->font = 
            summary->unread_request_style->font =
            summary->unread_header_style->font =
            summary->unread_dummy_style->font =
            gdk_font_load( "-*-helvetica-bold-r-*-*-*-110-*-*-*-*-*-*" );
         summary->read_style->font = 
            summary->header_style->font =
            summary->dummy_style->font =
            summary->request_style->font =
            gdk_font_load( "-*-helvetica-medium-r-*-*-*-110-*-*-*-*-*-*" );
         break;
         
      case 1:
         summary->unread_style->font = 
            summary->unread_request_style->font =
            summary->unread_header_style->font = 
            summary->unread_dummy_style->font =
            gdk_font_load( "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*" );
         summary->read_style->font = 
            summary->header_style->font =
            summary->request_style->font =
            summary->dummy_style->font = 
            gdk_font_load( "-*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*" );
         break;

      case 2:
         summary->unread_style->font = 
            summary->unread_request_style->font =
            summary->unread_header_style->font = 
            summary->unread_dummy_style->font = 
            gdk_font_load( "-*-helvetica-bold-r-*-*-*-130-*-*-*-*-*-*" );
         summary->read_style->font = 
            summary->header_style->font =
            summary->request_style->font =
            summary->dummy_style->font = 
            gdk_font_load( "-*-helvetica-medium-r-*-*-*-130-*-*-*-*-*-*" );
         break;
   }

   if ( summary->unread_style->font == NULL )
      summary->unread_style->font = gdk_font_load( "fixed" );

   if ( summary->read_style->font == NULL )
      summary->read_style->font = gdk_font_load( "fixed" );

   summary->item = widget;
   summary->update_tree();

   if ( summary->list_onscreen )
      sort_list_callback( NULL, data );

   return;
}