Skip to content

Commit

Permalink
Sort the favorites category (#4265)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsupermanhd authored Dec 12, 2023
1 parent 98fc2f1 commit 6093eaf
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,21 @@ protected Cell<WWindow> createFavorites(WContainer c) {
}

protected boolean createFavoritesW(WWindow w) {
boolean hasFavorites = false;
List<Module> modules = new ArrayList<>();

for (Module module : Modules.get().getAll()) {
if (module.favorite) {
w.add(theme.module(module)).expandX();
hasFavorites = true;
modules.add(module);
}
}

return hasFavorites;
modules.sort((o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.name, o2.name));

for (Module module : modules) {
w.add(theme.module(module)).expandX();
}

return !modules.isEmpty();
}

@Override
Expand Down

0 comments on commit 6093eaf

Please sign in to comment.