Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
teletha committed Jan 28, 2024
1 parent d7e20e4 commit 573959e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/viewtify/Viewtify.java
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ private synchronized void initializeOnlyOnce(Class applicationClass) {
checkHeadlessMode();

// Configure the directory of application's preference
String prefs = ".preferences for " + applicationClass.getSimpleName().toLowerCase();
String prefs = "." + applicationClass.getSimpleName().toLowerCase();
I.env("PreferenceDirectory", prefs);

// Configure the directory of user's preference
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/viewtify/ui/dock/DockSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.stage.WindowEvent;

import kiss.I;
import kiss.Managed;
import kiss.Signal;
Expand All @@ -57,6 +58,8 @@
import kiss.Storable;
import kiss.Variable;
import kiss.WiseConsumer;
import kiss.WiseRunnable;
import psychopath.Locator;
import viewtify.Viewtify;
import viewtify.ui.UILabel;
import viewtify.ui.UIPane;
Expand Down Expand Up @@ -296,6 +299,25 @@ private static void openNewWindow(RootArea area, Bounds bounds, EventHandler<Win
/** The registered menu builders. */
static final List<WiseConsumer<UILabel>> menuBuilders = new ArrayList();

/**
* Register the layout.
*
* @param defaultLayout
*/
public static void registerLayout(WiseRunnable defaultLayout) {
Objects.requireNonNull(defaultLayout);

DockLayout layout = layout();
System.out.println(layout.locate());
System.out.println(Locator.file(layout.locate()).isAbsent());
if (Locator.file(layout.locate()).isAbsent()) {
// use default setup
defaultLayout.run();
} else {

}
}

/**
* Register the menu on tab header.
*
Expand Down

0 comments on commit 573959e

Please sign in to comment.