From 6d482456bec9690d49b29f7bb0ddf029d71b3081 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 4 Jul 2004 22:34:15 +0000 Subject: new menu item to change all fonts at once. --- mixgtk/mixgtk_fontsel.c | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) (limited to 'mixgtk/mixgtk_fontsel.c') diff --git a/mixgtk/mixgtk_fontsel.c b/mixgtk/mixgtk_fontsel.c index 59849b1..37cc9c8 100644 --- a/mixgtk/mixgtk_fontsel.c +++ b/mixgtk/mixgtk_fontsel.c @@ -1,7 +1,7 @@ /* -*-c-*- -------------- mixgtk_fontsel.c : * Implementation of the functions declared in mixgtk_fontsel.h * ------------------------------------------------------------------ - * $Id: mixgtk_fontsel.c,v 1.16 2004/06/24 01:40:47 jao Exp $ + * $Id: mixgtk_fontsel.c,v 1.17 2004/07/04 22:34:15 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2001, 2004 Free Software Foundation, Inc. * @@ -24,12 +24,17 @@ #include #include "mixgtk_widgets.h" #include "mixgtk_config.h" +#include "mixgtk_mixvm.h" +#include "mixgtk_mixal.h" +#include "mixgtk_cmd_dispatcher.h" +#include "mixgtk_device.h" #include "mixgtk_fontsel.h" static GtkFontSelectionDialog *fontsel_dialog_ = NULL; static const gchar *keys_[MIX_FONT_NO] = { - "MIX.font", "Prompt.font", "Log.font", "MIXAL.font", "Devices.font" + "MIX.font", "Prompt.font", "Log.font", "MIXAL.font", "Devices.font", + "Default.font" }; @@ -72,7 +77,7 @@ mixgtk_fontsel_set_font (mixgtk_font_t f, GtkWidget *w) } -extern gboolean +gboolean mixgtk_fontsel_query_font (mixgtk_font_t f, GtkWidget **w, size_t no) { gint result = GTK_RESPONSE_APPLY; @@ -104,3 +109,34 @@ mixgtk_fontsel_query_font (mixgtk_font_t f, GtkWidget **w, size_t no) return ret; } +void +on_all_fonts_activate (void) +{ + gint result = GTK_RESPONSE_APPLY; + const gchar *current; + + if (!fontsel_dialog_) init_fontsel_ (); + + current = mixgtk_config_get (keys_[MIX_FONT_DEFAULT]); + gtk_font_selection_dialog_set_font_name (fontsel_dialog_, + current? current : "Monospace"); + + while (result == GTK_RESPONSE_APPLY) + { + result = gtk_dialog_run (GTK_DIALOG (fontsel_dialog_)); + if (result != GTK_RESPONSE_CANCEL) + { + gint k; + current = gtk_font_selection_dialog_get_font_name (fontsel_dialog_); + + for (k = 0; k < MIX_FONT_NO; ++k) + mixgtk_config_update (keys_[k], current); + + mixgtk_mixal_update_fonts (); + mixgtk_mixvm_update_fonts (); + mixgtk_device_update_fonts (); + mixgtk_cmd_dispatcher_update_fonts (); + } + } + gtk_widget_hide (GTK_WIDGET (fontsel_dialog_)); +} -- cgit v1.2.3