mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Synchronize layout model
This commit is contained in:
parent
d29614afcc
commit
a3cb5f2f42
2 changed files with 13 additions and 2 deletions
|
@ -32,7 +32,7 @@ public class AppLayoutComp extends Comp<CompStructure<Pane>> {
|
|||
model.getSelected())))));
|
||||
|
||||
var pane = new BorderPane();
|
||||
var sidebar = new SideMenuBarComp(model.getSelected(), model.getEntries());
|
||||
var sidebar = new SideMenuBarComp(model.getSelectedInternal(), model.getEntries());
|
||||
pane.setCenter(multi.createRegion());
|
||||
pane.setRight(sidebar.createRegion());
|
||||
pane.getStyleClass().add("background");
|
||||
|
|
|
@ -5,6 +5,7 @@ import io.xpipe.app.browser.BrowserModel;
|
|||
import io.xpipe.app.comp.DeveloperTabComp;
|
||||
import io.xpipe.app.comp.store.StoreLayoutComp;
|
||||
import io.xpipe.app.fxcomps.Comp;
|
||||
import io.xpipe.app.fxcomps.util.PlatformThread;
|
||||
import io.xpipe.app.prefs.AppPrefsComp;
|
||||
import io.xpipe.app.util.LicenseProvider;
|
||||
import javafx.beans.property.Property;
|
||||
|
@ -18,7 +19,6 @@ import lombok.extern.jackson.Jacksonized;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
public class AppLayoutModel {
|
||||
|
||||
@Data
|
||||
|
@ -48,13 +48,24 @@ public class AppLayoutModel {
|
|||
|
||||
@Getter
|
||||
private final SavedState savedState;
|
||||
@Getter
|
||||
private final List<Entry> entries;
|
||||
private final Property<Entry> selected;
|
||||
private final ObservableValue<Entry> selectedWrapper;
|
||||
|
||||
public AppLayoutModel(SavedState savedState) {
|
||||
this.savedState = savedState;
|
||||
this.entries = createEntryList();
|
||||
this.selected = new SimpleObjectProperty<>(entries.get(1));
|
||||
this.selectedWrapper = PlatformThread.sync(selected);
|
||||
}
|
||||
|
||||
public Property<Entry> getSelectedInternal() {
|
||||
return selected;
|
||||
}
|
||||
|
||||
public ObservableValue<Entry> getSelected() {
|
||||
return selectedWrapper;
|
||||
}
|
||||
|
||||
public void selectBrowser() {
|
||||
|
|
Loading…
Reference in a new issue