aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xappinfo/database.xml42
-rw-r--r--lib/notestorage.php27
2 files changed, 69 insertions, 0 deletions
diff --git a/appinfo/database.xml b/appinfo/database.xml
index fbc467a..77bb39b 100755
--- a/appinfo/database.xml
+++ b/appinfo/database.xml
@@ -155,6 +155,48 @@
<length>1024</length>
<notnull>true</notnull>
</field>
+ <field>
+ <name>note_x</name>
+ <type>integer</type>
+ <length>6</length>
+ <notnull>true</notnull>
+ <default>20</default>
+ </field>
+ <field>
+ <name>note_y</name>
+ <type>integer</type>
+ <length>6</length>
+ <notnull>true</notnull>
+ <default>20</default>
+ </field>
+ <field>
+ <name>note_width</name>
+ <type>integer</type>
+ <length>6</length>
+ <notnull>true</notnull>
+ <default>-1</default>
+ </field>
+ <field>
+ <name>note_height</name>
+ <type>integer</type>
+ <length>6</length>
+ <notnull>true</notnull>
+ <default>-1</default>
+ </field>
+ <field>
+ <name>note_selection_bound_position</name>
+ <type>integer</type>
+ <length>6</length>
+ <notnull>true</notnull>
+ <default>0</default>
+ </field>
+ <field>
+ <name>note_cursor_position</name>
+ <type>integer</type>
+ <length>6</length>
+ <notnull>true</notnull>
+ <default>0</default>
+ </field>
</declaration>
</table>
diff --git a/lib/notestorage.php b/lib/notestorage.php
index 7898637..5dc503b 100644
--- a/lib/notestorage.php
+++ b/lib/notestorage.php
@@ -95,6 +95,9 @@ class NoteStorage
'pinned',
'tags',
'title',
+ 'x', 'y', 'width', 'height',
+ 'selection-bound-position',
+ 'cursor-position',
);
$changed = array();
@@ -250,6 +253,14 @@ class NoteStorage
'open-on-startup' => false,
'pinned' => false,
'tags' => array(),
+
+ 'x' => 20,
+ 'y' => 20,
+ 'width' => -1,
+ 'height' => -1,
+
+ 'cursor-position' => 0,
+ 'selection-bound-position' => 0,
);
}
@@ -521,6 +532,14 @@ class NoteStorage
'pinned' => (bool) $row['note_pinned'],
'tags' => json_decode($row['note_tags']),
+ 'x' => (int) $row['note_x'],
+ 'y' => (int) $row['note_y'],
+ 'height' => (int) $row['note_height'],
+ 'width' => (int) $row['note_width'],
+
+ 'selection-bound-position' => (int) $row['note_selection_bound_position'],
+ 'cursor-position' => (int) $row['note_cursor_position'],
+
'last-sync-revision' => (int) $row['note_last_sync_revision'],
);
}
@@ -542,6 +561,14 @@ class NoteStorage
'note_pinned' => (int) $note->pinned,
'note_tags' => json_encode($note->tags),
+ 'note_x' => (int) $note->{'x'},
+ 'note_y' => (int) $note->{'y'},
+ 'note_height' => (int) $note->{'height'},
+ 'note_width' => (int) $note->{'width'},
+
+ 'note_selection_bound_position' => (int) $note->{'selection-bound-position'},
+ 'note_cursor_position' => (int) $note->{'cursor-position'},
+
'note_last_sync_revision' => $note->{'last-sync-revision'},
);
}