mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-05-03 11:20:34 +00:00
Animate loading screen text a bit
This commit is contained in:
@@ -10,8 +10,12 @@ import io.xpipe.app.platform.ColorHelper;
|
||||
import io.xpipe.app.platform.PlatformThread;
|
||||
import io.xpipe.app.prefs.AppPrefs;
|
||||
|
||||
import io.xpipe.app.util.GlobalTimer;
|
||||
import javafx.animation.*;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.collections.ListChangeListener;
|
||||
import javafx.css.PseudoClass;
|
||||
import javafx.geometry.Pos;
|
||||
@@ -24,6 +28,8 @@ import javafx.scene.paint.Color;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.Window;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
public class AppMainWindowContentComp extends SimpleComp {
|
||||
|
||||
private final Stage stage;
|
||||
@@ -93,7 +99,22 @@ public class AppMainWindowContentComp extends SimpleComp {
|
||||
struc.get().setOpacity(0.65);
|
||||
});
|
||||
|
||||
var text = new LabelComp(AppMainWindow.getLoadingText());
|
||||
var loadingTextCounter = new SimpleIntegerProperty();
|
||||
GlobalTimer.scheduleUntil(Duration.ofMillis(300), false, () -> {
|
||||
if (loaded.getValue() != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
loadingTextCounter.set((loadingTextCounter.get() + 1) % 4);
|
||||
return false;
|
||||
});
|
||||
var loadingTextAnimated = Bindings.createStringBinding(() -> {
|
||||
return AppMainWindow.getLoadingText().getValue() + " " +
|
||||
(".".repeat(loadingTextCounter.get() + 1)) +
|
||||
(" ".repeat(3 - loadingTextCounter.get()));
|
||||
}, AppMainWindow.getLoadingText(), loadingTextCounter);
|
||||
var text = new LabelComp(loadingTextAnimated);
|
||||
text.styleClass("loading-text");
|
||||
text.apply(struc -> {
|
||||
struc.get().setOpacity(0.8);
|
||||
});
|
||||
|
||||
@@ -187,3 +187,8 @@
|
||||
.creation-menu.menu-button .separator {
|
||||
-fx-padding: 2 0;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
-fx-font-family: Roboto;
|
||||
}
|
||||
|
||||
|
||||
Generated
+14
-7
@@ -598,13 +598,20 @@ browseVaultButton=Browse vault
|
||||
vaultUsers=Vault users
|
||||
createHeapDump=Create heap dump
|
||||
createHeapDumpDescription=Dump memory contents to file to troubleshoot memory usage
|
||||
initializingApp=Loading connections ...
|
||||
checkingLicense=Checking license ...
|
||||
loadingGit=Syncing with git repo ...
|
||||
loadingGpg=Starting GnuPG daemon for git ...
|
||||
loadingSettings=Loading settings ...
|
||||
loadingConnections=Loading connections ...
|
||||
loadingUserInterface=Loading user interface ...
|
||||
#force
|
||||
initializingApp=Loading connections
|
||||
#force
|
||||
checkingLicense=Checking license
|
||||
#force
|
||||
loadingGit=Syncing with git repo
|
||||
#force
|
||||
loadingGpg=Starting GnuPG daemon for git
|
||||
#force
|
||||
loadingSettings=Loading settings
|
||||
#force
|
||||
loadingConnections=Loading connections
|
||||
#force
|
||||
loadingUserInterface=Loading user interface
|
||||
ptbNotice=Notice for the public test build
|
||||
userDeletionTitle=User deletion
|
||||
userDeletionContent=Do you want to delete this vault user? This will reencrypt all your personal identities and connection secrets using the vault key that is available to all users. XPipe will restart to apply the user changes.
|
||||
|
||||
Reference in New Issue
Block a user