Added (currently useless) comboBox to change your status
This commit is contained in:
parent
77f3db0ba3
commit
3e0b73ef12
@ -8,13 +8,14 @@ import javafx.scene.layout.VBox;
|
|||||||
import envoy.client.data.Settings;
|
import envoy.client.data.Settings;
|
||||||
import envoy.client.data.SettingsItem;
|
import envoy.client.data.SettingsItem;
|
||||||
import envoy.client.event.ThemeChangeEvent;
|
import envoy.client.event.ThemeChangeEvent;
|
||||||
|
import envoy.data.User.UserStatus;
|
||||||
import envoy.event.EventBus;
|
import envoy.event.EventBus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project: <strong>envoy-client</strong><br>
|
* Project: <strong>envoy-client</strong><br>
|
||||||
* File: <strong>GeneralSettingsPane.java</strong><br>
|
* File: <strong>GeneralSettingsPane.java</strong><br>
|
||||||
* Created: <strong>18.04.2020</strong><br>
|
* Created: <strong>18.04.2020</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy Client v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
@ -27,7 +28,7 @@ public class GeneralSettingsPane extends SettingsPane {
|
|||||||
*/
|
*/
|
||||||
public GeneralSettingsPane() {
|
public GeneralSettingsPane() {
|
||||||
super("General");
|
super("General");
|
||||||
var vbox = new VBox();
|
final var vbox = new VBox();
|
||||||
|
|
||||||
// TODO: Support other value types
|
// TODO: Support other value types
|
||||||
List.of("onCloseMode", "enterToSend")
|
List.of("onCloseMode", "enterToSend")
|
||||||
@ -36,7 +37,7 @@ public class GeneralSettingsPane extends SettingsPane {
|
|||||||
.map(i -> new SettingsCheckbox((SettingsItem<Boolean>) i))
|
.map(i -> new SettingsCheckbox((SettingsItem<Boolean>) i))
|
||||||
.forEach(vbox.getChildren()::add);
|
.forEach(vbox.getChildren()::add);
|
||||||
|
|
||||||
var combobox = new ComboBox<String>();
|
final var combobox = new ComboBox<String>();
|
||||||
combobox.getItems().add("dark");
|
combobox.getItems().add("dark");
|
||||||
combobox.getItems().add("light");
|
combobox.getItems().add("light");
|
||||||
combobox.setValue(settings.getCurrentTheme());
|
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())); });
|
e -> { settings.setCurrentTheme(combobox.getValue()); EventBus.getInstance().dispatch(new ThemeChangeEvent(combobox.getValue())); });
|
||||||
vbox.getChildren().add(combobox);
|
vbox.getChildren().add(combobox);
|
||||||
|
|
||||||
|
final var statusComboBox = new ComboBox<UserStatus>();
|
||||||
|
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);
|
getChildren().add(vbox);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user