@@ -21,6 +21,7 @@ public class Jorts.StickyNoteWindow : Gtk.ApplicationWindow {
2121 public TextView textview;
2222
2323 private Jorts . ZoomController zoomcontroller;
24+ private Jorts . ScribblyController scribblycontroller;
2425
2526 public NoteData data {
2627 owned get { return packaged ();}
@@ -88,7 +89,7 @@ public class Jorts.StickyNoteWindow : Gtk.ApplicationWindow {
8889 title = " " + _(" - Jorts" );
8990
9091 zoomcontroller = new Jorts .ZoomController (this );
91-
92+ scribblycontroller = new Jorts . ScribblyController ( this );
9293
9394 /* ****************************************/
9495 /* HEADERBAR */
@@ -110,7 +111,6 @@ public class Jorts.StickyNoteWindow : Gtk.ApplicationWindow {
110111 /* LOADING */
111112 /* ***************************************/
112113
113- on_scribbly_changed ();
114114 load_data (data);
115115
116116 /* **************************************************/
@@ -127,10 +127,6 @@ public class Jorts.StickyNoteWindow : Gtk.ApplicationWindow {
127127 // Use the color theme of this sticky note when focused
128128 this . notify[" is-active" ]. connect (on_focus_changed);
129129
130- // The application tells us the squiffly state has changed!
131- on_scribbly_changed ();
132- Application . gsettings. changed[" scribbly-mode-active" ]. connect (on_scribbly_changed);
133-
134130 // Respect animation settings for showing ui elements
135131 if (Gtk . Settings . get_default (). gtk_enable_animations && (! Application . gsettings. get_boolean (" hide-bar" ))) {
136132 show. connect_after (delayed_show);
@@ -185,37 +181,6 @@ public class Jorts.StickyNoteWindow : Gtk.ApplicationWindow {
185181 }
186182 }
187183
188- /**
189- * Connect-disconnect the whole manage text being scribbled
190- */
191- private void on_scribbly_changed () {
192- debug (" Scribbly mode changed!" );
193-
194- if (Application . gsettings. get_boolean (" scribbly-mode-active" )) {
195- this . notify[" is-active" ]. connect (focus_scribble_unscribble);
196- if (this . is_active) { view. scribbly = false ;} else { view. scribbly = true ;};
197-
198- } else {
199- this . notify[" is-active" ]. disconnect (focus_scribble_unscribble);
200- view. scribbly = false ;
201- }
202- }
203-
204- /**
205- * Handler connected only when scribbly mode is active
206- * It just hides or show depending on focus
207- */
208- private void focus_scribble_unscribble () {
209- debug (" Scribbly mode changed!" );
210-
211- if (this . is_active) {
212- view. scribbly = false ;
213-
214- } else {
215- view. scribbly = true ;
216- }
217- }
218-
219184 /**
220185 * Package the note into a NoteData and pass it back.
221186 * Used by NoteManager to pass all informations conveniently for storage
0 commit comments