Hello community, here is the log from the commit of package palaura for openSUSE:Factory checked in at 2020-05-08 23:07:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/palaura (Old) and /work/SRC/openSUSE:Factory/.palaura.new.2738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "palaura" Fri May 8 23:07:09 2020 rev:9 rq:801368 version:1.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/palaura/palaura.changes 2020-02-21 16:41:53.845977830 +0100 +++ /work/SRC/openSUSE:Factory/.palaura.new.2738/palaura.changes 2020-05-08 23:07:12.246089296 +0200 @@ -1,0 +2,9 @@ +Thu Apr 30 07:35:52 UTC 2020 - Alexei Podvalsky <[email protected]> + +- Update to 1.2.2: + * Merge pull request #47 from binotaliu/bugfix/text-category + * fix text category parse + * Merge pull request #46 from ryonakano/use-gtk-application + * Use Gtk.Application instead of deprecated Granite.Application + +------------------------------------------------------------------- Old: ---- palaura-1.2.1.tar.gz New: ---- palaura-1.2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ palaura.spec ++++++ --- /var/tmp/diff_new_pack.qJSzoj/_old 2020-05-08 23:07:13.314091478 +0200 +++ /var/tmp/diff_new_pack.qJSzoj/_new 2020-05-08 23:07:13.318091486 +0200 @@ -17,7 +17,7 @@ Name: palaura -Version: 1.2.1 +Version: 1.2.2 Release: 0 Summary: A dictionary with word definitions License: GPL-3.0-or-later @@ -33,7 +33,7 @@ BuildRequires: pkgconfig(gee-0.8) BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(gobject-2.0) -BuildRequires: pkgconfig(granite) >= 0.5 +BuildRequires: pkgconfig(granite) >= 5.1.0 BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtksourceview-3.0) BuildRequires: pkgconfig(json-glib-1.0) ++++++ palaura-1.2.1.tar.gz -> palaura-1.2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.1/.travis.yml new/palaura-1.2.2/.travis.yml --- old/palaura-1.2.1/.travis.yml 2020-02-03 13:19:11.000000000 +0100 +++ new/palaura-1.2.2/.travis.yml 2020-04-19 00:15:09.000000000 +0200 @@ -3,7 +3,7 @@ language: node_js node_js: - - 10/* + - 10.17.0 sudo: required diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.1/data/com.github.lainsce.palaura.appdata.xml.in new/palaura-1.2.2/data/com.github.lainsce.palaura.appdata.xml.in --- old/palaura-1.2.1/data/com.github.lainsce.palaura.appdata.xml.in 2020-02-03 13:19:11.000000000 +0100 +++ new/palaura-1.2.2/data/com.github.lainsce.palaura.appdata.xml.in 2020-04-19 00:15:09.000000000 +0200 @@ -53,6 +53,14 @@ </screenshot> </screenshots> <releases> + <release version="1.2.1" date="2020-04-24"> + <description> + <p>Release: Dark Space</p> + <ul> + <li>Added: Dark mode.</li> + </ul> + </description> + </release> <release version="1.2.0" date="2020-02-07"> <description> <p>Release: Hot Revival</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.1/data/com.github.lainsce.palaura.gschema.xml new/palaura-1.2.2/data/com.github.lainsce.palaura.gschema.xml --- old/palaura-1.2.1/data/com.github.lainsce.palaura.gschema.xml 2020-02-03 13:19:11.000000000 +0100 +++ new/palaura-1.2.2/data/com.github.lainsce.palaura.gschema.xml 2020-04-19 00:15:09.000000000 +0200 @@ -10,6 +10,11 @@ <summary>Window position</summary> <description>The y axis of window position</description> </key> + <key name="dark-mode" type="b"> + <default>false</default> + <summary>Dark mode</summary> + <description>Whether dark mode is enabled or not</description> + </key> <key name="dict-lang" type="s"> <default>'en-us'</default> <summary>Dictionary language</summary> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.1/data/stylesheet.css new/palaura-1.2.2/data/stylesheet.css --- old/palaura-1.2.1/data/stylesheet.css 2020-02-03 13:19:11.000000000 +0100 +++ new/palaura-1.2.2/data/stylesheet.css 2020-04-19 00:15:09.000000000 +0200 @@ -6,6 +6,11 @@ background-color: @colorPrimary; } +.palaura-window-dark { + background-color: shade(@colorPrimary, 1.2); + color: #333; +} + .palaura-view { background-color: #FDF6E3; color: #586E75; @@ -18,4 +23,18 @@ .palaura-view:selected { background-color: #586E75; color: @textColorPrimary; +} + +.palaura-view-dark { + background-color: #002B36; + color: #93A1A1; +} + +.palaura-view-dark image { + color: #93A1A1; +} + +.palaura-view-dark:selected { + background-color: #93A1A1; + color: #002B36; } \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.1/meson.build new/palaura-1.2.2/meson.build --- old/palaura-1.2.1/meson.build 2020-02-03 13:19:11.000000000 +0100 +++ new/palaura-1.2.2/meson.build 2020-04-19 00:15:09.000000000 +0200 @@ -1,6 +1,6 @@ # Name our project project('com.github.lainsce.palaura', ['vala', 'c'], - version: '1.2.0' + version: '1.2.1' ) # Import main lib files diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.1/src/Application.vala new/palaura-1.2.2/src/Application.vala --- old/palaura-1.2.1/src/Application.vala 2020-02-03 13:19:11.000000000 +0100 +++ new/palaura-1.2.2/src/Application.vala 2020-04-19 00:15:09.000000000 +0200 @@ -1,6 +1,4 @@ -using Granite.Widgets; - -public class Palaura.Application : Granite.Application { +public class Palaura.Application : Gtk.Application { public static GLib.Settings gsettings; public Palaura.MainWindow main_window; @@ -10,9 +8,6 @@ construct { application_id = "com.github.lainsce.palaura"; - program_name = _("Palaura"); - app_launcher = "com.github.lainsce.palaura.desktop"; - exec_name = "com.github.lainsce.palaura"; } public override void activate () { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.1/src/Core/Definition.vala new/palaura-1.2.2/src/Core/Definition.vala --- old/palaura-1.2.1/src/Core/Definition.vala 2020-02-03 13:19:11.000000000 +0100 +++ new/palaura-1.2.2/src/Core/Definition.vala 2020-04-19 00:15:09.000000000 +0200 @@ -12,8 +12,11 @@ if (root.has_member ("text")) obj.text = root.get_string_member ("text"); - if (root.has_member ("lexicalCategory")) - obj.lexical_category = root.get_string_member ("lexicalCategory"); + if (root.has_member ("lexicalCategory")) { + Json.Object category = root.get_object_member ("lexicalCategory"); + if (category.has_member ("text")) + obj.lexical_category = category.get_string_member ("text"); + } if (root.has_member ("pronunciations")) { Json.Array pronunciations = root.get_array_member ("pronunciations"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.1/src/MainWindow.vala new/palaura-1.2.2/src/MainWindow.vala --- old/palaura-1.2.1/src/MainWindow.vala 2020-02-03 13:19:11.000000000 +0100 +++ new/palaura-1.2.2/src/MainWindow.vala 2020-04-19 00:15:09.000000000 +0200 @@ -5,6 +5,7 @@ private Gtk.SearchEntry search_entry; private Gtk.Stack button_stack; private Gtk.Button return_button; + public Granite.ModeSwitch mode_switch; private Palaura.SearchView search_view; private Palaura.NormalView normal_view; @@ -43,6 +44,34 @@ } return false; }); + + Palaura.Application.gsettings.changed.connect (() => { + if (Palaura.Application.gsettings.get_boolean("dark-mode")) { + Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true; + this.get_style_context ().add_class ("palaura-window-dark"); + this.get_style_context ().remove_class ("palaura-window"); + search_view.get_style_context ().add_class ("palaura-view-dark"); + search_view.get_style_context ().remove_class ("palaura-view"); + normal_view.get_style_context ().add_class ("palaura-view-dark"); + normal_view.get_style_context ().remove_class ("palaura-view"); + definition_view.get_style_context ().add_class ("palaura-view-dark"); + definition_view.get_style_context ().remove_class ("palaura-view"); + stack.get_style_context ().add_class ("palaura-view-dark"); + stack.get_style_context ().remove_class ("palaura-view"); + } else { + Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = false; + this.get_style_context ().remove_class ("palaura-window-dark"); + this.get_style_context ().add_class ("palaura-window"); + search_view.get_style_context ().add_class ("palaura-view"); + search_view.get_style_context ().remove_class ("palaura-view-dark"); + normal_view.get_style_context ().add_class ("palaura-view"); + normal_view.get_style_context ().remove_class ("palaura-view-dark"); + definition_view.get_style_context ().add_class ("palaura-view"); + definition_view.get_style_context ().remove_class ("palaura-view-dark"); + stack.get_style_context ().add_class ("palaura-view"); + stack.get_style_context ().remove_class ("palaura-view-dark"); + } + }); } #if VALA_0_42 @@ -67,13 +96,18 @@ push_view (definition_view); } - construct - { + construct { var provider = new Gtk.CssProvider (); provider.load_from_resource ("/com/github/lainsce/palaura/stylesheet.css"); Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); - var context = this.get_style_context (); - context.add_class ("palaura-window"); + + if (Palaura.Application.gsettings.get_boolean("dark-mode")) { + this.get_style_context ().add_class ("palaura-window-dark"); + this.get_style_context ().remove_class ("palaura-window"); + } else { + this.get_style_context ().remove_class ("palaura-window-dark"); + this.get_style_context ().add_class ("palaura-window"); + } search_entry = new Gtk.SearchEntry (); search_entry.placeholder_text = _("Search words"); @@ -84,6 +118,28 @@ button_stack.add (return_button); button_stack.no_show_all = true; + mode_switch = new Granite.ModeSwitch.from_icon_name ("display-brightness-symbolic", "weather-clear-night-symbolic"); + mode_switch.primary_icon_tooltip_text = _("Light Mode"); + mode_switch.secondary_icon_tooltip_text = _("Dark Mode"); + mode_switch.valign = Gtk.Align.CENTER; + mode_switch.has_focus = false; + + if (Palaura.Application.gsettings.get_boolean("dark-mode")) { + mode_switch.active = true; + } else { + mode_switch.active = false; + } + + mode_switch.notify["active"].connect (() => { + if (mode_switch.active) { + debug ("Get dark!"); + Palaura.Application.gsettings.set_boolean("dark-mode", true); + } else { + debug ("Get light!"); + Palaura.Application.gsettings.set_boolean("dark-mode", false); + } + }); + var menu_button = new Gtk.Button (); menu_button.has_tooltip = true; menu_button.image = new Gtk.Image.from_icon_name ("open-menu-symbolic", Gtk.IconSize.SMALL_TOOLBAR); @@ -100,17 +156,14 @@ headerbar.has_subtitle = false; headerbar.pack_start (button_stack); headerbar.pack_end (menu_button); - headerbar.pack_end (search_entry); + headerbar.pack_end (mode_switch); + headerbar.pack_start (search_entry); set_titlebar (headerbar); search_view = new Palaura.SearchView(); - search_view.get_style_context ().add_class ("palaura-view"); normal_view = new Palaura.NormalView(); - normal_view.get_style_context ().add_class ("palaura-view"); definition_view = new Palaura.DefinitionView(); - definition_view.get_style_context ().add_class ("palaura-view"); stack = new Gtk.Stack (); - stack.get_style_context ().add_class ("palaura-view"); stack.transition_type = Gtk.StackTransitionType.SLIDE_LEFT_RIGHT; stack.add (normal_view); stack.add (search_view); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.1/src/Views/DefinitionView.vala new/palaura-1.2.2/src/Views/DefinitionView.vala --- old/palaura-1.2.1/src/Views/DefinitionView.vala 2020-02-03 13:19:11.000000000 +0100 +++ new/palaura-1.2.2/src/Views/DefinitionView.vala 2020-04-19 00:15:09.000000000 +0200 @@ -19,8 +19,7 @@ construct { scrolled_window = new Gtk.ScrolledWindow (null, null); scrolled_window.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC); - scrolled_window.set_border_width (12); - scrolled_window.get_style_context ().add_class ("palaura-view"); + scrolled_window.set_border_width (0); add (scrolled_window); text_view = new Gtk.SourceView (); @@ -30,8 +29,32 @@ buffer = new Gtk.SourceBuffer (null); text_view.buffer = buffer; var style_manager = Gtk.SourceStyleSchemeManager.get_default (); - var style = style_manager.get_scheme ("solarized-light"); - buffer.set_style_scheme (style); + if (Palaura.Application.gsettings.get_boolean("dark-mode")) { + var style = style_manager.get_scheme ("solarized-dark"); + buffer.set_style_scheme (style); + scrolled_window.get_style_context ().add_class ("palaura-view-dark"); + scrolled_window.get_style_context ().remove_class ("palaura-view"); + } else { + var style = style_manager.get_scheme ("solarized-light"); + buffer.set_style_scheme (style); + scrolled_window.get_style_context ().remove_class ("palaura-view-dark"); + scrolled_window.get_style_context ().add_class ("palaura-view"); + } + + Palaura.Application.gsettings.changed.connect (() => { + if (Palaura.Application.gsettings.get_boolean("dark-mode")) { + var style = style_manager.get_scheme ("solarized-dark"); + buffer.set_style_scheme (style); + scrolled_window.get_style_context ().add_class ("palaura-view-dark"); + scrolled_window.get_style_context ().remove_class ("palaura-view"); + } else { + var style = style_manager.get_scheme ("solarized-light"); + buffer.set_style_scheme (style); + scrolled_window.get_style_context ().remove_class ("palaura-view-dark"); + scrolled_window.get_style_context ().add_class ("palaura-view"); + } + }); + scrolled_window.add (text_view); tag_word = buffer.create_tag (null, "weight", Pango.Weight.BOLD, "font", "serif 18"); @@ -65,9 +88,9 @@ } else { pronunciation_str += "; "; } - + pronunciation_str += pronunciations[i].phonetic_spelling; - + if (i == pronunciations.length - 1) { pronunciation_str += "/"; } @@ -79,9 +102,10 @@ buffer.insert(ref iter, "\n", -1); - if(definition.lexical_category != null) + if(definition.lexical_category != null) { buffer.insert_with_tags (ref iter, @"▰ ", -1, tag_sense_lexicon); buffer.insert_with_tags (ref iter, @"$(definition.lexical_category)", -1, tag_lexical_category); + } buffer.insert(ref iter, "\n", -1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.1/src/Views/WordListView.vala new/palaura-1.2.2/src/Views/WordListView.vala --- old/palaura-1.2.1/src/Views/WordListView.vala 2020-02-03 13:19:11.000000000 +0100 +++ new/palaura-1.2.2/src/Views/WordListView.vala 2020-04-19 00:15:09.000000000 +0200 @@ -5,23 +5,19 @@ public Granite.Widgets.AlertView alert_view; public Gtk.Stack stack; - construct - { + construct { alert_view = new Granite.Widgets.AlertView(_("No words found"), _("Try fixing your search term."), "dialog-information-symbolic"); - alert_view.get_style_context ().add_class ("palaura-view"); alert_view.show_all(); set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC); stack = new Gtk.Stack (); - stack.get_style_context ().add_class ("palaura-view"); stack.set_transition_type (Gtk.StackTransitionType.CROSSFADE); stack.set_transition_duration (400); stack.add (alert_view); list_box = new Gtk.ListBox (); - list_box.get_style_context ().add_class ("palaura-view"); list_box.expand = true; list_box.set_placeholder (stack); list_box.activate_on_single_click = true; @@ -30,6 +26,40 @@ show_definition (row.get_definition ()); }); add(list_box); + + if (Palaura.Application.gsettings.get_boolean("dark-mode")) { + alert_view.get_style_context ().add_class ("palaura-view-dark"); + alert_view.get_style_context ().remove_class ("palaura-view"); + list_box.get_style_context ().add_class ("palaura-view-dark"); + list_box.get_style_context ().remove_class ("palaura-view"); + stack.get_style_context ().add_class ("palaura-view-dark"); + stack.get_style_context ().remove_class ("palaura-view"); + } else { + alert_view.get_style_context ().add_class ("palaura-view"); + alert_view.get_style_context ().remove_class ("palaura-view-dark"); + list_box.get_style_context ().add_class ("palaura-view"); + list_box.get_style_context ().remove_class ("palaura-view-dark"); + stack.get_style_context ().add_class ("palaura-view"); + stack.get_style_context ().remove_class ("palaura-view-dark"); + } + + Palaura.Application.gsettings.changed.connect (() => { + if (Palaura.Application.gsettings.get_boolean("dark-mode")) { + alert_view.get_style_context ().add_class ("palaura-view-dark"); + alert_view.get_style_context ().remove_class ("palaura-view"); + list_box.get_style_context ().add_class ("palaura-view-dark"); + list_box.get_style_context ().remove_class ("palaura-view"); + stack.get_style_context ().add_class ("palaura-view-dark"); + stack.get_style_context ().remove_class ("palaura-view"); + } else { + alert_view.get_style_context ().add_class ("palaura-view"); + alert_view.get_style_context ().remove_class ("palaura-view-dark"); + list_box.get_style_context ().add_class ("palaura-view"); + list_box.get_style_context ().remove_class ("palaura-view-dark"); + stack.get_style_context ().add_class ("palaura-view"); + stack.get_style_context ().remove_class ("palaura-view-dark"); + } + }); } public void bind_model(ListModel model, Gtk.ListBoxCreateWidgetFunc func) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/palaura-1.2.1/src/Widgets/WordListRow.vala new/palaura-1.2.2/src/Widgets/WordListRow.vala --- old/palaura-1.2.1/src/Widgets/WordListRow.vala 2020-02-03 13:19:11.000000000 +0100 +++ new/palaura-1.2.2/src/Widgets/WordListRow.vala 2020-04-19 00:15:09.000000000 +0200 @@ -4,9 +4,26 @@ Palaura.WordContainerGrid grid; public WordListRow(Core.Definition definition) { - var context = this.get_style_context (); - context.add_class ("palaura-view"); grid = new Palaura.WordContainerGrid(definition); + + if (Palaura.Application.gsettings.get_boolean("dark-mode")) { + this.get_style_context ().add_class ("palaura-view-dark"); + this.get_style_context ().remove_class ("palaura-view"); + } else { + this.get_style_context ().remove_class ("palaura-view-dark"); + this.get_style_context ().add_class ("palaura-view"); + } + + Palaura.Application.gsettings.changed.connect (() => { + if (Palaura.Application.gsettings.get_boolean("dark-mode")) { + this.get_style_context ().add_class ("palaura-view-dark"); + this.get_style_context ().remove_class ("palaura-view"); + } else { + this.get_style_context ().remove_class ("palaura-view-dark"); + this.get_style_context ().add_class ("palaura-view"); + } + }); + add(grid); show_all(); }
