Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ OPTIONS
)

include (gresource)
glib_compile_resources(GLIB_RESOURCES_ICONS SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/data/assets.gresource.xml)
glib_compile_resources(GLIB_RESOURCES_ICONS SOURCE /data/assets.gresource.xml)

add_executable(com.github.philip-scott.notes-up ${VALA_C} ${GLIB_RESOURCES_ICONS})

Expand Down
14 changes: 13 additions & 1 deletion data/stylesheet.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
.title-label {
font-size:1em;
/* font-size: 1.15em;

Copy link
Copy Markdown
Owner

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 :)

font-size: 15px; */
font-size: 1.2em;
font-weight: 700;
}

.preview-label {
opacity:1;
}

.date-time-label {
opacity:0.6;
font-size:0.9em;
}
2 changes: 1 addition & 1 deletion schemas/org.notes.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
</key>

<key name="editor-font" type="s">
<default>"Open Sans 12"</default>
<default>"Open Sans 10"</default>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the change to 10?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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>
Expand Down
30 changes: 16 additions & 14 deletions src/Widgets/PageItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -37,43 +37,45 @@ public class ENotes.PageItem : Gtk.ListBoxRow {
private void build_ui () {
set_activatable (true);

var margin_horizontal = 10;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • If we're going to use a constant, you should declare it at the very top of the class as private const int HORIZONTAL_MARGIN = 10
  • Why the 10? why not something like 6 or 12? (12 is actually the number recommended over at the elementary Human Interface Guidelines: https://elementary.io/docs/human-interface-guidelines#spacing


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 = 8;
line3.margin_right = 8;
line3.margin_bottom = 4;
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 (Gtk.STYLE_CLASS_DIM_LABEL);
line3.lines = 3;
line3.get_style_context ().add_class ("date-time-label");
line3.lines = 1;

var separator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL);
separator.hexpand = true;
Expand Down Expand Up @@ -103,7 +105,7 @@ public class ENotes.PageItem : Gtk.ListBoxRow {
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;
}
}

3 changes: 2 additions & 1 deletion src/Widgets/Window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public class ENotes.Window : Gtk.ApplicationWindow {
private void build_ui () {

var provider = new Gtk.CssProvider ();
provider.load_from_resource ("/com/github/philip-scott/notes-up/stylesheet.css");
provider.load_from_resource ("/com/github/philip-scott/notes-up/stylesheet.css");
Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

headerbar = ENotes.Headerbar.get_instance ();
set_titlebar (headerbar);
Expand Down