Пример #1
0
        /// <summary>
        /// Invoked when the user clicks OK or Apply in the font selection
        /// dialog. Changes the font on all widgets and saves the new font
        /// in the config file.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="args">Event arguments.</param>
        private void OnChangeFont(object sender, ResponseArgs args)
        {
            try
            {
#if NETFRAMEWORK
                string fontName = fontDialog.FontName;
#else
                string fontName = fontDialog.Font;
#endif
                Pango.FontDescription newFont = Pango.FontDescription.FromString(fontName);
                Utility.Configuration.Settings.FontName = newFont.ToString();
                ChangeFont(newFont);
                if (args.ResponseId != ResponseType.Apply)
                {
                    fontDialog.Cleanup();
                }
            }
            catch (Exception err)
            {
                ShowError(err);
            }
        }