Skip to content

Commit

Permalink
Embedded worksheet buttons in a Toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
fthevenet committed Mar 12, 2019
1 parent 8058197 commit a5affd6
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 107 deletions.
4 changes: 2 additions & 2 deletions UNRELEASED.md
Expand Up @@ -20,10 +20,10 @@
* Icons for buttons that remove sources/worksheets have been changed from a cross to a bin, to emphasise the
fact that the action will irreversibly remove something and not simply dismiss a dialog/pane.
* Remove source/worksheet buttons are now hidden until the control is set to "edit mode".
* Worksheets buttons can now overflow to a menu pane if there is not enough space to display all of them.

* _[New]_ Added support for small numbers unit prefix (m = milli, µ = micro, n = nano, etc...) for formatting Y axis
values.
* _[Fixed]_ A memory leak that occurs when adding, moving or changing the type of a chart in an existing worksheet.
* _[Fixed]_ Uncaught exception when entering a negative range for a chart's Y axis causes a worksheet to become
* _[Fixed]_ Keyboard shortcuts do no work on detached tab windows.
unresponsive.
* _[Fixed]_ Keyboard shortcuts do no work on detached tab windows.
Expand Up @@ -102,7 +102,6 @@ public class MainViewController implements Initializable {
private static final int ANIMATION_DURATION = 50;
public AnchorPane sourcePane;
public MenuItem hideSourcePaneMenu;
public MenuItem toggleTableViewButton;

private Workspace workspace;
private final Map<EditableTab, WorksheetController> seriesControllers = new WeakHashMap<>();
Expand Down
Expand Up @@ -126,9 +126,9 @@ public class WorksheetController implements Initializable, AutoCloseable {
@FXML
private Button refreshButton;
@FXML
private MenuItem snapshotButton;
private Button snapshotButton;
@FXML
private MenuItem toggleTableViewButton;
private Button toggleTableViewButton;
@FXML
private ToggleButton vCrosshair;
@FXML
Expand All @@ -140,7 +140,7 @@ public class WorksheetController implements Initializable, AutoCloseable {
@FXML
private ContextMenu seriesListMenu;
@FXML
private Menu selectChartLayout;
private MenuButton selectChartLayout;
@FXML
private TimeRangePicker timeRangePicker;
@FXML
Expand Down Expand Up @@ -311,7 +311,7 @@ private void initChartViewPorts() throws IOException {
viewPorts.add(new ChartViewPort(currentChart, viewPort, buildChartPropertiesController(currentChart)));
}

bindingManager.bind(selectChartLayout.visibleProperty(), Bindings.createBooleanBinding(() -> worksheet.getCharts().size() > 1, worksheet.getCharts()));
bindingManager.bind(selectChartLayout.disableProperty(), Bindings.createBooleanBinding(() -> worksheet.getCharts().size() > 1, worksheet.getCharts()).not());
selectChartLayout.getItems().setAll(Arrays.stream(ChartLayout.values()).map(chartLayout -> {
MenuItem item = new MenuItem(chartLayout.toString());
item.setOnAction(bindingManager.registerHandler(event -> worksheet.setChartLayout(chartLayout)));
Expand Down
9 changes: 9 additions & 0 deletions binjr-core/src/main/resources/eu/binjr/css/Common.css
Expand Up @@ -17,4 +17,13 @@
.context-menu * {
-icon-scale-x: 2.5;
-icon-scale-y: 2.5;
}

.tool-bar{
-fx-padding: 0;
-fx-background-color: none;
}

.tool-bar-overflow-button {
-fx-padding: 12,0,0,0;
}
4 changes: 4 additions & 0 deletions binjr-core/src/main/resources/eu/binjr/css/Dark.css
Expand Up @@ -1598,4 +1598,8 @@
}
.auto-complete-popup > .list-view > .placeholder > .label {
-fx-text-fill: derive(-fx-control-inner-background,-30%);
}

.tool-bar {
-fx-spacing: 0;
}
4 changes: 4 additions & 0 deletions binjr-core/src/main/resources/eu/binjr/css/Light.css
Expand Up @@ -1473,3 +1473,7 @@
-fx-font-family: Consolas, Monospace;
-fx-fill: DARKRED;
}

.tool-bar {
-fx-spacing: 0;
}

0 comments on commit a5affd6

Please sign in to comment.