Skip to content

Commit

Permalink
fixed wrong size of the label in case the sidebar is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
torakiki committed Nov 27, 2023
1 parent e3f799e commit 84e6343
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -20,6 +20,7 @@

import jakarta.inject.Inject;
import javafx.geometry.Orientation;
import javafx.scene.control.ContentDisplay;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Separator;
Expand Down Expand Up @@ -64,7 +65,8 @@ public VerticalSidebar(HomeContentItem homeItem, LogButton logButton, NewsButton
addButton(homeItem, expandButton);
var toolsLabel = new Label(i18n().tr("Tools").toUpperCase());
toolsLabel.getStyleClass().add("sidebar-title");
toolsLabel.visibleProperty().bind(expandButton.selectedProperty());
toolsLabel.contentDisplayProperty()
.bind(expandButton.selectedProperty().map(b -> b ? ContentDisplay.LEFT : ContentDisplay.GRAPHIC_ONLY));
buttons.getChildren().addAll(new Separator(Orientation.HORIZONTAL), toolsLabel);
tools.getChildren().forEach(b -> {
if (b instanceof SidebarButton button) {
Expand Down

0 comments on commit 84e6343

Please sign in to comment.