diff --git a/src/main.py b/src/main.py index e1acda9..c8cb83d 100644 --- a/src/main.py +++ b/src/main.py @@ -64,7 +64,7 @@ class JnotesApplication(Adw.Application): else: win.sidebar.set_calendars(self.calendar_set) - Sync.set_spinner(win.sidebar.spinner) + Sync.set_spinner(win.spinner) Sync.get_calendar_set(callback) def on_about_action(self, widget, _): diff --git a/src/note_edit.py b/src/note_edit.py index 3ff0274..46a3e0a 100644 --- a/src/note_edit.py +++ b/src/note_edit.py @@ -35,5 +35,16 @@ class NoteEdit(Gtk.ScrolledWindow): self.summary.get_buffer().set_text(self.note.summary) self.description.get_buffer().set_text(self.note.description) - def on_save_button_pressed(self, widget): - print("save button pressed") + @Gtk.Template.Callback() + def on_summary_changed(self, s): + pass + summary = s.get_text(s.get_start_iter(), s.get_end_iter(), False) + if self.note.summary != summary: + self.note.set_property("summary", summary) + + @Gtk.Template.Callback() + def on_description_changed(self, d): + pass + description = d.get_text(d.get_start_iter(), d.get_end_iter(), False) + if self.note.description != description: + self.note.description = description diff --git a/src/sidebar.py b/src/sidebar.py index 99c2425..fee1e05 100644 --- a/src/sidebar.py +++ b/src/sidebar.py @@ -21,11 +21,10 @@ from gi.repository import Adw from gi.repository import Gtk @Gtk.Template(resource_path='/net/jeena/jnotes/ui/sidebar.ui') -class Sidebar(Adw.NavigationPage): +class Sidebar(Gtk.ScrolledWindow): __gtype_name__ = 'Sidebar' calendar_set = Gtk.Template.Child() - spinner = Gtk.Template.Child() def __init__(self, **kwargs): super().__init__(**kwargs) diff --git a/src/ui/note_edit.ui b/src/ui/note_edit.ui index 191c10a..2d40b2f 100644 --- a/src/ui/note_edit.ui +++ b/src/ui/note_edit.ui @@ -5,7 +5,7 @@ vertical 24 - 12 + -12 12 12 12 @@ -21,6 +21,7 @@ 12 3 card + " @@ -37,6 +38,7 @@ 12 3 card + diff --git a/src/ui/sidebar.ui b/src/ui/sidebar.ui index 131fa2d..18c0c51 100644 --- a/src/ui/sidebar.ui +++ b/src/ui/sidebar.ui @@ -1,28 +1,12 @@ -