diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-05-24 22:24:48 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-05-24 22:24:48 +0200 |
| commit | adb2a719d4f6a819be34e98633afdd855f3de2b1 (patch) | |
| tree | e65ea44c44cce1363f1c571f1e94033faa675832 /fluid | |
| parent | dcfe826b2f06144cf54ce4f1a93bccf1b40381d9 (diff) | |
Fix fluid undo/redo menu activation and deactivation
(1) fix typo in recent commit
(2) deactivate undo/redo menus on startup and after reset
Fixes issue #84
Diffstat (limited to 'fluid')
| -rw-r--r-- | fluid/undo.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fluid/undo.cxx b/fluid/undo.cxx index 4c66ac2ea..1ffb41e8a 100644 --- a/fluid/undo.cxx +++ b/fluid/undo.cxx @@ -77,6 +77,7 @@ static char *undo_filename(int level) { // Redo menu callback void redo_cb(Fl_Widget *, void *) { int undo_item = main_menubar->find_index(undo_cb); + int redo_item = main_menubar->find_index(redo_cb); if (undo_current >= undo_last) return; @@ -93,7 +94,7 @@ void redo_cb(Fl_Widget *, void *) { set_modflag(undo_current != undo_save); // Update undo/redo menu items... - if (undo_current >= undo_last) Main_Menu[undo_item].deactivate(); + if (undo_current >= undo_last) Main_Menu[redo_item].deactivate(); Main_Menu[undo_item].activate(); } @@ -160,6 +161,8 @@ void undo_checkpoint() { // Clear undo buffer void undo_clear() { + int undo_item = main_menubar->find_index(undo_cb); + int redo_item = main_menubar->find_index(redo_cb); // Remove old checkpoint files... for (int i = 0; i <= undo_max; i ++) { fl_unlink(undo_filename(i)); @@ -169,6 +172,10 @@ void undo_clear() { undo_current = undo_last = undo_max = 0; if (modflag) undo_save = -1; else undo_save = 0; + + // Disable the Undo and Redo menu items... + Main_Menu[undo_item].deactivate(); + Main_Menu[redo_item].deactivate(); } // Resume undo checkpoints |
