From b95358685916f24e9cb64af3dfafc94eae5141c0 Mon Sep 17 00:00:00 2001 From: delvh Date: Tue, 9 Jun 2020 21:03:19 +0200 Subject: [PATCH] Added (currently useless) comboBox to change your status --- .../client/ui/settings/GeneralSettingsPane.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/envoy/client/ui/settings/GeneralSettingsPane.java b/src/main/java/envoy/client/ui/settings/GeneralSettingsPane.java index 12cbaf5..e6d5761 100644 --- a/src/main/java/envoy/client/ui/settings/GeneralSettingsPane.java +++ b/src/main/java/envoy/client/ui/settings/GeneralSettingsPane.java @@ -8,13 +8,14 @@ import javafx.scene.layout.VBox; import envoy.client.data.Settings; import envoy.client.data.SettingsItem; import envoy.client.event.ThemeChangeEvent; +import envoy.data.User.UserStatus; import envoy.event.EventBus; /** * Project: envoy-client
* File: GeneralSettingsPane.java
* Created: 18.04.2020
- * + * * @author Kai S. K. Engelbart * @since Envoy Client v0.1-beta */ @@ -27,7 +28,7 @@ public class GeneralSettingsPane extends SettingsPane { */ public GeneralSettingsPane() { super("General"); - var vbox = new VBox(); + final var vbox = new VBox(); // TODO: Support other value types List.of("onCloseMode", "enterToSend") @@ -36,7 +37,7 @@ public class GeneralSettingsPane extends SettingsPane { .map(i -> new SettingsCheckbox((SettingsItem) i)) .forEach(vbox.getChildren()::add); - var combobox = new ComboBox(); + final var combobox = new ComboBox(); combobox.getItems().add("dark"); combobox.getItems().add("light"); combobox.setValue(settings.getCurrentTheme()); @@ -44,6 +45,13 @@ public class GeneralSettingsPane extends SettingsPane { e -> { settings.setCurrentTheme(combobox.getValue()); EventBus.getInstance().dispatch(new ThemeChangeEvent(combobox.getValue())); }); vbox.getChildren().add(combobox); + final var statusComboBox = new ComboBox(); + statusComboBox.getItems().setAll(UserStatus.values()); + statusComboBox.setValue(UserStatus.ONLINE); + // TODO add action when value is changed + statusComboBox.setOnAction(e -> {}); + vbox.getChildren().add(statusComboBox); + getChildren().add(vbox); } }