Show Lumi's chat loading on the same loading screen as other apps
Lumi still drew a line of text over a bare progress bar while it measured its chat. Use the shared loading screen with Lumi's mark and name, the loading message and the measured rows as progress.
This commit is contained in:
1 parent
0acdc75398
commit
7ec840260e
1 file changed
+12
-15
+12
-15
@@ -31,6 +31,7 @@
|
||||
#import, file "../apps/package_files.zi";
|
||||
#import, file "../apps/module_host.zi";
|
||||
#import, file "../app/smooth_frames.zi";
|
||||
#import "kryon/loading_screen"
|
||||
#import, file "../apps/app_codec.zi";
|
||||
#import "widget_host"
|
||||
#import "hosted_values"
|
||||
@@ -1014,22 +1015,18 @@ LumiRowsMeasure :: () -> bool {
|
||||
}
|
||||
|
||||
// Shown while a long chat is still being measured: how far it has come.
|
||||
// The loading screen every app shows: Lumi's mark and name, with the chat
|
||||
// rows measured so far as its progress.
|
||||
LumiDrawLoading :: (app: *InnerBreeze) {
|
||||
column := CenteredColumnFor(app.ui.view_width, AppScale(320), AppScale(24))
|
||||
middle := (app.ui.view_height - app_content_bottom_reserved(app)) / 2
|
||||
Text(app.ui.session, TextProps.{.key = KeyHash("inbe/lumi/loading"),
|
||||
.text = LocaleText("lumi_loading"), .font = AppFontSize(),
|
||||
.bounds = Rectangle.{cast(float32)column.x, cast(float32)(middle - AppScale(32)),
|
||||
cast(float32)column.width, cast(float32)AppScale(24)},
|
||||
.align = cast(TextAlign)TextAlignCenter})
|
||||
progress: ProgressProps
|
||||
progress.key = KeyHash("inbe/lumi/loading-progress")
|
||||
progress.bounds = Rectangle.{cast(float32)column.x, cast(float32)middle,
|
||||
cast(float32)column.width, cast(float32)AppScale(8)}
|
||||
progress.min = 0
|
||||
progress.max = lumi_ui.chat_count
|
||||
progress.value = lumi_rows_measured
|
||||
Progress(app.ui.session, progress)
|
||||
area := Rectangle.{0.0, 0.0, cast(float32)app.ui.view_width,
|
||||
cast(float32)(app.ui.view_height - app_content_bottom_reserved(app))}
|
||||
LoadingScreen(app.ui.session, LoadingScreenProps.{.key = KeyHash("inbe/lumi/loading"),
|
||||
.bounds = area, .title = app_nav_route_label(APP_NAV_ROUTE_LUMI),
|
||||
.detail = LocaleText("lumi_loading"),
|
||||
.icon_shape = AssetRead("assets/lumi/sidebar.shape").data, .now = GetTime(),
|
||||
.scale = MetricsScale(), .has_progress = lumi_ui.chat_count > 0,
|
||||
.completed = lumi_rows_measured, .total = lumi_ui.chat_count})
|
||||
AppRequestSmoothFrames(2)
|
||||
}
|
||||
|
||||
LumiPrepareTools :: (app: *InnerBreeze) {
|
||||
|
||||
Reference in new issue
Block a user