diff --git a/data/com.github.lainsce.quilter.appdata.xml b/data/com.github.lainsce.quilter.appdata.xml index 7e6e3043..2c9f0a2e 100644 --- a/data/com.github.lainsce.quilter.appdata.xml +++ b/data/com.github.lainsce.quilter.appdata.xml @@ -23,6 +23,14 @@ https://github.com/lainsce/quilter/ https://github.com/lainsce/quilter/issues + + +

Release: When in Doubt, Hide your Status

+
    +
  • Added a switch on the Preferences to show or hide the Statusbar in the current session
  • +
+
+

Release: Focus pocus!

@@ -186,6 +194,6 @@ #b8d2e2 #333333 - 2 + 2<--> diff --git a/data/com.github.lainsce.quilter.gschema.xml b/data/com.github.lainsce.quilter.gschema.xml index 124b950f..47060e7f 100644 --- a/data/com.github.lainsce.quilter.gschema.xml +++ b/data/com.github.lainsce.quilter.gschema.xml @@ -58,6 +58,10 @@ "" Spell check language used This must be the name of one of the installed languages + + + true + Show (true) or Hide (false) the statusbar diff --git a/debian/changelog b/debian/changelog index a8972c99..38f1f19a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +com.github.lainsce.quilter (1.3.6) xenial; urgency=low + + * Preferences - Show or hide the Statusbar in the current session. + + -- Lains Sun, 8 October 2017 11:05:00 -0300 + com.github.lainsce.quilter (1.3.5) xenial; urgency=low * Focus Mode now has a better way of showing focus on the text. diff --git a/po/com.github.lainsce.quilter.pot b/po/com.github.lainsce.quilter.pot index bfdb1daa..f33f76b3 100644 --- a/po/com.github.lainsce.quilter.pot +++ b/po/com.github.lainsce.quilter.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: com.github.lainsce.quilter\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-10-04 23:09-0300\n" +"POT-Creation-Date: 2017-10-08 10:54-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,80 +21,88 @@ msgstr "" msgid "Quilter" msgstr "" -#: src/MainWindow.vala:92 +#: src/MainWindow.vala:93 msgid "New file" msgstr "" -#: src/MainWindow.vala:102 +#: src/MainWindow.vala:103 msgid "Save as…" msgstr "" -#: src/MainWindow.vala:115 src/Services/DialogUtils.vala:58 +#: src/MainWindow.vala:116 src/Services/DialogUtils.vala:58 msgid "Save file" msgstr "" -#: src/MainWindow.vala:128 +#: src/MainWindow.vala:129 msgid "Open…" msgstr "" -#: src/MainWindow.vala:141 +#: src/MainWindow.vala:142 msgid "Settings" msgstr "" -#: src/MainWindow.vala:145 +#: src/MainWindow.vala:146 msgid "Markdown Cheatsheet" msgstr "" -#: src/MainWindow.vala:152 src/Widgets/Preferences.vala:33 +#: src/MainWindow.vala:153 src/Widgets/Preferences.vala:34 msgid "Preferences" msgstr "" -#: src/MainWindow.vala:179 +#: src/MainWindow.vala:180 msgid "Edit" msgstr "" -#: src/MainWindow.vala:180 +#: src/MainWindow.vala:181 msgid "Preview" msgstr "" -#: src/Widgets/StatusBar.vala:41 +#: src/Widgets/StatusBar.vala:44 msgid "Words: " msgstr "" -#: src/Widgets/Preferences.vala:46 +#: src/Widgets/Preferences.vala:47 msgid "Editor" msgstr "" -#: src/Widgets/Preferences.vala:47 +#: src/Widgets/Preferences.vala:48 msgid "Enable Focus Mode:" msgstr "" -#: src/Widgets/Preferences.vala:49 +#: src/Widgets/Preferences.vala:50 msgid "Enable Dark Mode:" msgstr "" -#: src/Widgets/Preferences.vala:52 +#: src/Widgets/Preferences.vala:53 msgid "Show the Save Button:" msgstr "" -#: src/Widgets/Preferences.vala:55 +#: src/Widgets/Preferences.vala:56 msgid "Font" msgstr "" -#: src/Widgets/Preferences.vala:56 +#: src/Widgets/Preferences.vala:57 msgid "Custom font:" msgstr "" -#: src/Widgets/Preferences.vala:66 +#: src/Widgets/Preferences.vala:67 msgid "Spellcheck" msgstr "" -#: src/Widgets/Preferences.vala:67 +#: src/Widgets/Preferences.vala:68 msgid "Enable Spellchecking:" msgstr "" +#: src/Widgets/Preferences.vala:72 +msgid "Statusbar" +msgstr "" + +#: src/Widgets/Preferences.vala:73 +msgid "Show Statusbar:" +msgstr "" + #. Close button -#: src/Widgets/Preferences.vala:71 src/Widgets/Cheatsheet.vala:48 +#: src/Widgets/Preferences.vala:77 src/Widgets/Cheatsheet.vala:48 msgid "Close" msgstr "" diff --git a/po/es.po b/po/es.po index 411ff64f..2eb2bed1 100644 --- a/po/es.po +++ b/po/es.po @@ -87,6 +87,14 @@ msgstr "Autocorrector" msgid "Enable Spellchecking:" msgstr "Habilitar Autocorrector" +#: src/Widgets/Preferences.vala:72 +msgid "Statusbar" +msgstr "Barra del Estado" + +#: src/Widgets/Preferences.vala:73 +msgid "Show Statusbar:" +msgstr "Mostrar la Barra del Estado:" + #. Close button #: src/Widgets/Preferences.vala:71 src/Widgets/Cheatsheet.vala:48 msgid "Close" diff --git a/po/pt_BR.po b/po/pt_BR.po index 51410592..13ceb196 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -94,6 +94,14 @@ msgstr "Verificação de Ortografia" msgid "Enable Spellchecking:" msgstr "Habilitar Verificação de Ortografia:" +#: src/Widgets/Preferences.vala:72 +msgid "Statusbar" +msgstr "Barra de Estado" + +#: src/Widgets/Preferences.vala:73 +msgid "Show Statusbar:" +msgstr "Mostrar a Barra de Estado:" + #. Close button #: src/Widgets/Preferences.vala:71 src/Widgets/Cheatsheet.vala:48 msgid "Close" diff --git a/src/Constants/AppSettings.vala b/src/Constants/AppSettings.vala index f47e5335..1608e46b 100644 --- a/src/Constants/AppSettings.vala +++ b/src/Constants/AppSettings.vala @@ -26,6 +26,7 @@ namespace Quilter { public bool use_system_font { get; set; } public bool show_save_button { get; set; } public bool spellcheck { get; set; } + public bool statusbar { get; set; } public string font { get; set; } public string last_file { get; set; } public string spellcheck_language { get; set; } diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 5934fda9..0a888d92 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -37,6 +37,7 @@ namespace Quilter { private Gtk.StackSwitcher view_mode; private Gtk.ScrolledWindow edit_view; private Gtk.ScrolledWindow preview_view; + private Gtk.Grid grid; private Widgets.Preferences preferences_dialog; private Widgets.Cheatsheet cheatsheet_dialog; private bool timer_scheduled = false; @@ -67,6 +68,7 @@ namespace Quilter { width_request: 920); schedule_timer (); + statusbar.update_wordcount (); edit_view_content.changed.connect (schedule_timer); edit_view_content.changed.connect (statusbar.update_wordcount); } @@ -181,7 +183,7 @@ namespace Quilter { statusbar = new Widgets.StatusBar (); - var grid = new Gtk.Grid (); + grid = new Gtk.Grid (); grid.orientation = Gtk.Orientation.VERTICAL; grid.add (stack); grid.add (statusbar); @@ -207,6 +209,7 @@ namespace Quilter { settings.changed.connect (() => { show_save_button (); focus_mode_toolbar (); + show_statusbar (); }); int x = settings.window_x; @@ -341,5 +344,10 @@ namespace Quilter { toolbar.pack_start (save_button); save_button.visible = settings.show_save_button; } + + public void show_statusbar () { + var settings = AppSettings.get_default (); + statusbar.visible = settings.statusbar; + } } } diff --git a/src/Widgets/Preferences.vala b/src/Widgets/Preferences.vala index 3f1c3fcc..88143e95 100644 --- a/src/Widgets/Preferences.vala +++ b/src/Widgets/Preferences.vala @@ -22,6 +22,7 @@ namespace Quilter.Widgets { Gtk.Switch dark_mode; Gtk.Switch use_custom_font; Gtk.Switch spellcheck; + Gtk.Switch statusbar; Gtk.Switch save_button; Gtk.FontButton select_font; @@ -68,6 +69,11 @@ namespace Quilter.Widgets { spellcheck_label.set_halign (Gtk.Align.END); spellcheck = new SettingsSwitch ("spellcheck"); + var statusbar_header = new SettingsHeader (_("Statusbar")); + var statusbar_label = new Gtk.Label (_("Show Statusbar:")); + statusbar_label.set_halign (Gtk.Align.END); + statusbar = new SettingsSwitch ("statusbar"); + var close_button = new Gtk.Button.with_label (_("Close")); close_button.clicked.connect (() => {this.destroy ();}); @@ -94,7 +100,11 @@ namespace Quilter.Widgets { main_grid.attach (spellcheck_label, 0, 8, 1, 1); main_grid.attach (spellcheck, 1, 8, 1, 1); - main_grid.attach (button_box, 0, 9, 4, 1); + main_grid.attach (statusbar_header, 0, 9, 1, 1); + main_grid.attach (statusbar_label, 0, 10, 1, 1); + main_grid.attach (statusbar, 1, 10, 1, 1); + + main_grid.attach (button_box, 0, 11, 4, 1); ((Gtk.Container) get_content_area ()).add (main_grid); } diff --git a/src/Widgets/StatusBar.vala b/src/Widgets/StatusBar.vala index 124f3b01..a33478de 100644 --- a/src/Widgets/StatusBar.vala +++ b/src/Widgets/StatusBar.vala @@ -21,14 +21,10 @@ using Granite; namespace Quilter { public class Widgets.StatusBar : Gtk.ActionBar { - public SourceView editor; public Gtk.Label wordcount_label; public StatusBar () { - wordcount_label = new Gtk.Label(""); - wordcount_label.set_width_chars (18); - update_wordcount (); - pack_start (wordcount_label); + wordcount_item (); } construct { @@ -36,6 +32,13 @@ namespace Quilter { context.add_class ("quilter-statusbar"); } + public void wordcount_item () { + wordcount_label = new Gtk.Label(""); + wordcount_label.set_width_chars (18); + update_wordcount (); + pack_start (wordcount_label); + } + public void update_wordcount () { var wc = get_count(); wordcount_label.set_text((_("Words: ")) + wc.words.to_string()); @@ -44,7 +47,7 @@ namespace Quilter { public WordCount get_count() { try { var reg = new Regex("[\\s\\W]+", RegexCompileFlags.OPTIMIZE); - string text = editor.buffer.text; + string text = Widgets.SourceView.buffer.text; string result = reg.replace (text, text.length, 0, " "); return new WordCount(result.strip().split(" ").length, result.length); @@ -54,7 +57,7 @@ namespace Quilter { } } - public class WordCount { + public class Widgets.WordCount { public int words { get; private set; } public int chars { get; private set; } @@ -63,4 +66,4 @@ namespace Quilter { this.chars = chars; } } -} \ No newline at end of file +}