Skip to content

Commit

Permalink
feat: Announce navigation menu open/close
Browse files Browse the repository at this point in the history
  • Loading branch information
TatuLund committed Jan 3, 2025
1 parent bd9f956 commit d5f6037
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ public AppLayout(UI ui, AccessControl accessControl) {
var toggleButton = new Button(getTranslation(I18n.App.MENU), event -> {
if (menuLayout.getStyleName().contains(ValoTheme.MENU_VISIBLE)) {
menuLayout.removeStyleName(ValoTheme.MENU_VISIBLE);
announce(getTranslation(I18n.App.MENU_CLOSE));
} else {
menuLayout.addStyleName(ValoTheme.MENU_VISIBLE);
announce(getTranslation(I18n.App.MENU_OPEN));
}
});
toggleButton.setDescription(getTranslation(I18n.App.MENU));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public static final class App {
public static final String LOGOUT = "logout";
public static final String MENU = "menu";
public static final String LOGOUT_TOOLTIP = "logout-tooltip";
public static final String MENU_OPEN = "menu-open";
public static final String MENU_CLOSE = "menu-close";

private App() {
// private constructor to hide the implicit public one
Expand Down
2 changes: 2 additions & 0 deletions vaadincreate-ui/src/main/resources/translate_de_DE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@ product-form = buchform
opened = geöffnet
current-page = aktuelle seite
closed = buchform geschlossen
menu-open = navigationsmenü geöffnet
menu-close = navigationsmenü geschlossen
2 changes: 2 additions & 0 deletions vaadincreate-ui/src/main/resources/translate_en_GB.properties
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,6 @@ product-form = bookform
opened = opened
current-page = current page
closed = product form closed
menu-open = navigation menu opened
menu-close = navigation menu closed
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,7 @@ ready = valmis
product-form = tuotelomake
opened = avattu
current-page = nykyinen sivu
closed = tuote lomake suljettu
closed = tuotelomake suljettu
menu-open = navigointivalikko avattu
menu-close = navigointivalikko suljettu

0 comments on commit d5f6037

Please sign in to comment.