mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-05-03 11:20:34 +00:00
Rework workspaces
This commit is contained in:
@@ -52,7 +52,7 @@ public class WorkspaceManager {
|
||||
var d = AppProperties.get().getDataDir();
|
||||
var existing = workspaces.stream().filter(workspace -> workspace.getDir().equals(d)).findFirst();
|
||||
if (existing.isEmpty()) {
|
||||
var name = d.getFileName().toString().startsWith(".xpipe") ? "Default" : d.getFileName().toString();
|
||||
var name = d.getFileName().toString().equals(".xpipe") ? "Default" : d.getFileName().toString().equals(".xpipe-ptb") ? "PTB": d.getFileName().toString();
|
||||
current = new WorkspaceEntry(name, d);
|
||||
workspaces.addFirst(current);
|
||||
} else {
|
||||
|
||||
@@ -6,6 +6,7 @@ import io.xpipe.app.comp.base.ListBoxViewComp;
|
||||
import io.xpipe.app.comp.base.TileButtonComp;
|
||||
import io.xpipe.app.comp.base.VerticalComp;
|
||||
import io.xpipe.app.core.AppI18n;
|
||||
import io.xpipe.app.util.LicenseProvider;
|
||||
import javafx.beans.property.ReadOnlyStringWrapper;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.scene.layout.Region;
|
||||
@@ -38,6 +39,7 @@ public class WorkspaceOverviewComp extends SimpleRegionBuilder {
|
||||
});
|
||||
addButton.setIconSize(1.0);
|
||||
addButton.maxWidth(2000);
|
||||
addButton.disable(!LicenseProvider.get().getFeature("workspaces").isSupported());
|
||||
var vbox = new VerticalComp(List.of(box, RegionBuilder.hseparator(), addButton));
|
||||
vbox.spacing(10);
|
||||
return vbox.build();
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.xpipe.app.comp.base.ButtonComp;
|
||||
import io.xpipe.app.core.AppI18n;
|
||||
import io.xpipe.app.platform.LabelGraphic;
|
||||
import io.xpipe.app.platform.OptionsBuilder;
|
||||
import io.xpipe.app.util.DocumentationLink;
|
||||
import io.xpipe.app.util.LicenseProvider;
|
||||
|
||||
public class WorkspacesCategory extends AppPrefsCategory {
|
||||
@@ -25,9 +26,9 @@ public class WorkspacesCategory extends AppPrefsCategory {
|
||||
.title("manageWorkspaces")
|
||||
.sub(new OptionsBuilder()
|
||||
.nameAndDescription("workspaceManagement")
|
||||
.documentationLink(DocumentationLink.WORKSPACES)
|
||||
.licenseRequirement("workspaces")
|
||||
.addComp(new WorkspaceOverviewComp().maxWidth(getCompWidth())))
|
||||
.disable(!LicenseProvider.get().getFeature("workspaces").isSupported())
|
||||
.buildComp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ public enum DocumentationLink {
|
||||
SHELL_ENVIRONMENTS_USER("guide/environments#users"),
|
||||
SHELL_ENVIRONMENTS_SCRIPTS("guide/environments#scripts"),
|
||||
SERIAL("guide/serial"),
|
||||
WORKSPACES("guide/workspaces"),
|
||||
ICONS("guide/hub#icons"),
|
||||
ONE_PASSWORD_KEYS("guide/password-manager#key-format"),
|
||||
GNOME_WAYLAND_SCALING("troubleshoot/wayland-blur"),
|
||||
|
||||
Reference in New Issue
Block a user