mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-19 13:51:23 +00:00
Various fixes
This commit is contained in:
parent
1af837b02e
commit
ddac4cd402
|
@ -1,20 +1,16 @@
|
||||||
package io.xpipe.app.comp.base;
|
package io.xpipe.app.comp.base;
|
||||||
|
|
||||||
import io.xpipe.app.beacon.AppBeaconServer;
|
|
||||||
import io.xpipe.app.core.AppFont;
|
import io.xpipe.app.core.AppFont;
|
||||||
import io.xpipe.app.core.AppLayoutModel;
|
import io.xpipe.app.core.AppLayoutModel;
|
||||||
import io.xpipe.app.fxcomps.Comp;
|
import io.xpipe.app.fxcomps.Comp;
|
||||||
import io.xpipe.app.fxcomps.CompStructure;
|
import io.xpipe.app.fxcomps.CompStructure;
|
||||||
import io.xpipe.app.fxcomps.SimpleCompStructure;
|
import io.xpipe.app.fxcomps.SimpleCompStructure;
|
||||||
import io.xpipe.app.fxcomps.augment.Augment;
|
|
||||||
import io.xpipe.app.fxcomps.impl.IconButtonComp;
|
import io.xpipe.app.fxcomps.impl.IconButtonComp;
|
||||||
import io.xpipe.app.fxcomps.impl.StackComp;
|
import io.xpipe.app.fxcomps.impl.StackComp;
|
||||||
import io.xpipe.app.fxcomps.impl.TooltipAugment;
|
import io.xpipe.app.fxcomps.impl.TooltipAugment;
|
||||||
import io.xpipe.app.fxcomps.util.PlatformThread;
|
import io.xpipe.app.fxcomps.util.PlatformThread;
|
||||||
import io.xpipe.app.update.UpdateAvailableAlert;
|
import io.xpipe.app.update.UpdateAvailableAlert;
|
||||||
import io.xpipe.app.update.XPipeDistributionType;
|
import io.xpipe.app.update.XPipeDistributionType;
|
||||||
import io.xpipe.app.util.Hyperlinks;
|
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.beans.property.Property;
|
import javafx.beans.property.Property;
|
||||||
|
@ -65,7 +61,14 @@ public class SideMenuBarComp extends Comp<CompStructure<VBox>> {
|
||||||
var selected = PseudoClass.getPseudoClass("selected");
|
var selected = PseudoClass.getPseudoClass("selected");
|
||||||
for (int i = 0; i < entries.size(); i++) {
|
for (int i = 0; i < entries.size(); i++) {
|
||||||
var e = entries.get(i);
|
var e = entries.get(i);
|
||||||
var b = new IconButtonComp(e.icon(), () -> value.setValue(e));
|
var b = new IconButtonComp(e.icon(), () -> {
|
||||||
|
if (e.action() != null) {
|
||||||
|
e.action().run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
value.setValue(e);
|
||||||
|
});
|
||||||
var shortcut = e.combination();
|
var shortcut = e.combination();
|
||||||
if (shortcut != null) {
|
if (shortcut != null) {
|
||||||
b.apply(struc -> struc.get().getProperties().put("shortcut", shortcut));
|
b.apply(struc -> struc.get().getProperties().put("shortcut", shortcut));
|
||||||
|
@ -85,7 +88,7 @@ public class SideMenuBarComp extends Comp<CompStructure<VBox>> {
|
||||||
var indicator = Comp.empty().styleClass("indicator");
|
var indicator = Comp.empty().styleClass("indicator");
|
||||||
var stack = new StackComp(List.of(indicator, b)).apply(struc -> struc.get().setAlignment(Pos.CENTER_RIGHT));
|
var stack = new StackComp(List.of(indicator, b)).apply(struc -> struc.get().setAlignment(Pos.CENTER_RIGHT));
|
||||||
stack.apply(struc -> {
|
stack.apply(struc -> {
|
||||||
var indicatorRegion = (Region) struc.get().getChildren().get(0);
|
var indicatorRegion = (Region) struc.get().getChildren().getFirst();
|
||||||
indicatorRegion.setMaxWidth(7);
|
indicatorRegion.setMaxWidth(7);
|
||||||
indicatorRegion
|
indicatorRegion
|
||||||
.backgroundProperty()
|
.backgroundProperty()
|
||||||
|
@ -110,71 +113,6 @@ public class SideMenuBarComp extends Comp<CompStructure<VBox>> {
|
||||||
vbox.getChildren().add(stack.createRegion());
|
vbox.getChildren().add(stack.createRegion());
|
||||||
}
|
}
|
||||||
|
|
||||||
Augment<CompStructure<Button>> simpleBorders = struc -> {
|
|
||||||
struc.get()
|
|
||||||
.backgroundProperty()
|
|
||||||
.bind(Bindings.createObjectBinding(
|
|
||||||
() -> {
|
|
||||||
if (struc.get().isHover()) {
|
|
||||||
return hoverBorder.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
return noneBorder.get();
|
|
||||||
},
|
|
||||||
struc.get().hoverProperty(),
|
|
||||||
value,
|
|
||||||
hoverBorder,
|
|
||||||
selectedBorder,
|
|
||||||
noneBorder));
|
|
||||||
};
|
|
||||||
|
|
||||||
{
|
|
||||||
var b = new IconButtonComp("mdi2g-github", () -> Hyperlinks.open(Hyperlinks.GITHUB))
|
|
||||||
.tooltipKey("visitGithubRepository")
|
|
||||||
.apply(simpleBorders)
|
|
||||||
.accessibleTextKey("visitGithubRepository");
|
|
||||||
b.apply(struc -> {
|
|
||||||
AppFont.setSize(struc.get(), 2);
|
|
||||||
});
|
|
||||||
vbox.getChildren().add(b.createRegion());
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
var b = new IconButtonComp("mdi2d-discord", () -> Hyperlinks.open(Hyperlinks.DISCORD))
|
|
||||||
.tooltipKey("discord")
|
|
||||||
.apply(simpleBorders)
|
|
||||||
.accessibleTextKey("discord");
|
|
||||||
b.apply(struc -> {
|
|
||||||
AppFont.setSize(struc.get(), 2);
|
|
||||||
});
|
|
||||||
vbox.getChildren().add(b.createRegion());
|
|
||||||
}
|
|
||||||
|
|
||||||
// {
|
|
||||||
// var b = new IconButtonComp("mdi2t-translate", () -> Hyperlinks.open(Hyperlinks.TRANSLATE))
|
|
||||||
// .tooltipKey("translate")
|
|
||||||
// .apply(simpleBorders)
|
|
||||||
// .accessibleTextKey("translate");
|
|
||||||
// b.apply(struc -> {
|
|
||||||
// AppFont.setSize(struc.get(), 2);
|
|
||||||
// });
|
|
||||||
// vbox.getChildren().add(b.createRegion());
|
|
||||||
// }
|
|
||||||
|
|
||||||
{
|
|
||||||
var b = new IconButtonComp(
|
|
||||||
"mdi2c-code-json",
|
|
||||||
() -> Hyperlinks.open(
|
|
||||||
"http://localhost:" + AppBeaconServer.get().getPort()))
|
|
||||||
.tooltipKey("api")
|
|
||||||
.apply(simpleBorders)
|
|
||||||
.accessibleTextKey("api");
|
|
||||||
b.apply(struc -> {
|
|
||||||
AppFont.setSize(struc.get(), 2);
|
|
||||||
});
|
|
||||||
vbox.getChildren().add(b.createRegion());
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
var b = new IconButtonComp("mdi2u-update", () -> UpdateAvailableAlert.showIfNeeded())
|
var b = new IconButtonComp("mdi2u-update", () -> UpdateAvailableAlert.showIfNeeded())
|
||||||
.tooltipKey("updateAvailableTooltip")
|
.tooltipKey("updateAvailableTooltip")
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
package io.xpipe.app.core;
|
package io.xpipe.app.core;
|
||||||
|
|
||||||
|
import io.xpipe.app.beacon.AppBeaconServer;
|
||||||
import io.xpipe.app.browser.session.BrowserSessionComp;
|
import io.xpipe.app.browser.session.BrowserSessionComp;
|
||||||
import io.xpipe.app.browser.session.BrowserSessionModel;
|
import io.xpipe.app.browser.session.BrowserSessionModel;
|
||||||
import io.xpipe.app.comp.store.StoreLayoutComp;
|
import io.xpipe.app.comp.store.StoreLayoutComp;
|
||||||
import io.xpipe.app.fxcomps.Comp;
|
import io.xpipe.app.fxcomps.Comp;
|
||||||
import io.xpipe.app.prefs.AppPrefsComp;
|
import io.xpipe.app.prefs.AppPrefsComp;
|
||||||
|
import io.xpipe.app.util.Hyperlinks;
|
||||||
import io.xpipe.app.util.LicenseProvider;
|
import io.xpipe.app.util.LicenseProvider;
|
||||||
|
|
||||||
import javafx.beans.property.Property;
|
import javafx.beans.property.Property;
|
||||||
|
@ -75,22 +77,45 @@ public class AppLayoutModel {
|
||||||
AppI18n.observable("browser"),
|
AppI18n.observable("browser"),
|
||||||
"mdi2f-file-cabinet",
|
"mdi2f-file-cabinet",
|
||||||
new BrowserSessionComp(BrowserSessionModel.DEFAULT),
|
new BrowserSessionComp(BrowserSessionModel.DEFAULT),
|
||||||
|
null,
|
||||||
new KeyCodeCombination(KeyCode.DIGIT1, KeyCombination.CONTROL_DOWN)),
|
new KeyCodeCombination(KeyCode.DIGIT1, KeyCombination.CONTROL_DOWN)),
|
||||||
new Entry(
|
new Entry(
|
||||||
AppI18n.observable("connections"),
|
AppI18n.observable("connections"),
|
||||||
"mdi2c-connection",
|
"mdi2c-connection",
|
||||||
new StoreLayoutComp(),
|
new StoreLayoutComp(),
|
||||||
|
null,
|
||||||
new KeyCodeCombination(KeyCode.DIGIT2, KeyCombination.CONTROL_DOWN)),
|
new KeyCodeCombination(KeyCode.DIGIT2, KeyCombination.CONTROL_DOWN)),
|
||||||
new Entry(
|
new Entry(
|
||||||
AppI18n.observable("settings"),
|
AppI18n.observable("settings"),
|
||||||
"mdsmz-miscellaneous_services",
|
"mdsmz-miscellaneous_services",
|
||||||
new AppPrefsComp(),
|
new AppPrefsComp(),
|
||||||
|
null,
|
||||||
new KeyCodeCombination(KeyCode.DIGIT3, KeyCombination.CONTROL_DOWN)),
|
new KeyCodeCombination(KeyCode.DIGIT3, KeyCombination.CONTROL_DOWN)),
|
||||||
new Entry(
|
new Entry(
|
||||||
AppI18n.observable("explorePlans"),
|
AppI18n.observable("explorePlans"),
|
||||||
"mdi2p-professional-hexagon",
|
"mdi2p-professional-hexagon",
|
||||||
LicenseProvider.get().overviewPage(),
|
LicenseProvider.get().overviewPage(),
|
||||||
null)));
|
null,
|
||||||
|
null),
|
||||||
|
new Entry(
|
||||||
|
AppI18n.observable("visitGithubRepository"),
|
||||||
|
"mdi2g-github",
|
||||||
|
new AppPrefsComp(),
|
||||||
|
() -> Hyperlinks.open(Hyperlinks.GITHUB),
|
||||||
|
new KeyCodeCombination(KeyCode.DIGIT3, KeyCombination.CONTROL_DOWN)),
|
||||||
|
new Entry(
|
||||||
|
AppI18n.observable("discord"),
|
||||||
|
"mdi2d-discord",
|
||||||
|
new AppPrefsComp(),
|
||||||
|
() -> Hyperlinks.open(Hyperlinks.DISCORD),
|
||||||
|
new KeyCodeCombination(KeyCode.DIGIT3, KeyCombination.CONTROL_DOWN)),
|
||||||
|
new Entry(
|
||||||
|
AppI18n.observable("api"),
|
||||||
|
"mdi2c-code-json",
|
||||||
|
new AppPrefsComp(),
|
||||||
|
() -> Hyperlinks.open(
|
||||||
|
"http://localhost:" + AppBeaconServer.get().getPort()),
|
||||||
|
new KeyCodeCombination(KeyCode.DIGIT3, KeyCombination.CONTROL_DOWN))));
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,5 +128,5 @@ public class AppLayoutModel {
|
||||||
double browserConnectionsWidth;
|
double browserConnectionsWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
public record Entry(ObservableValue<String> name, String icon, Comp<?> comp, KeyCombination combination) {}
|
public record Entry(ObservableValue<String> name, String icon, Comp<?> comp, Runnable action, KeyCombination combination) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,10 +32,6 @@
|
||||||
-fx-padding: 1 0 9 9;
|
-fx-padding: 1 0 9 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.root:pretty .bookmarks-container {
|
|
||||||
-fx-effect: dropshadow(three-pass-box, -color-shadow-default, 2px, 0.25, 0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bookmarks-header {
|
.bookmarks-header {
|
||||||
-fx-min-height: 3.5em;
|
-fx-min-height: 3.5em;
|
||||||
-fx-pref-height: 3.5em;
|
-fx-pref-height: 3.5em;
|
||||||
|
|
|
@ -15,10 +15,6 @@
|
||||||
-fx-padding: 0 6 8 8;
|
-fx-padding: 0 6 8 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.root:pretty .browser .transfer {
|
|
||||||
-fx-effect: dropshadow(three-pass-box, -color-shadow-default, 2px, 0.25, 0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.transfer > * {
|
.transfer > * {
|
||||||
-fx-border-radius: 4;
|
-fx-border-radius: 4;
|
||||||
-fx-background-radius: 4;
|
-fx-background-radius: 4;
|
||||||
|
@ -239,11 +235,6 @@
|
||||||
-fx-border-color: -color-border-default;
|
-fx-border-color: -color-border-default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.root:pretty .browser .browser-content {
|
|
||||||
-fx-effect: dropshadow(three-pass-box, -color-shadow-default, 2px, 0.25, 0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.browser .browser-content-container {
|
.browser .browser-content-container {
|
||||||
-fx-padding: 0 10 7 0;
|
-fx-padding: 0 10 7 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
.scroll-bar:vertical {
|
.scroll-bar:vertical {
|
||||||
-fx-min-width: 6px;
|
-fx-min-width: 7px;
|
||||||
-fx-pref-width: 6px;
|
-fx-pref-width: 7px;
|
||||||
-fx-padding: 1;
|
-fx-padding: 1;
|
||||||
-fx-background-color: transparent;
|
-fx-background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue