[Xfce4-commits] [panel-plugins/xfce4-cpufreq-plugin] 05/20: Replace GtkFontSelectionDialog by GtkFontChooserDialog
noreply at xfce.org
noreply at xfce.org
Sat May 6 21:01:06 CEST 2017
This is an automated email from the git hooks/post-receive script.
andre pushed a commit to branch master
in repository panel-plugins/xfce4-cpufreq-plugin.
commit a9b9142445b1f3ebac4bb8676c3eed89d081e067
Author: Andre Miranda <andre42m at gmail.com>
Date: Fri Nov 4 22:30:05 2016 -0300
Replace GtkFontSelectionDialog by GtkFontChooserDialog
---
panel-plugin/xfce4-cpufreq-configure.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/panel-plugin/xfce4-cpufreq-configure.c b/panel-plugin/xfce4-cpufreq-configure.c
index 895166f..d72d7a4 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -34,10 +34,13 @@
#endif
static void
+check_button_changed (GtkWidget *button, CpuFreqPluginConfigure *configure);
+
+static void
check_button_changed (GtkWidget *button, CpuFreqPluginConfigure *configure)
{
if (button == configure->display_icon)
- cpuFreq->options->show_icon =
+ cpuFreq->options->show_icon =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
else if (button == configure->display_freq)
@@ -90,19 +93,19 @@ static gboolean
button_fontname_clicked(GtkWidget *button,
CpuFreqPluginConfigure *configure)
{
- GtkFontSelectionDialog *fsd;
+ GtkWidget *fc;
gchar *fontname;
gint result;
- fsd = GTK_FONT_SELECTION_DIALOG
- (gtk_font_selection_dialog_new (_("Select font")));
+ fc = gtk_font_chooser_dialog_new (_("Select font"),
+ GTK_WINDOW(gtk_widget_get_toplevel(button)));
+
if (cpuFreq->options->fontname)
- gtk_font_selection_dialog_set_font_name(fsd,
- cpuFreq->options->fontname);
+ gtk_font_chooser_set_font (GTK_FONT_CHOOSER (fc), cpuFreq->options->fontname);
- result = gtk_dialog_run(GTK_DIALOG(fsd));
+ result = gtk_dialog_run(GTK_DIALOG(fc));
if (result == GTK_RESPONSE_OK || result == GTK_RESPONSE_ACCEPT) {
- fontname = gtk_font_selection_dialog_get_font_name(fsd);
+ fontname = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (fc));
if (fontname != NULL) {
gtk_button_set_label(GTK_BUTTON(button), fontname);
g_free (cpuFreq->options->fontname);
@@ -110,7 +113,7 @@ button_fontname_clicked(GtkWidget *button,
}
button_fontname_update(button, TRUE);
}
- gtk_widget_destroy(GTK_WIDGET(fsd));
+ gtk_widget_destroy(GTK_WIDGET(fc));
return TRUE;
}
@@ -150,7 +153,7 @@ static void
spinner_changed (GtkWidget *spinner, CpuFreqPluginConfigure *configure)
{
cpuFreq->options->timeout =gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spinner));
-
+
cpufreq_restart_timeout ();
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list