-
Notifications
You must be signed in to change notification settings - Fork 46
[Relies on #263] Style update #264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: page-list-upgrade
Are you sure you want to change the base?
Changes from 5 commits
0b18f99
1f13008
187f596
aa195d7
0900b83
cd1fd53
9e92f2c
7e9b7da
0ceffaa
f1144c5
e58e5a3
33d07e5
7197ed1
fc27fba
21029fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,69 @@ | ||
| # Used for GResource. | ||
| # | ||
| # resource_dir: Directory where the .gresource.xml is located. | ||
| # resource_file: Filename of the .gresource.xml file (just the | ||
| # filename, not the complete path). | ||
| # output_dir: Directory where the C output file is written. | ||
| # output_file: This variable will be set with the complete path of the | ||
| # output C file. | ||
| # Copyright (C) 2013 Venom authors and contributors | ||
| # | ||
| # This file is part of Venom. | ||
| # | ||
| # Venom 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 3 of the License, or | ||
| # (at your option) any later version. | ||
| # | ||
| # Venom 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 Venom. If not, see <http://www.gnu.org/licenses/>. | ||
| # | ||
|
|
||
| FIND_PROGRAM(GLIB_COMPILE_RESOURCES_EXECUTABLE NAMES glib-compile-resources) | ||
| MARK_AS_ADVANCED(GLIB_COMPILE_RESOURCES_EXECUTABLE) | ||
|
|
||
| INCLUDE(CMakeParseArguments) | ||
|
|
||
| function (gresource resource_dir resource_file output_dir output_file) | ||
| # Get the output file path | ||
| get_filename_component (resource_name ${resource_file} NAME_WE) | ||
| set (output "${output_dir}/${resource_name}-resources.c") | ||
| set (${output_file} ${output} PARENT_SCOPE) | ||
| FUNCTION(GLIB_COMPILE_RESOURCES output) | ||
| CMAKE_PARSE_ARGUMENTS(ARGS "" "" "SOURCE" ${ARGN}) | ||
| SET(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) | ||
| SET(out_files "") | ||
|
|
||
| # Get the dependencies of the gresource | ||
| execute_process ( | ||
| OUTPUT_VARIABLE _files | ||
| WORKING_DIRECTORY ${resource_dir} | ||
| COMMAND ${gresources_executable} --generate-dependencies ${resource_file} | ||
| ) | ||
| FOREACH(src ${ARGS_SOURCE} ${ARGS_UNPARSED_ARGUMENTS}) | ||
| SET(in_file "${CMAKE_CURRENT_SOURCE_DIR}/${src}") | ||
| GET_FILENAME_COMPONENT(WORKING_DIR ${in_file} PATH) | ||
| STRING(REPLACE ".xml" ".c" src ${src}) | ||
| SET(out_file "${DIRECTORY}/${src}") | ||
| GET_FILENAME_COMPONENT(OUPUT_DIR ${out_file} PATH) | ||
| FILE(MAKE_DIRECTORY ${OUPUT_DIR}) | ||
| LIST(APPEND out_files "${DIRECTORY}/${src}") | ||
|
|
||
| string (REPLACE "\n" ";" files ${_files}) | ||
| #FIXME implicit depends currently not working | ||
| EXECUTE_PROCESS( | ||
| COMMAND | ||
| ${GLIB_COMPILE_RESOURCES_EXECUTABLE} | ||
| "--generate-dependencies" | ||
| ${in_file} | ||
| WORKING_DIRECTORY ${WORKING_DIR} | ||
| OUTPUT_VARIABLE in_file_dep | ||
| ) | ||
| STRING(REGEX REPLACE "(\r?\n)" ";" in_file_dep "${in_file_dep}") | ||
| SET(in_file_dep_path "") | ||
| FOREACH(dep ${in_file_dep}) | ||
| LIST(APPEND in_file_dep_path "${WORKING_DIR}/${dep}") | ||
| ENDFOREACH(dep ${in_file_dep}) | ||
| ADD_CUSTOM_COMMAND( | ||
| OUTPUT ${out_file} | ||
| WORKING_DIRECTORY ${WORKING_DIR} | ||
| COMMAND | ||
| ${GLIB_COMPILE_RESOURCES_EXECUTABLE} | ||
| ARGS | ||
| "--generate-source" | ||
| "--target=${out_file}" | ||
| ${in_file} | ||
| DEPENDS | ||
| ${in_file};${in_file_dep_path} | ||
| ) | ||
| ENDFOREACH(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS}) | ||
| SET(${output} ${out_files} PARENT_SCOPE) | ||
| ENDFUNCTION(GLIB_COMPILE_RESOURCES) | ||
|
|
||
| set (depends "") | ||
| foreach (cur_file ${files}) | ||
| list (APPEND depends "${resource_dir}/${cur_file}") | ||
| endforeach () | ||
|
|
||
| # Command to compile the resources | ||
| add_custom_command ( | ||
| OUTPUT ${output} | ||
| DEPENDS "${resource_dir}/${resource_file}" ${depends} | ||
| WORKING_DIRECTORY ${resource_dir} | ||
| COMMAND ${gresources_executable} --generate-source --target=${output} ${resource_file} | ||
| ) | ||
| endfunction () |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <gresources> | ||
| <gresource prefix="/com/github/philip-scott/notes-up"> | ||
| <file alias="stylesheet.css" compressed="false" preprocess="">stylesheet.css</file> | ||
| </gresource> | ||
| </gresources> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| .title-label { | ||
| /* font-size: 1.15em; | ||
| font-size: 15px; */ | ||
| font-size: 1.2em; | ||
| font-weight: 700; | ||
| } | ||
|
|
||
| .preview-label { | ||
| opacity:1; | ||
| } | ||
|
|
||
| .date-time-label { | ||
| opacity:0.6; | ||
| font-size:0.9em; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,7 +91,7 @@ | |
| </key> | ||
|
|
||
| <key name="editor-font" type="s"> | ||
| <default>"Open Sans 12"</default> | ||
| <default>"Open Sans 10"</default> | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the change to 10?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought it was more in line with how fonts on the system are sized, I can change it back if you don't like it/don't think it's good. |
||
| <summary>Editor font</summary> | ||
| <description>The editor's font family and size</description> | ||
| </key> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /*** | ||
| BEGIN LICENSE | ||
| Copyright (C) 2016 elementary LLC. | ||
| This program is free software: you can redistribute it and/or modify it | ||
| under the terms of the GNU Lesser General Public License version 3, as published | ||
| by the Free Software Foundation. | ||
| This program is distributed in the hope that it will be useful, but | ||
| WITHOUT ANY WARRANTY; without even the implied warranties of | ||
| MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/> | ||
| END LICENSE | ||
| ***/ | ||
| public class ClockSettings : Granite.Services.Settings { | ||
|
|
||
| public string clock_format { get; set; } | ||
|
|
||
| public ClockSettings () { | ||
| base ("org.gnome.desktop.interface"); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,9 @@ public class ENotes.PageItem : Gtk.ListBoxRow { | |
| private Gtk.Grid grid; | ||
| private Gtk.Label line1; | ||
| private Gtk.Label line2; | ||
| private Gtk.Label line3; | ||
| private DateTime time; | ||
| private string date_string; | ||
|
|
||
| public PageItem (ENotes.Page page) { | ||
| this.page = page; | ||
|
|
@@ -34,38 +37,53 @@ public class ENotes.PageItem : Gtk.ListBoxRow { | |
| private void build_ui () { | ||
| set_activatable (true); | ||
|
|
||
| var margin_horizontal = 10; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| grid = new Gtk.Grid (); | ||
| grid.orientation = Gtk.Orientation.VERTICAL; | ||
|
|
||
| line1 = new Gtk.Label (""); | ||
| line1.use_markup = true; | ||
| line1.halign = Gtk.Align.START; | ||
| line1.get_style_context ().add_class ("h3"); | ||
| line1.get_style_context ().add_class ("title-label"); | ||
| line1.ellipsize = Pango.EllipsizeMode.END; | ||
| ((Gtk.Misc) line1).xalign = 0; | ||
| line1.margin_top = 4; | ||
| line1.margin_left = 8; | ||
| line1.margin_right = 8; | ||
| line1.margin_top = 10; | ||
| line1.margin_left = margin_horizontal; | ||
| line1.margin_right = margin_horizontal; | ||
| line1.margin_bottom = 4; | ||
|
|
||
| line2 = new Gtk.Label (""); | ||
| line2.halign = Gtk.Align.START; | ||
| line2.margin_left = 8; | ||
| line2.margin_right = 8; | ||
| line2.margin_left = margin_horizontal; | ||
| line2.margin_right = margin_horizontal; | ||
| line2.margin_bottom = 4; | ||
| line2.use_markup = true; | ||
| line2.set_line_wrap (true); | ||
| line2.ellipsize = Pango.EllipsizeMode.END; | ||
| ((Gtk.Misc) line2).xalign = 0; | ||
| line2.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL); | ||
| line2.lines = 3; | ||
| line2.get_style_context ().add_class ("preview-label"); | ||
| line2.lines = 1; | ||
|
|
||
| line3 = new Gtk.Label (""); | ||
| line3.halign = Gtk.Align.START; | ||
| line3.margin_left = margin_horizontal; | ||
| line3.margin_right = margin_horizontal; | ||
| line3.margin_bottom = 10; | ||
| line3.use_markup = true; | ||
| line3.set_line_wrap (true); | ||
| line3.ellipsize = Pango.EllipsizeMode.END; | ||
| ((Gtk.Misc) line3).xalign = 0; | ||
| line3.get_style_context ().add_class ("date-time-label"); | ||
| line3.lines = 1; | ||
|
|
||
| var separator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL); | ||
| separator.hexpand = true; | ||
|
|
||
| this.add (grid); | ||
| grid.add (line1); | ||
| grid.add (line2); | ||
| grid.add (line3); | ||
| grid.add (separator); | ||
|
|
||
| load_data (); | ||
|
|
@@ -77,8 +95,17 @@ public class ENotes.PageItem : Gtk.ListBoxRow { | |
| } | ||
|
|
||
| public void load_data () { | ||
| time = new DateTime.from_unix_utc (page.modification_date); | ||
|
|
||
| if (use24HSFormat) { | ||
| date_string = time.format ("%H:%M, %a, %e %b %Y"); | ||
| } else { | ||
| date_string = time.format ("%l:%M %p, %a, %e %b %Y"); | ||
| } | ||
| date_string = date_string.chug (); | ||
| this.line3.label = date_string; | ||
| this.line2.label = page.subtitle; | ||
| this.line1.label = "<b>" + page.name + "</b>"; | ||
| this.line1.label = page.name; | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't leave commented code :)