Skip to content

Commit

Permalink
Merge pull request #635 from dlsc-software-consulting-gmbh/enhancemen…
Browse files Browse the repository at this point in the history
…t-click-home-button

Update home button action in BottomMenuBar
  • Loading branch information
dlemmermann authored Jul 22, 2024
2 parents 9283f2f + 8f1153f commit bd8512c
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.dlsc.jfxcentral2.components.CustomToggleButton;
import com.dlsc.jfxcentral2.components.SizeSupport;
import com.dlsc.jfxcentral2.events.MobileLinkEvent;
import com.dlsc.jfxcentral2.mobile.pages.MobileHomePage;
import com.dlsc.jfxcentral2.model.Size;
import com.dlsc.jfxcentral2.utils.EventBusUtil;
import com.dlsc.jfxcentral2.utils.IkonUtil;
Expand Down Expand Up @@ -34,7 +35,14 @@ public BottomMenuBar() {
homeButton.setGraphic(new FontIcon(MaterialDesign.MDI_HOME));
homeButton.setMaxWidth(Double.MAX_VALUE);
homeButton.setUserData(PagePath.HOME);
homeButton.setOnAction(evt -> MobileLinkUtil.getToPage(PagePath.HOME));
homeButton.setOnMouseClicked(evt -> {
if (homeButton.isSelected()) {
// If the home page is being displayed, clicking homeButton will hide the search view and display the normal content.
MobileHomePage.getInstance().setContentType(MobileHomePage.ContentType.NORMAL);
} else {
MobileLinkUtil.getToPage(PagePath.HOME);
}
});
HBox.setHgrow(homeButton, Priority.ALWAYS);

CustomToggleButton linksWeekButton = new CustomToggleButton();
Expand Down

0 comments on commit bd8512c

Please sign in to comment.