Index: panel-plugin/xfce4-cpufreq-plugin.c =================================================================== --- panel-plugin/xfce4-cpufreq-plugin.c (Revision 3967) +++ panel-plugin/xfce4-cpufreq-plugin.c (Arbeitskopie) @@ -17,8 +17,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define SPACING 2 /* Space between the widgets */ -#define FRAME_BORDER 2 /* Space between the frame and the panel */ +#define SPACING 1 /* Space between the widgets */ +#define FRAME_BORDER 1 /* Space between the frame and the panel */ #define BORDER 1 /* Space between the frame and the widgets */ #ifdef HAVE_CONFIG_H @@ -158,6 +155,11 @@ cpuFreq->label = gtk_label_new (""); gtk_box_pack_start (GTK_BOX (box), cpuFreq->label, FALSE, FALSE, 0); gtk_label_set_use_markup (GTK_LABEL (cpuFreq->label), TRUE); + if (cpuFreq->options->font) { + PangoFontDescription *font = pango_font_description_from_string(cpuFreq->options->font); + gtk_widget_modify_font(cpuFreq->label, font); + pango_font_description_free(font); + } } g_signal_connect (cpuFreq->ebox, "button-press-event", G_CALLBACK (cpufreq_overview), cpuFreq); @@ -187,6 +189,7 @@ cpuFreq->options->show_icon = xfce_rc_read_bool_entry (rc, "show_icon", TRUE); cpuFreq->options->show_label_freq = xfce_rc_read_bool_entry (rc, "show_label_freq", TRUE); cpuFreq->options->show_label_governor = xfce_rc_read_bool_entry (rc, "show_label_governor", TRUE); + cpuFreq->options->font = g_strdup(xfce_rc_read_entry (rc, "font", NULL)); xfce_rc_close (rc); } @@ -211,6 +214,8 @@ xfce_rc_write_bool_entry (rc, "show_icon", cpuFreq->options->show_icon); xfce_rc_write_bool_entry (rc, "show_label_freq", cpuFreq->options->show_label_freq); xfce_rc_write_bool_entry (rc, "show_label_governor", cpuFreq->options->show_label_governor); + if (cpuFreq->options->font) + xfce_rc_write_entry (rc, "font_size", cpuFreq->options->font); xfce_rc_close (rc); } @@ -236,6 +241,7 @@ gtk_tooltips_set_tip (cpuFreq->tooltip, cpuFreq->ebox, NULL, NULL); g_object_unref (cpuFreq->tooltip); g_ptr_array_free (cpuFreq->cpus, TRUE); + g_free(cpuFreq->options->font); cpuFreq->plugin = NULL; g_free (cpuFreq); } Index: panel-plugin/xfce4-cpufreq-configure.c =================================================================== --- panel-plugin/xfce4-cpufreq-configure.c (Revision 3967) +++ panel-plugin/xfce4-cpufreq-configure.c (Arbeitskopie) @@ -77,6 +77,22 @@ } static void +font_set (GtkFontButton *button, CpuFreqPluginConfigure *configure) +{ + g_free(cpuFreq->options->font); + cpuFreq->options->font = g_strdup(gtk_font_button_get_font_name(button)); + + /* apply font settings to the label */ + if (cpuFreq->options->font) { + PangoFontDescription *font = pango_font_description_from_string(cpuFreq->options->font); + gtk_widget_modify_font(cpuFreq->label, font); + pango_font_description_free(font); + } + else + gtk_widget_modify_font(cpuFreq->label, NULL); +} + +static void cpufreq_configure_response (GtkWidget *dialog, int response, CpuFreqPluginConfigure *configure) { g_object_set_data (G_OBJECT (cpuFreq->plugin), "configure", NULL); @@ -167,7 +183,7 @@ /* which cpu to show in panel */ hbox = gtk_hbox_new (FALSE, BORDER); - gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 3); label = gtk_label_new (_("Display CPU:")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); @@ -186,7 +202,20 @@ gtk_combo_box_set_active (GTK_COMBO_BOX (combo), cpuFreq->options->show_cpu); g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK (combo_changed), configure); + /* panel label font */ + hbox = gtk_hbox_new (FALSE, BORDER); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 3); + label = gtk_label_new (_("Display Font:")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + button = gtk_font_button_new (); + if (cpuFreq->options->font) + gtk_font_button_set_font_name(GTK_FONT_BUTTON (button), cpuFreq->options->font); + g_signal_connect (G_OBJECT (button), "font-set", G_CALLBACK (font_set), configure); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0); + /* check buttons for display widgets in panel */ button = configure->display_frame = gtk_check_button_new_with_mnemonic (_("Show frame")); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); Index: panel-plugin/xfce4-cpufreq-plugin.h =================================================================== --- panel-plugin/xfce4-cpufreq-plugin.h (Revision 3967) +++ panel-plugin/xfce4-cpufreq-plugin.h (Arbeitskopie) @@ -43,6 +43,7 @@ gboolean show_icon; gboolean show_label_governor; gboolean show_label_freq; + gchar *font; } CpuFreqPluginOptions; typedef struct