Animate loading screen text a bit

This commit is contained in:
crschnick
2025-12-01 06:52:43 +00:00
parent d5409ee97f
commit e45c691992
3 changed files with 41 additions and 8 deletions
@@ -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;
}
+14 -7
View File
@@ -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.