FLTK logo

[master] cd26829 - Fix missing Alt-N shortcut for newly created favorites

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] cd26829 - Fix missing Alt-N shortcut for newly created favorites "Greg Ercolano" Aug 10, 2020  
 
commit cd26829099683fda116c3e1b02d9d30b713b6296
Author:     Greg Ercolano <erco@seriss.com>
AuthorDate: Mon Aug 10 09:32:06 2020 -0700
Commit:     Greg Ercolano <erco@seriss.com>
CommitDate: Mon Aug 10 09:32:06 2020 -0700

    Fix missing Alt-N shortcut for newly created favorites
    
    Fl_File_Chooser's "Add Favorite" function wasn't including the
    Alt-N shortcut when initially added. Now just calls update_favorites()
    to rebuild the menu with proper shortcut numbering.

 src/Fl_File_Chooser2.cxx | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git src/Fl_File_Chooser2.cxx src/Fl_File_Chooser2.cxx
index 39010eb..c22860c 100644
--- src/Fl_File_Chooser2.cxx
+++ src/Fl_File_Chooser2.cxx
@@ -515,8 +515,7 @@ Fl_File_Chooser::favoritesButtonCB()
     prefs_->set(menuname, directory_);
     prefs_->flush();
 
-    quote_pathname(menuname, directory_, sizeof(menuname));
-    favoritesButton->add(menuname);
+    update_favorites();              // adds item to favorites with Alt-n shortcut
 
     if (favoritesButton->size() > 104) {
       ((Fl_Menu_Item *)favoritesButton->menu())[0].deactivate();
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.