center the top nav buttons when window is small

This commit is contained in:
woodser 2025-06-09 07:06:00 -04:00 committed by GitHub
parent 62d5eb4bc3
commit 53e2c5cc24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -305,8 +305,12 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
} }
}); });
// add spacer to center the nav buttons when window is small
Region rightSpacer = new Region();
HBox.setHgrow(rightSpacer, Priority.ALWAYS);
HBox primaryNav = new HBox(getLogoPane(), marketButton, getNavigationSpacer(), buyButton, getNavigationSpacer(), HBox primaryNav = new HBox(getLogoPane(), marketButton, getNavigationSpacer(), buyButton, getNavigationSpacer(),
sellButton, getNavigationSpacer(), portfolioButtonWithBadge, getNavigationSpacer(), fundsButton); sellButton, getNavigationSpacer(), portfolioButtonWithBadge, getNavigationSpacer(), fundsButton, rightSpacer);
primaryNav.setAlignment(Pos.CENTER_LEFT); primaryNav.setAlignment(Pos.CENTER_LEFT);
primaryNav.getStyleClass().add("nav-primary"); primaryNav.getStyleClass().add("nav-primary");