Skip to content

Commit

Permalink
1.5.4 - Resized note sizes are now saved.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lains committed Jan 27, 2019
1 parent 874665d commit 2329410
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 5 deletions.
8 changes: 8 additions & 0 deletions data/com.github.lainsce.notejot.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
<content_attribute id="money-gambling">none</content_attribute>
</content_rating>
<releases>
<release version="1.5.4" date="2019-01-28">
<description>
<p>Release: Resized Notes? No problem!</p>
<ul>
<li>Notes' resized sizes are now saved.</li>
</ul>
</description>
</release>
<release version="1.5.3" date="2018-12-15">
<description>
<p>Release: Undo/Redo Your Notes</p>
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
com.github.lainsce.notejot (1.5.4) xenial; urgency=low

* New stuff. Please read the enclosed appdata book.

-- Lains <[email protected]> Tue, 28 Jan 2019 12:00:00 -0300

com.github.lainsce.notejot (1.5.3) xenial; urgency=low

* New stuff. Please read the enclosed appdata book.
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Name our project
project('com.github.lainsce.notejot', ['vala', 'c'],
version: '1.5.3'
version: '1.5.4'
)

# Import main lib files
Expand Down
8 changes: 6 additions & 2 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,9 @@ namespace Notejot {
this.pinned = storage.pinned;
this.content = storage.content;
this.move((int)storage.x, (int)storage.y);
if ((int)storage.w != 0 && (int)storage.h != 0) {
this.resize ((int)storage.w, (int)storage.h);
}
this.title_name = storage.title;
set_title (this.title_name);
}
Expand All @@ -543,7 +546,7 @@ namespace Notejot {
}

public Storage get_storage_note() {
int x, y;
int x, y, w, h;
string color = this.color;
string selected_color_text = this.selected_color_text;
bool pinned = this.pinned;
Expand All @@ -554,8 +557,9 @@ namespace Notejot {
set_title (this.title_name);

this.get_position (out x, out y);
this.get_size (out w, out h);

return new Storage.from_storage(x, y, color, selected_color_text, pinned, content, title_name);
return new Storage.from_storage(x, y, w, h, color, selected_color_text, pinned, content, title_name);
}

#if VALA_0_42
Expand Down
8 changes: 7 additions & 1 deletion src/Services/NoteManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ namespace Notejot {
builder.add_int_value (note.x);
builder.set_member_name ("y");
builder.add_int_value (note.y);
builder.set_member_name ("w");
builder.add_int_value (note.w);
builder.set_member_name ("h");
builder.add_int_value (note.h);
builder.set_member_name ("color");
builder.add_string_value (note.color);
builder.set_member_name ("selected_color_text");
Expand Down Expand Up @@ -108,9 +112,11 @@ namespace Notejot {
bool pinned = node.get_boolean_member("pinned");
int64 x = node.get_int_member("x");
int64 y = node.get_int_member("y");
int64 w = node.get_int_member("w");
int64 h = node.get_int_member("h");
string content = node.get_string_member("content");
string title = node.get_string_member("title");
Storage stored_note = new Storage.from_storage(x, y, color, selected_color_text, pinned, content, title);
Storage stored_note = new Storage.from_storage(x, y, w, h, color, selected_color_text, pinned, content, title);
stored_notes.add(stored_note);
}

Expand Down
6 changes: 5 additions & 1 deletion src/Services/Storage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,22 @@ namespace Notejot {
public bool pinned;
public int64 x;
public int64 y;
public int64 w;
public int64 h;
public string content;
public string title;

public Storage() {}

public Storage.from_storage(int64 x, int64 y, string color, string selected_color_text, bool pinned, string message, string title) {
public Storage.from_storage(int64 x, int64 y, int64 w, int64 h, string color, string selected_color_text, bool pinned, string message, string title) {
this.color = color;
this.selected_color_text = selected_color_text;
this.pinned = pinned;
this.content = message;
this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.title = title;
}
}
Expand Down

0 comments on commit 2329410

Please sign in to comment.