diff options
| author | Kostya <mail@sartin.in> | 2026-10-13 13:14:50 +0300 |
|---|---|---|
| committer | Kostya <mail@sartin.in> | 2026-10-13 13:15:15 +0300 |
| commit | c0e134981cb494f12c72fbbd3e5c4de513327520 (patch) | |
| tree | 8b073a9bbca4c975a1eb0bc1237b49e6b98fdc77 /ui-fx/src/main/resources/market/guess | |
| parent | a8bc9dce528abb6340315f7daa61ad76be4a8739 (diff) | |
| download | guess-market-c0e134981cb494f12c72fbbd3e5c4de513327520.tar.gz guess-market-c0e134981cb494f12c72fbbd3e5c4de513327520.tar.xz guess-market-c0e134981cb494f12c72fbbd3e5c4de513327520.zip | |
ui-fx: support running as one logged-in user of a server
The shared UI assumed the whole market was local: it showed nothing
until a file was loaded, let the user act as anyone in the list and
offered to create events by hand. None of that holds for a client of a
shared server.
AppState and AppView now take an optional session user. When it is set:
- the tabs show from the start, since other users' events are there
whether or not we loaded a file ourselves;
- the acting user is fixed, and the user list becomes a directory of
the other users with their balance and role;
- the buttons that create events are hidden, and the Users tab gets a
Deposit Funds button with a small dialog;
- loading a file skips the two-second pause Ex2 asked for.
Without a session user everything behaves as before.
Also keep the event's Trade and Close buttons from collapsing to an
ellipsis when the description is long.
Diffstat (limited to 'ui-fx/src/main/resources/market/guess')
4 files changed, 52 insertions, 4 deletions
diff --git a/ui-fx/src/main/resources/market/guess/ui/desktop/app_view.fxml b/ui-fx/src/main/resources/market/guess/ui/desktop/app_view.fxml index 855b787..3a34a7e 100644 --- a/ui-fx/src/main/resources/market/guess/ui/desktop/app_view.fxml +++ b/ui-fx/src/main/resources/market/guess/ui/desktop/app_view.fxml | |||
| @@ -143,6 +143,7 @@ | |||
| 143 | <fx:include fx:id="loadDialog" managed="false" source="controllers/dialog_load.fxml" visible="false" /> | 143 | <fx:include fx:id="loadDialog" managed="false" source="controllers/dialog_load.fxml" visible="false" /> |
| 144 | <fx:include fx:id="createEventDialog" managed="false" source="controllers/dialog_create_event.fxml" visible="false" /> | 144 | <fx:include fx:id="createEventDialog" managed="false" source="controllers/dialog_create_event.fxml" visible="false" /> |
| 145 | <fx:include fx:id="resolveDialog" managed="false" source="controllers/dialog_resolve.fxml" visible="false" /> | 145 | <fx:include fx:id="resolveDialog" managed="false" source="controllers/dialog_resolve.fxml" visible="false" /> |
| 146 | <fx:include fx:id="depositDialog" managed="false" source="controllers/dialog_deposit.fxml" visible="false" /> | ||
| 146 | </children> | 147 | </children> |
| 147 | </StackPane> | 148 | </StackPane> |
| 148 | <StackPane fx:id="toastContainer" mouseTransparent="true" pickOnBounds="false"> | 149 | <StackPane fx:id="toastContainer" mouseTransparent="true" pickOnBounds="false"> |
diff --git a/ui-fx/src/main/resources/market/guess/ui/desktop/controllers/dialog_deposit.fxml b/ui-fx/src/main/resources/market/guess/ui/desktop/controllers/dialog_deposit.fxml new file mode 100644 index 0000000..8f7076d --- /dev/null +++ b/ui-fx/src/main/resources/market/guess/ui/desktop/controllers/dialog_deposit.fxml | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | |||
| 3 | <?import javafx.geometry.Insets?> | ||
| 4 | <?import javafx.scene.control.Button?> | ||
| 5 | <?import javafx.scene.control.Label?> | ||
| 6 | <?import javafx.scene.control.TextField?> | ||
| 7 | <?import javafx.scene.layout.HBox?> | ||
| 8 | <?import javafx.scene.layout.Region?> | ||
| 9 | <?import javafx.scene.layout.StackPane?> | ||
| 10 | <?import javafx.scene.layout.VBox?> | ||
| 11 | |||
| 12 | <StackPane styleClass="gm-modal-scrim" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="market.guess.ui.desktop.controllers.DepositDialogController"> | ||
| 13 | <children> | ||
| 14 | <VBox maxHeight="-Infinity" maxWidth="-Infinity" prefWidth="400.0" styleClass="gm-card" StackPane.alignment="CENTER"> | ||
| 15 | <children> | ||
| 16 | <HBox alignment="CENTER_LEFT" styleClass="gm-divider-bottom"> | ||
| 17 | <padding> | ||
| 18 | <Insets bottom="16.0" left="20.0" right="20.0" top="16.0" /> | ||
| 19 | </padding> | ||
| 20 | <children> | ||
| 21 | <Label styleClass="gm-text-lg, gm-font-bold, gm-text-ink" text="Deposit funds" /> | ||
| 22 | </children> | ||
| 23 | </HBox> | ||
| 24 | <VBox spacing="8.0"> | ||
| 25 | <padding> | ||
| 26 | <Insets bottom="18.0" left="20.0" right="20.0" top="18.0" /> | ||
| 27 | </padding> | ||
| 28 | <children> | ||
| 29 | <Label styleClass="gm-text-base, gm-font-medium, gm-text-ink2" text="Amount to add to your account" /> | ||
| 30 | <TextField fx:id="amountField" onAction="#handleConfirm" promptText="100.00" styleClass="gm-textfield, gm-textfield-mono" /> | ||
| 31 | </children> | ||
| 32 | </VBox> | ||
| 33 | <HBox alignment="CENTER_LEFT" spacing="9.0" styleClass="gm-divider-top"> | ||
| 34 | <padding> | ||
| 35 | <Insets bottom="14.0" left="20.0" right="20.0" top="14.0" /> | ||
| 36 | </padding> | ||
| 37 | <children> | ||
| 38 | <Region HBox.hgrow="ALWAYS" /> | ||
| 39 | <Button onAction="#handleCancel" styleClass="gm-btn, gm-btn-secondary" text="Cancel" /> | ||
| 40 | <Button fx:id="confirmBtn" disable="true" onAction="#handleConfirm" styleClass="gm-btn, gm-btn-primary" text="Deposit" /> | ||
| 41 | </children> | ||
| 42 | </HBox> | ||
| 43 | </children> | ||
| 44 | </VBox> | ||
| 45 | </children> | ||
| 46 | </StackPane> | ||
diff --git a/ui-fx/src/main/resources/market/guess/ui/desktop/controllers/events_tab.fxml b/ui-fx/src/main/resources/market/guess/ui/desktop/controllers/events_tab.fxml index 4e2c1d4..19b5e61 100644 --- a/ui-fx/src/main/resources/market/guess/ui/desktop/controllers/events_tab.fxml +++ b/ui-fx/src/main/resources/market/guess/ui/desktop/controllers/events_tab.fxml | |||
| @@ -61,7 +61,7 @@ | |||
| 61 | <children> | 61 | <children> |
| 62 | <Label fx:id="eventCountLabel" styleClass="gm-text-sm, gm-font-regular, gm-text-ink2" text="0 of 0 events shown" /> | 62 | <Label fx:id="eventCountLabel" styleClass="gm-text-sm, gm-font-regular, gm-text-ink2" text="0 of 0 events shown" /> |
| 63 | <Region HBox.hgrow="ALWAYS" /> | 63 | <Region HBox.hgrow="ALWAYS" /> |
| 64 | <Button onAction="#handleNewEvent" styleClass="gm-btn, gm-btn-secondary" text="+ New Event" /> | 64 | <Button fx:id="newEventBtn" onAction="#handleNewEvent" styleClass="gm-btn, gm-btn-secondary" text="+ New Event" /> |
| 65 | </children> | 65 | </children> |
| 66 | </HBox> | 66 | </HBox> |
| 67 | </children> | 67 | </children> |
| @@ -85,8 +85,8 @@ | |||
| 85 | </VBox> | 85 | </VBox> |
| 86 | <HBox spacing="7.0"> | 86 | <HBox spacing="7.0"> |
| 87 | <children> | 87 | <children> |
| 88 | <Button fx:id="openEventBtn" onAction="#handleOpenEvent" styleClass="gm-btn, gm-btn-primary" text="Open Event" /> | 88 | <Button fx:id="openEventBtn" minWidth="-Infinity" onAction="#handleOpenEvent" styleClass="gm-btn, gm-btn-primary" text="Open Event" /> |
| 89 | <Button fx:id="closeEventBtn" onAction="#handleCloseEvent" styleClass="gm-btn, gm-btn-secondary" text="Close & Resolveā¦" /> | 89 | <Button fx:id="closeEventBtn" minWidth="-Infinity" onAction="#handleCloseEvent" styleClass="gm-btn, gm-btn-secondary" text="Close & Resolveā¦" /> |
| 90 | </children> | 90 | </children> |
| 91 | </HBox> | 91 | </HBox> |
| 92 | </children> | 92 | </children> |
diff --git a/ui-fx/src/main/resources/market/guess/ui/desktop/controllers/users_tab.fxml b/ui-fx/src/main/resources/market/guess/ui/desktop/controllers/users_tab.fxml index 0a8ee3b..abc03e5 100644 --- a/ui-fx/src/main/resources/market/guess/ui/desktop/controllers/users_tab.fxml +++ b/ui-fx/src/main/resources/market/guess/ui/desktop/controllers/users_tab.fxml | |||
| @@ -36,7 +36,8 @@ | |||
| 36 | <!-- Virtualized Users List --> | 36 | <!-- Virtualized Users List --> |
| 37 | <ListView fx:id="userListContainer" styleClass="gm-scroll-transparent, gm-list-view" VBox.vgrow="ALWAYS" /> | 37 | <ListView fx:id="userListContainer" styleClass="gm-scroll-transparent, gm-list-view" VBox.vgrow="ALWAYS" /> |
| 38 | <!-- Create Event Button --> | 38 | <!-- Create Event Button --> |
| 39 | <Button maxWidth="1.7976931348623157E308" onAction="#handleCreateNewEvent" styleClass="gm-btn, gm-btn-primary" text="+ Create New Event" /> | 39 | <Button fx:id="createEventBtn" maxWidth="1.7976931348623157E308" onAction="#handleCreateNewEvent" styleClass="gm-btn, gm-btn-primary" text="+ Create New Event" /> |
| 40 | <Button fx:id="depositBtn" maxWidth="1.7976931348623157E308" onAction="#handleDeposit" styleClass="gm-btn, gm-btn-primary" text="Deposit Funds" /> | ||
| 40 | </children> | 41 | </children> |
| 41 | </VBox> | 42 | </VBox> |
| 42 | <!-- Right Card: User Details --> | 43 | <!-- Right Card: User Details --> |