[chronojump] Fonts on graphs on preferences
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fonts on graphs on preferences
- Date: Fri, 2 Oct 2020 10:50:50 +0000 (UTC)
commit 2bea3c2e8c02d6707201c98e036ca07b4de26955
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Oct 2 12:50:30 2020 +0200
Fonts on graphs on preferences
glade/preferences_win.glade | 67 +++++++++++++++++++++++++++++++++++++++++++++
src/gui/preferences.cs | 18 ++++++++++++
2 files changed, 85 insertions(+)
---
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index 0ba83998..dd634c42 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -462,6 +462,73 @@
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <widget class="GtkHBox" id="hbox49">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child>
+ <widget class="GtkLabel" id="label101">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Fonts used on
graphs:</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox72">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkRadioButton" id="radio_font_courier">
+ <property name="label">Courier</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="radio_font_helvetica">
+ <property name="label">Helvetica</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radio_font_courier</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 8a8946f7..95ea3d31 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -71,6 +71,8 @@ public class PreferencesWindow
[Widget] Gtk.CheckButton check_appearance_person_photo;
[Widget] Gtk.Alignment alignment_undecorated;
[Widget] Gtk.Label label_recommended_undecorated;
+ [Widget] Gtk.RadioButton radio_font_courier;
+ [Widget] Gtk.RadioButton radio_font_helvetica;
[Widget] Gtk.RadioButton radio_color_custom;
[Widget] Gtk.RadioButton radio_color_chronojump_blue;
@@ -403,6 +405,11 @@ public class PreferencesWindow
else
PreferencesWindowBox.check_mode_autoload_at_start.Active = false;
+ if(preferences.fontType == Preferences.FontTypes.Courier)
+ PreferencesWindowBox.radio_font_courier.Active = true;
+ else
+ PreferencesWindowBox.radio_font_helvetica.Active = true;
+
//multimedia tab
if(preferences.volumeOn)
PreferencesWindowBox.checkbutton_volume.Active = true;
@@ -1729,6 +1736,17 @@ public class PreferencesWindow
PreferencesWindowBox.check_mode_autoload_at_start.Active);
+ if(preferences.fontType == Preferences.FontTypes.Courier && radio_font_helvetica.Active)
+ {
+ SqlitePreferences.Update(SqlitePreferences.FontsOnGraphs,
Preferences.FontTypes.Helvetica.ToString(), true);
+ preferences.fontType = Preferences.FontTypes.Helvetica;
+ }
+ else if(preferences.fontType == Preferences.FontTypes.Helvetica && radio_font_courier.Active)
+ {
+ SqlitePreferences.Update(SqlitePreferences.FontsOnGraphs,
Preferences.FontTypes.Courier.ToString(), true);
+ preferences.fontType = Preferences.FontTypes.Courier;
+ }
+
if( preferences.digitsNumber != Convert.ToInt32(UtilGtk.ComboGetActive(combo_decimals)) ) {
SqlitePreferences.Update("digitsNumber", UtilGtk.ComboGetActive(combo_decimals),
true);
preferences.digitsNumber = Convert.ToInt32(UtilGtk.ComboGetActive(combo_decimals));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]