commit notejot for openSUSE:Factory
Hello community, here is the log from the commit of package notejot for openSUSE:Factory checked in at 2018-01-31 19:54:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/notejot (Old) and /work/SRC/openSUSE:Factory/.notejot.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "notejot" Wed Jan 31 19:54:08 2018 rev:3 rq:571347 version:1.3.8 Changes: -------- --- /work/SRC/openSUSE:Factory/notejot/notejot.changes 2018-01-13 21:49:29.760903898 +0100 +++ /work/SRC/openSUSE:Factory/.notejot.new/notejot.changes 2018-01-31 19:54:13.934946531 +0100 @@ -1,0 +2,7 @@ +Tue Jan 30 19:59:53 UTC 2018 - avvissu@yandex.by + +- Update to 1.3.8: + * - update date in changelog + * add spanish traslate + +------------------------------------------------------------------- Old: ---- notejot-1.3.7.tar.gz New: ---- notejot-1.3.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ notejot.spec ++++++ --- /var/tmp/diff_new_pack.bhnkWY/_old 2018-01-31 19:54:14.622914537 +0100 +++ /var/tmp/diff_new_pack.bhnkWY/_new 2018-01-31 19:54:14.622914537 +0100 @@ -17,7 +17,7 @@ Name: notejot -Version: 1.3.7 +Version: 1.3.8 Release: 0 Summary: A Sticky Note App License: GPL-3.0 ++++++ notejot-1.3.7.tar.gz -> notejot-1.3.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/data/com.github.lainsce.notejot.appdata.xml new/notejot-1.3.8/data/com.github.lainsce.notejot.appdata.xml --- old/notejot-1.3.7/data/com.github.lainsce.notejot.appdata.xml 2018-01-08 18:08:59.000000000 +0100 +++ new/notejot-1.3.8/data/com.github.lainsce.notejot.appdata.xml 2018-01-23 04:07:28.000000000 +0100 @@ -23,6 +23,14 @@ </screenshot> </screenshots> <releases> + <release version="1.3.8" date="2018-01-26"> + <description> + <p>Release: A New Colorific Menu</p> + <ul> + <li>New main menu with better & fancier color buttons</li> + </ul> + </description> + </release> <release version="1.3.7" date="2018-01-08"> <description> <p>Release: Build A Flatpak</p> Binary files old/notejot-1.3.7/data/shot.png and new/notejot-1.3.8/data/shot.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/debian/changelog new/notejot-1.3.8/debian/changelog --- old/notejot-1.3.7/debian/changelog 2018-01-08 18:08:59.000000000 +0100 +++ new/notejot-1.3.8/debian/changelog 2018-01-23 04:07:28.000000000 +0100 @@ -1,4 +1,10 @@ -com.github.lainsce.notejot (1.3.6) xenial; urgency=low +com.github.lainsce.notejot (1.3.8) xenial; urgency=low + + * New menu with better & fancier color buttons. + + -- Lains <lainsce@airmail.cc> Fri, 26 Jan 2018 11:54:00 -0300 + +com.github.lainsce.notejot (1.3.7) xenial; urgency=low * Update the Lithuanian translation. * Make the app become Flatpak friendly. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/meson.build new/notejot-1.3.8/meson.build --- old/notejot-1.3.7/meson.build 2018-01-08 18:08:59.000000000 +0100 +++ new/notejot-1.3.8/meson.build 2018-01-23 04:07:28.000000000 +0100 @@ -1,6 +1,6 @@ # Name our project project('com.github.lainsce.notejot', ['vala', 'c'], - version: '1.3.7' + version: '1.3.8' ) # Import main lib files @@ -37,7 +37,6 @@ meson.project_name(), 'src/Application.vala', 'src/MainWindow.vala', - 'src/ColorWidget.vala', 'src/EditableLabel.vala', 'src/Services/NoteManager.vala', 'src/Services/Storage.vala', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/po/LINGUAS new/notejot-1.3.8/po/LINGUAS --- old/notejot-1.3.7/po/LINGUAS 2018-01-08 18:08:59.000000000 +0100 +++ new/notejot-1.3.8/po/LINGUAS 2018-01-23 04:07:28.000000000 +0100 @@ -1,2 +1,3 @@ lt pt_BR +es diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/po/com.github.lainsce.notejot.pot new/notejot-1.3.8/po/com.github.lainsce.notejot.pot --- old/notejot-1.3.7/po/com.github.lainsce.notejot.pot 2018-01-08 18:08:59.000000000 +0100 +++ new/notejot-1.3.8/po/com.github.lainsce.notejot.pot 2018-01-23 04:07:28.000000000 +0100 @@ -1,14 +1,9 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the com.github.lainsce.notejot package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# #, fuzzy msgid "" msgstr "" "Project-Id-Version: com.github.lainsce.notejot\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-10-25 23:53-0200\n" +"POT-Creation-Date: 2018-01-23 01:00-0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -17,14 +12,50 @@ "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: src/MainWindow.vala:113 +#: src/MainWindow.vala:299 msgid "New note" msgstr "" -#: src/MainWindow.vala:116 +#: src/MainWindow.vala:303 msgid "Delete note" msgstr "" -#: src/MainWindow.vala:52 +#: src/MainWindow.vala:310 +msgid "White" +msgstr "" + +#: src/MainWindow.vala:320 +msgid "Red" +msgstr "" + +#: src/MainWindow.vala:330 +msgid "Orange" +msgstr "" + +#: src/MainWindow.vala:340 +msgid "Yellow" +msgstr "" + +#: src/MainWindow.vala:350 +msgid "Green" +msgstr "" + +#: src/MainWindow.vala:360 +msgid "Blue" +msgstr "" + +#: src/MainWindow.vala:370 +msgid "Indigo" +msgstr "" + +#: src/MainWindow.vala:380 +msgid "Violet" +msgstr "" + +#: src/MainWindow.vala:390 +msgid "Slate" +msgstr "" + +#: src/MainWindow.vala:423 msgid "Settings" msgstr "" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/po/es.po new/notejot-1.3.8/po/es.po --- old/notejot-1.3.7/po/es.po 1970-01-01 01:00:00.000000000 +0100 +++ new/notejot-1.3.8/po/es.po 2018-01-23 04:07:28.000000000 +0100 @@ -0,0 +1,62 @@ +msgid "" +msgstr "" +"Project-Id-Version: com.github.lainsce.notejot\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-23 01:00-0200\n" +"PO-Revision-Date: 2018-01-13 15:43+0300\n" +"Last-Translator: Alain M. <alain23@protonmail.com>\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.7.1\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" +"%100<10 || n%100>=20) ? 1 : 2);\n" + +#: src/MainWindow.vala:299 +msgid "New note" +msgstr "Nueva nota" + +#: src/MainWindow.vala:303 +msgid "Delete note" +msgstr "Eliminar nota" + +#: src/MainWindow.vala:310 +msgid "White" +msgstr "" + +#: src/MainWindow.vala:320 +msgid "Red" +msgstr "" + +#: src/MainWindow.vala:330 +msgid "Orange" +msgstr "" + +#: src/MainWindow.vala:340 +msgid "Yellow" +msgstr "" + +#: src/MainWindow.vala:350 +msgid "Green" +msgstr "" + +#: src/MainWindow.vala:360 +msgid "Blue" +msgstr "" + +#: src/MainWindow.vala:370 +msgid "Indigo" +msgstr "" + +#: src/MainWindow.vala:380 +msgid "Violet" +msgstr "" + +#: src/MainWindow.vala:390 +msgid "Slate" +msgstr "" + +#: src/MainWindow.vala:423 +msgid "Settings" +msgstr "Preferencias" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/po/lt.po new/notejot-1.3.8/po/lt.po --- old/notejot-1.3.7/po/lt.po 2018-01-08 18:08:59.000000000 +0100 +++ new/notejot-1.3.8/po/lt.po 2018-01-23 04:07:28.000000000 +0100 @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: com.github.lainsce.notejot\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-10-25 23:53-0200\n" +"POT-Creation-Date: 2018-01-23 01:00-0200\n" "PO-Revision-Date: 2017-08-28 13:55+0300\n" "Last-Translator: Moo\n" "Language: lt\n" @@ -13,14 +13,50 @@ "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" "%100<10 || n%100>=20) ? 1 : 2);\n" -#: src/MainWindow.vala:113 +#: src/MainWindow.vala:299 msgid "New note" msgstr "Nauji užrašai" -#: src/MainWindow.vala:116 +#: src/MainWindow.vala:303 msgid "Delete note" msgstr "Ištrinti užrašus" -#: src/MainWindow.vala:52 +#: src/MainWindow.vala:310 +msgid "White" +msgstr "" + +#: src/MainWindow.vala:320 +msgid "Red" +msgstr "" + +#: src/MainWindow.vala:330 +msgid "Orange" +msgstr "" + +#: src/MainWindow.vala:340 +msgid "Yellow" +msgstr "" + +#: src/MainWindow.vala:350 +msgid "Green" +msgstr "" + +#: src/MainWindow.vala:360 +msgid "Blue" +msgstr "" + +#: src/MainWindow.vala:370 +msgid "Indigo" +msgstr "" + +#: src/MainWindow.vala:380 +msgid "Violet" +msgstr "" + +#: src/MainWindow.vala:390 +msgid "Slate" +msgstr "" + +#: src/MainWindow.vala:423 msgid "Settings" msgstr "Nustatymai" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/po/pt_BR.po new/notejot-1.3.8/po/pt_BR.po --- old/notejot-1.3.7/po/pt_BR.po 2018-01-08 18:08:59.000000000 +0100 +++ new/notejot-1.3.8/po/pt_BR.po 2018-01-23 04:07:28.000000000 +0100 @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: com.github.lainsce.notejot\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-10-25 23:53-0200\n" +"POT-Creation-Date: 2018-01-23 01:00-0200\n" "PO-Revision-Date: 2017-10-01 04:35-0300\n" "Last-Translator: Paulo Galardi <lainsce@airmail.cc>\n" "Language: pt_BR\n" @@ -12,14 +12,50 @@ "X-Generator: Poedit 1.8.7.1\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: src/MainWindow.vala:113 +#: src/MainWindow.vala:299 msgid "New note" msgstr "Nova nota" -#: src/MainWindow.vala:116 +#: src/MainWindow.vala:303 msgid "Delete note" msgstr "Deletar nota" -#: src/MainWindow.vala:52 +#: src/MainWindow.vala:310 +msgid "White" +msgstr "" + +#: src/MainWindow.vala:320 +msgid "Red" +msgstr "" + +#: src/MainWindow.vala:330 +msgid "Orange" +msgstr "" + +#: src/MainWindow.vala:340 +msgid "Yellow" +msgstr "" + +#: src/MainWindow.vala:350 +msgid "Green" +msgstr "" + +#: src/MainWindow.vala:360 +msgid "Blue" +msgstr "" + +#: src/MainWindow.vala:370 +msgid "Indigo" +msgstr "" + +#: src/MainWindow.vala:380 +msgid "Violet" +msgstr "" + +#: src/MainWindow.vala:390 +msgid "Slate" +msgstr "" + +#: src/MainWindow.vala:423 msgid "Settings" msgstr "Preferẽncias" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/src/Application.vala new/notejot-1.3.8/src/Application.vala --- old/notejot-1.3.7/src/Application.vala 2018-01-08 18:08:59.000000000 +0100 +++ new/notejot-1.3.8/src/Application.vala 2018-01-23 04:07:28.000000000 +0100 @@ -32,7 +32,7 @@ exec_name = "com.github.lainsce.notejot"; var quit_action = new SimpleAction ("quit", null); - add_accelerator ("<Control>q", "app.quit", null); + set_accels_for_action ("app.quit", {"<Control>q"}); add_action (quit_action); quit_action.activate.connect (() => { foreach (MainWindow windows in open_notes) { @@ -47,7 +47,7 @@ if (get_windows ().length () > 0) { foreach (var window in open_notes) { if (window.visible) { - window.present (); + window.present (); } } } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/src/ColorWidget.vala new/notejot-1.3.8/src/ColorWidget.vala --- old/notejot-1.3.7/src/ColorWidget.vala 2018-01-08 18:08:59.000000000 +0100 +++ new/notejot-1.3.8/src/ColorWidget.vala 1970-01-01 01:00:00.000000000 +0100 @@ -1,128 +0,0 @@ -/* -* Copyright (c) 2017 Lains -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public -* License as published by the Free Software Foundation; either -* version 2 of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -* Boston, MA 02110-1301 USA -* -*/ -namespace Notejot { - private class ColorWidget : Gtk.MenuItem { - private new bool has_focus; - private int height; - public signal void color_changed (int ncolor); - - public ColorWidget () { - set_size_request (200, 30); - height = 30; - - button_press_event.connect (button_pressed_cb); - draw.connect (on_draw); - - select.connect (() => { - has_focus = true; - }); - - deselect.connect (() => { - has_focus = false; - }); - } - - private bool button_pressed_cb (Gdk.EventButton event) { - determine_button_pressed_event (event); - return true; - } - - private void determine_button_pressed_event (Gdk.EventButton event) { - int i; - int btnw = 15; - int btnh = 15; - int y0 = (height - btnh) / 2; - int x0 = btnw + 6; - - if (event.y >= y0 && event.y <= y0+btnh) { - for (i=1; i<=9; i++) { - if (event.x >= x0 * i && event.x <= x0 * i + btnw + 6) { - color_changed (i); - break; - } - } - } - } - - protected bool on_draw (Cairo.Context cr) { - int i; - int btnw = 15; - int btnh = 15; - int y0 = (height - btnh) / 2; - int x0 = btnw + 6; - - for (i=1; i<=9; i++) { - DrawRoundedRectangle (cr,x0 * i + 6, y0, btnw, btnh, "stroke", i + 1); - DrawRoundedRectangle (cr,x0 * i + 6, y0, btnw, btnh, "fill", i + 1); - } - - return true; - } - - /* - * Create a rounded rectangle using the Bezier curve. - * Adapted from http://cairographics.org/cookbook/roundedrectangles/ - */ - private void DrawRoundedRectangle (Cairo.Context cr, int x, int y, int w, int h, string style, int color) { - int radius_x=2; - int radius_y=2; - double ARC_TO_BEZIER = 0.55228475; - - if (radius_x > w - radius_x) - radius_x = w / 2; - - if (radius_y > h - radius_y) - radius_y = h / 2; - - /* approximate (quite close) the arc using a bezier curve */ - double ca = ARC_TO_BEZIER * radius_x; - double cb = ARC_TO_BEZIER * radius_y; - - cr.new_path (); - cr.set_line_width (0.7); - cr.set_tolerance (0.1); - cr.move_to (x + radius_x, y); - cr.rel_line_to (w - 2 * radius_x, 0.0); - cr.rel_curve_to (ca, 0.0, radius_x, cb, radius_x, radius_y); - cr.rel_line_to (0, h - 2 * radius_y); - cr.rel_curve_to (0.0, cb, ca - radius_x, radius_y, -radius_x, radius_y); - cr.rel_line_to (-w + 2 * radius_x, 0); - cr.rel_curve_to (-ca, 0, -radius_x, -cb, -radius_x, -radius_y); - cr.rel_line_to (0, -h + 2 * radius_y); - cr.rel_curve_to (0.0, -cb, radius_x - ca, -radius_y, radius_x, -radius_y); - - switch (style) { - default: - case "fill": - Gdk.RGBA rgba = Gdk.RGBA (); - rgba.parse (MainWindow.value_color[color]); - Gdk.cairo_set_source_rgba (cr, rgba); - cr.fill (); - break; - case "stroke": - cr.set_source_rgba (0,0,0,0.5); - cr.stroke (); - break; - } - - cr.close_path (); - } - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/src/MainWindow.vala new/notejot-1.3.8/src/MainWindow.vala --- old/notejot-1.3.7/src/MainWindow.vala 2018-01-08 18:08:59.000000000 +0100 +++ new/notejot-1.3.8/src/MainWindow.vala 2018-01-23 04:07:28.000000000 +0100 @@ -19,29 +19,43 @@ namespace Notejot { public class MainWindow : Gtk.Window { - private Gtk.MenuItem delete_item; + private Gtk.ModelButton delete_item; private Gtk.SourceView view = new Gtk.SourceView (); - private int default_color = 6; + private Gtk.HeaderBar header; private int uid; private static int uid_counter = 0; - // The first two strings here arenot used, they are used as padding on the color widget. - public static string[] value_color = {" ", " ", "#fafafa", "#a5b3bc", "#ff9c92", "#ffc27d", "#fff394", "#d1ff82", "#8cd5ff", "#aca9fd", "#e29ffc"}; - public static int[] integer_color = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - public int64 color = 6; + public string color = "#fff394"; public string content = ""; public string title_name = "Notejot"; public Notejot.EditableLabel label; + public SimpleActionGroup actions { get; construct; } + + public const string ACTION_PREFIX = "win."; + public const string ACTION_NEW = "action_new"; + public const string ACTION_DELETE = "action_delete"; + + public static Gee.MultiMap<string, string> action_accelerators = new Gee.HashMultiMap<string, string> (); + + private const GLib.ActionEntry[] action_entries = { + { ACTION_NEW, action_new }, + { ACTION_DELETE, action_delete } + }; + public MainWindow (Gtk.Application app, Storage? storage) { Object (application: app, resizable: false, height_request: 500, width_request: 500); + var actions = new SimpleActionGroup (); + actions.add_action_entries (action_entries, this); + insert_action_group ("win", actions); + if (storage != null) { init_from_storage(storage); } else { - this.color = 6; + this.color = "#fff394"; this.content = ""; this.set_position(Gtk.WindowPosition.CENTER); this.title_name = "Notejot"; @@ -49,25 +63,21 @@ } this.get_style_context().add_class("rounded"); - this.uid = uid_counter++; update_theme(); - Gtk.MenuButton app_button = create_app_menu(); - app_button.has_tooltip = true; - app_button.tooltip_text = (_("Settings")); - - var header = new Gtk.HeaderBar(); + header = new Gtk.HeaderBar(); header.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT); header.has_subtitle = false; - header.pack_end(app_button); + create_app_menu (); header.set_show_close_button (true); + label = new Notejot.EditableLabel (this.title_name); header.set_custom_title(label); this.set_titlebar(header); - Gtk.ScrolledWindow scrolled = new Gtk.ScrolledWindow (null, null); + var scrolled = new Gtk.ScrolledWindow (null, null); this.add (scrolled); view.bottom_margin = 10; @@ -110,11 +120,165 @@ this.get_style_context().add_class("window-%d".printf(uid)); string style = null; - string selected_color = this.color == -1 ? value_color[default_color] : value_color[color]; + string selected_color = this.color; if (Gtk.get_minor_version() < 20) { - style = (N_("@define-color textColorPrimary #1a1a1a; .mainwindow-%d {background-color: %s; box-shadow: #1a1a1a;} .window-%d GtkEntry.flat {background: transparent;} .window-%d GtkTextView,.window-%d GtkHeaderBar {background-color: %s; border-bottom-color: %s; box-shadow: none;} .window-%d GtkTextView.view {color: @textColorPrimary; font-size: 11px;} .window-%d GtkTextView.view:selected {color: #FFFFFF; background-color: #3d9bda; font-size: 11px}")).printf(uid, selected_color, uid, uid, uid, selected_color, selected_color, uid, uid); + style = (N_(""" + @define-color textColorPrimary #1a1a1a; + + .mainwindow-%d { + background-color: %s; + box-shadow: #1a1a1a; + } + + GtkTextView.view { + color: @textColorPrimary; + font-size: 11px; + } + + GtkTextView.view:selected { + color: #FFFFFF; + background-color: #64baff; + font-size: 11px + } + + GtkEntry.flat { + background: transparent; + } + + .window-%d GtkTextView, + .window-%d GtkHeaderBar { + background-color: %s; + border-bottom-color: %s; + box-shadow: none; + } + + .color-button { + border-radius: 50%; + box-shadow: + inset 0 1px 0 0 alpha (@inset_dark_color, 0.7), + inset 0 0 0 1px alpha (@inset_dark_color, 0.3), + 0 1px 0 0 alpha (@bg_highlight_color, 0.3); + } + + .color-button:focus { + border-color: @colorAccent; + } + + .color-slate { + background-color: #a5b3bc; + } + + .color-white { + background-color: #fafafa; + } + + .color-red { + background-color: #ff9c92; + } + + .color-orange { + background-color: #ffc27d; + } + + .color-yellow { + background-color: #fff394; + } + + .color-green { + background-color: #d1ff82; + } + + .color-blue { + background-color: #8cd5ff; + } + + .color-indigo { + background-color: #aca9fd; + } + + .color-violet { + background-color: #e29ffc; + } + """)).printf(uid, selected_color, uid, uid, selected_color, selected_color); } else { - style = (N_("@define-color textColorPrimary #1a1a1a; .mainwindow-%d {background-color: %s; box-shadow: #1a1a1a;} .window-%d entry.flat {background: transparent;} .window-%d textview.view text,.window-%d headerbar {background-color: %s; border-bottom-color: %s; box-shadow: none;} .window-%d textview.view {color: @textColorPrimary; font-size: 14px; border-color: %s;} .window-%d textview.view:selected {color: #FFFFFF; background-color: #64baff; font-size: 14px}")).printf(uid, selected_color, uid, uid, uid, selected_color, selected_color, uid, selected_color, uid); + style = (N_(""" + @define-color textColorPrimary #1a1a1a; + + .mainwindow-%d { + background-color: %s; + box-shadow: #1a1a1a; + } + + textview.view:selected { + color: @textColorPrimary; + font-size: 14px; + } + + textview.view:selected { + color: #FFFFFF; + background-color: #64baff; + font-size: 14px + } + + entry.flat { + background: transparent; + } + + .window-%d textview.view text, + .window-%d headerbar { + background-color: %s; + border-bottom-color: %s; + box-shadow: none; + } + + .color-button { + border-radius: 50%; + box-shadow: + inset 0 1px 0 0 alpha (@inset_dark_color, 0.7), + inset 0 0 0 1px alpha (@inset_dark_color, 0.3), + 0 1px 0 0 alpha (@bg_highlight_color, 0.3); + } + + .color-button:focus { + border-color: @colorAccent; + } + + .color-slate { + background-color: #a5b3bc; + } + + .color-white { + background-color: #fafafa; + } + + .color-red { + background-color: #ff9c92; + } + + .color-orange { + background-color: #ffc27d; + } + + .color-yellow { + background-color: #fff394; + } + + .color-green { + background-color: #d1ff82; + } + + .color-blue { + background-color: #8cd5ff; + } + + .color-indigo { + background-color: #aca9fd; + } + + .color-violet { + background-color: #e29ffc; + } + """)).printf(uid, selected_color, uid, uid, selected_color, selected_color); } try { @@ -123,38 +287,198 @@ warning ("Failed to parse css style : %s", e.message); } - Gtk.StyleContext.add_provider_for_screen( - Gdk.Screen.get_default(), + Gtk.StyleContext.add_provider_for_screen ( + Gdk.Screen.get_default (), css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION ); } - private Gtk.MenuButton create_app_menu() { - Gtk.Menu app_menu = new Gtk.Menu(); + private void create_app_menu() { + var new_item = new Gtk.ModelButton (); + new_item.text = (_("New note")); + new_item.action_name = MainWindow.ACTION_PREFIX + MainWindow.ACTION_NEW; + + delete_item = new Gtk.ModelButton (); + delete_item.text = (_("Delete note")); + delete_item.action_name = MainWindow.ACTION_PREFIX + MainWindow.ACTION_DELETE; + + var color_button_white = new Gtk.Button (); + color_button_white.halign = Gtk.Align.CENTER; + color_button_white.height_request = 22; + color_button_white.width_request = 22; + color_button_white.tooltip_text = _("White"); + + var color_button_white_context = color_button_white.get_style_context (); + color_button_white_context.add_class ("color-button"); + color_button_white_context.add_class ("color-white"); + + var color_button_red = new Gtk.Button (); + color_button_red.halign = Gtk.Align.CENTER; + color_button_red.height_request = 22; + color_button_red.width_request = 22; + color_button_red.tooltip_text = _("Red"); + + var color_button_red_context = color_button_red.get_style_context (); + color_button_red_context.add_class ("color-button"); + color_button_red_context.add_class ("color-red"); + + var color_button_orange = new Gtk.Button (); + color_button_orange.halign = Gtk.Align.CENTER; + color_button_orange.height_request = 22; + color_button_orange.width_request = 22; + color_button_orange.tooltip_text = _("Orange"); + + var color_button_orange_context = color_button_orange.get_style_context (); + color_button_orange_context.add_class ("color-button"); + color_button_orange_context.add_class ("color-orange"); + + var color_button_yellow = new Gtk.Button (); + color_button_yellow.halign = Gtk.Align.CENTER; + color_button_yellow.height_request = 22; + color_button_yellow.width_request = 22; + color_button_yellow.tooltip_text = _("Yellow"); + + var color_button_yellow_context = color_button_yellow.get_style_context (); + color_button_yellow_context.add_class ("color-button"); + color_button_yellow_context.add_class ("color-yellow"); + + var color_button_green = new Gtk.Button (); + color_button_green.halign = Gtk.Align.CENTER; + color_button_green.height_request = 22; + color_button_green.width_request = 22; + color_button_green.tooltip_text = _("Green"); + + var color_button_green_context = color_button_green.get_style_context (); + color_button_green_context.add_class ("color-button"); + color_button_green_context.add_class ("color-green"); + + var color_button_blue = new Gtk.Button (); + color_button_blue.halign = Gtk.Align.CENTER; + color_button_blue.height_request = 22; + color_button_blue.width_request = 22; + color_button_blue.tooltip_text = _("Blue"); + + var color_button_blue_context = color_button_blue.get_style_context (); + color_button_blue_context.add_class ("color-button"); + color_button_blue_context.add_class ("color-blue"); + + var color_button_indigo = new Gtk.Button (); + color_button_indigo.halign = Gtk.Align.CENTER; + color_button_indigo.height_request = 22; + color_button_indigo.width_request = 22; + color_button_indigo.tooltip_text = _("Indigo"); + + var color_button_indigo_context = color_button_indigo.get_style_context (); + color_button_indigo_context.add_class ("color-button"); + color_button_indigo_context.add_class ("color-indigo"); + + var color_button_violet = new Gtk.Button (); + color_button_violet.halign = Gtk.Align.CENTER; + color_button_violet.height_request = 22; + color_button_violet.width_request = 22; + color_button_violet.tooltip_text = _("Violet"); + + var color_button_violet_context = color_button_violet.get_style_context (); + color_button_violet_context.add_class ("color-button"); + color_button_violet_context.add_class ("color-violet"); + + var color_button_slate = new Gtk.Button (); + color_button_slate.halign = Gtk.Align.CENTER; + color_button_slate.height_request = 22; + color_button_slate.width_request = 22; + color_button_slate.tooltip_text = _("Slate"); + + var color_button_slate_context = color_button_slate.get_style_context (); + color_button_slate_context.add_class ("color-button"); + color_button_slate_context.add_class ("color-slate"); + + var color_button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6); + color_button_box.margin_start = 6; + color_button_box.pack_start (color_button_white, false, true, 0); + color_button_box.pack_start (color_button_red, false, true, 0); + color_button_box.pack_start (color_button_orange, false, true, 0); + color_button_box.pack_start (color_button_yellow, false, true, 0); + color_button_box.pack_start (color_button_green, false, true, 0); + color_button_box.pack_start (color_button_blue, false, true, 0); + color_button_box.pack_start (color_button_indigo, false, true, 0); + color_button_box.pack_start (color_button_violet, false, true, 0); + color_button_box.pack_start (color_button_slate, false, true, 0); + + var setting_grid = new Gtk.Grid (); + setting_grid.margin = 6; + setting_grid.column_spacing = 6; + setting_grid.row_spacing = 12; + setting_grid.orientation = Gtk.Orientation.VERTICAL; + setting_grid.attach (new_item, 0, 0, 1, 1); + setting_grid.attach (color_button_box, 0, 1, 1, 1); + setting_grid.attach (delete_item, 0, 2, 1, 1); + setting_grid.show_all (); - var new_item = new Gtk.MenuItem.with_label (_("New note")); - new_item.activate.connect (create_new_note); + var popover = new Gtk.Popover (null); + popover.add (setting_grid); - delete_item = new Gtk.MenuItem.with_label (_("Delete note")); - delete_item.activate.connect(delete_note); + var app_button = new Gtk.MenuButton(); + app_button.has_tooltip = true; + app_button.tooltip_text = (_("Settings")); + app_button.image = new Gtk.Image.from_icon_name ("open-menu-symbolic", Gtk.IconSize.SMALL_TOOLBAR); + app_button.popover = popover; - var color_menu_item = new ColorWidget (); - color_menu_item.color_changed.connect ((color) => { - change_color_action (color+1); + color_button_white.clicked.connect (() => { + this.color = "#F5F5F5"; + update_theme(); + ((Application)this.application).update_storage(); }); - app_menu.add(new_item); - app_menu.add(color_menu_item); - app_menu.add(delete_item); + color_button_red.clicked.connect (() => { + this.color = "#ff9c92"; + update_theme(); + ((Application)this.application).update_storage(); + }); - app_menu.show_all(); + color_button_orange.clicked.connect (() => { + this.color = "#ffc27d"; + update_theme(); + ((Application)this.application).update_storage(); + }); - var app_button = new Gtk.MenuButton(); - app_button.image = new Gtk.Image.from_icon_name ("open-menu-symbolic", Gtk.IconSize.SMALL_TOOLBAR); - app_button.set_popup(app_menu); + color_button_yellow.clicked.connect (() => { + this.color = "#fff394"; + update_theme(); + ((Application)this.application).update_storage(); + }); + + color_button_green.clicked.connect (() => { + this.color = "#d1ff82"; + update_theme(); + ((Application)this.application).update_storage(); + }); + + color_button_blue.clicked.connect (() => { + this.color = "#8cd5ff"; + update_theme(); + ((Application)this.application).update_storage(); + }); + + color_button_indigo.clicked.connect (() => { + this.color = "#aca9fd"; + update_theme(); + ((Application)this.application).update_storage(); + }); + + color_button_violet.clicked.connect (() => { + this.color = "#e29ffc"; + update_theme(); + ((Application)this.application).update_storage(); + }); - return app_button; + color_button_slate.clicked.connect (() => { + this.color = "#a5b3bc"; + update_theme(); + ((Application)this.application).update_storage(); + }); + + header.pack_end(app_button); } private void init_from_storage(Storage storage) { @@ -165,23 +489,18 @@ set_title (this.title_name); } - private void create_new_note(Gtk.MenuItem new_item) { + private void action_new () { ((Application)this.application).create_note(null); } - private void change_color_action(int color) { - this.color = index_color(color); - update_theme(); - ((Application)this.application).update_storage(); - } - - private void delete_note(Gtk.MenuItem delete_item) { + private void action_delete () { ((Application)this.application).remove_note(this); this.destroy (); } public Storage get_storage_note() { - int x, y, color; + int x, y; + string color = this.color; Gtk.TextIter start,end; view.buffer.get_bounds (out start, out end); this.content = view.buffer.get_text (start, end, true); @@ -189,7 +508,6 @@ set_title (this.title_name); this.get_position (out x, out y); - color = (int)this.color; return new Storage.from_storage(x, y, color, content, title_name); } @@ -203,16 +521,5 @@ settings.window_y = y; return false; } - - private int index_color(int icolor) { - int index = 0; - foreach (int color in integer_color) { - if (color == icolor) { - return index; - } - index++; - } - return -1; - } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/src/Services/NoteManager.vala new/notejot-1.3.8/src/Services/NoteManager.vala --- old/notejot-1.3.7/src/Services/NoteManager.vala 2018-01-08 18:08:59.000000000 +0100 +++ new/notejot-1.3.8/src/Services/NoteManager.vala 2018-01-23 04:07:28.000000000 +0100 @@ -61,7 +61,7 @@ builder.set_member_name ("y"); builder.add_int_value (note.y); builder.set_member_name ("color"); - builder.add_int_value (note.color); + builder.add_string_value (note.color); builder.set_member_name ("content"); builder.add_string_value (note.content); builder.set_member_name ("title"); @@ -73,7 +73,7 @@ Json.Generator generator = new Json.Generator (); Json.Node root = builder.get_root (); generator.set_root (root); - + string str = generator.to_data (null); return str; } @@ -99,7 +99,7 @@ var array = root.get_array(); foreach (var item in array.get_elements()) { var node = item.get_object(); - int64 color = node.get_int_member("color"); + string color = node.get_string_member("color"); int64 x = node.get_int_member("x"); int64 y = node.get_int_member("y"); string content = node.get_string_member("content"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notejot-1.3.7/src/Services/Storage.vala new/notejot-1.3.8/src/Services/Storage.vala --- old/notejot-1.3.7/src/Services/Storage.vala 2018-01-08 18:08:59.000000000 +0100 +++ new/notejot-1.3.8/src/Services/Storage.vala 2018-01-23 04:07:28.000000000 +0100 @@ -20,7 +20,7 @@ namespace Notejot { public class Storage : Object { - public int64 color; + public string color; public int64 x; public int64 y; public string content; @@ -28,7 +28,7 @@ public Storage() {} - public Storage.from_storage(int64 x, int64 y, int64 color, string message, string title) { + public Storage.from_storage(int64 x, int64 y, string color, string message, string title) { this.color = color; this.content = message; this.x = x;
participants (1)
-
root@hilbert.suse.de