diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopColorPickerView.java b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopColorPickerView.java index ae8537d032e7bb6c73892f129c1179d653b12574..c2b57535204595628082269752c93692a238b7eb 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopColorPickerView.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopColorPickerView.java @@ -35,7 +35,6 @@ public class DesktopColorPickerView implements Consumer<DisplayableColor>, Event colorChooser = new PopOver(); colorChooser.setContentNode(root); colorChooser.setDetachable(false); - colorChooser.setOnHiding(e -> colorChooser = null); colorChooser.setCornerRadius(5); colorChooser.setArrowLocation(ArrowLocation.TOP_CENTER); } diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMenuToolbarViewController.java b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMenuToolbarViewController.java index 88164893c6a00bb18cbfd8dde5837d8dd8b55b65..c49c28a245fc65fc4cde1f8e990995bd4294fae2 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMenuToolbarViewController.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMenuToolbarViewController.java @@ -180,11 +180,13 @@ public class DesktopMenuToolbarViewController extends BasicMenuToolbarViewContro { GlobalDesign design = Profile.currentProfile().currentLayout(); if (design instanceof ColorModeHandler) { - colorPickerView = new DesktopColorPickerView((ColorModeHandler) design); - colorPickerView.show(colorButton); + if (colorPickerView == null) { + colorPickerView = new DesktopColorPickerView((ColorModeHandler) design); - // Add Listener for Pads - mainViewController.addListenerForPads(colorPickerView, MouseEvent.MOUSE_CLICKED); + // Add Listener for Pads + mainViewController.addListenerForPads(colorPickerView, MouseEvent.MOUSE_CLICKED); + } + colorPickerView.show(colorButton); } }); editButtons.getButtons().addAll(playButton, dragButton, pageButton, colorButton); diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java index 4b3c8b858131dd24d0ca4e9d57e33d7253e46f61..b8fdb172e2c2cce67d84ec122761059193ad08d4 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/pad/DesktopPadView.java @@ -143,7 +143,7 @@ public class DesktopPadView implements IPadView { previewContent = connect.getPadContentPreview(pad, preview); Node node = previewContent.getNode(); - node.getStyleClass().addAll("pad-title", "pad" + pad.getIndex() + "-title"); + node.getStyleClass().addAll("pad-title", "pad" + pad.getPadIndex() + "-title"); // Copy Pseudoclasses for (PseudoClass pseudoClass : superRoot.getPseudoClassStates()) { @@ -160,7 +160,7 @@ public class DesktopPadView implements IPadView { } EmptyPadView view = new EmptyPadView(preview); if (pad != null) { - view.getStyleClass().addAll("pad-title", "pad" + pad.getIndex() + "-title"); + view.getStyleClass().addAll("pad-title", "pad" + pad.getPadIndex() + "-title"); } else { view.getStyleClass().addAll("pad-title"); } @@ -337,7 +337,7 @@ public class DesktopPadView implements IPadView { @Override public void removeStyleClasses() { Pad pad = getViewController().getPad(); - int index = pad.getIndex(); + PadIndex index = pad.getPadIndex(); superRoot.getStyleClass().removeAll("pad", "pad" + index); diff --git a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java index ac2e99faf82ec682bed7e7fb4f0636a07f259deb..ad69f4465f44e6aa330b12a0b945d55412605035 100644 --- a/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java +++ b/PlayWall/src/de/tobias/playpad/layout/touch/TouchPadView.java @@ -251,7 +251,7 @@ public class TouchPadView implements IPadView { @Override public void removeStyleClasses() { Pad pad = getViewController().getPad(); - int index = pad.getIndex(); + PadIndex index = pad.getPadIndex(); superRoot.getStyleClass().removeAll("pad", "pad" + index); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewController.java index c16a3acc5d18b2b3237cc7991cb85a6c6da7a061..d1b217aa04b3f059ac2891291cf4f2b688b861f9 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewController.java @@ -84,7 +84,7 @@ public class MainViewController extends ViewController implements IMainViewContr private MenuToolbarViewController menuToolbarViewController; private Project openProject; - private int currentPageShowing = -1; + private int currentPageShowing = 0; // Mapper private Midi midi; @@ -377,13 +377,14 @@ public class MainViewController extends ViewController implements IMainViewContr public void openProject(Project project) { removePadsFromView(); - if (project != null) + if (openProject != null) removePadsFromView(); openProject = project; midiHandler.setProject(project); keyboardHandler.setProject(project); + Profile.currentProfile().getMappings().getActiveMapping().showFeedback(openProject); midiHandler.setProject(project); keyboardHandler.setProject(project); @@ -504,6 +505,7 @@ public class MainViewController extends ViewController implements IMainViewContr if (menuToolbarViewController != null) { menuToolbarViewController.highlightPageButton(page); } + loadUserCss(); return true; } @@ -548,14 +550,16 @@ public class MainViewController extends ViewController implements IMainViewContr Worker.runLater(() -> { loadMidiDevice(profileSettings.getMidiDevice()); - Profile.currentProfile().getMappings().getActiveMapping().adjustPadColorToMapper(); - + Platform.runLater(() -> { // Handle Mapper - if (Profile.currentProfile() != null) { + if (currentProfile != null) { activeMapping.initFeedback(); - activeMapping.showFeedback(openProject); + if (openProject != null) { + activeMapping.showFeedback(openProject); + currentProfile.getMappings().getActiveMapping().adjustPadColorToMapper(); + } } }); }); @@ -671,10 +675,13 @@ public class MainViewController extends ViewController implements IMainViewContr // design spezific css if (openProject != null) { - Profile.currentProfile().currentLayout().applyCssMainView(this, getStage(), openProject); + Profile currentProfile = Profile.currentProfile(); + currentProfile.currentLayout().applyCssMainView(this, getStage(), openProject); + + Mapping activeMapping = currentProfile.getMappings().getActiveMapping(); + activeMapping.adjustPadColorToMapper(); + activeMapping.showFeedback(openProject); } - - Profile.currentProfile().getMappings().getActiveMapping().adjustPadColorToMapper(); } /**