Use the shared Apps screen for the Inbe launcher

This commit is contained in:
waozi committed 2026-10-23 17:44:24 -03:00
1 parent 685bbc7a39
commit 8675cbdee3
19 files changed
+152 -422

No files matched your search

-18
View File
@@ -2965,15 +2965,6 @@ Zatím tu nejsou žádné návyky.
[launcher_title]
Aplikace
---
[launcher_search]
Najít aplikaci
---
[launcher_favorites]
Připnuté
---
[launcher_no_results]
Žádné aplikace nenalezeny
---
---
[lumi_authorization_body]
Propojení chatu Telegramu neopravňuje jeho miniaplikaci k přístupu. Povolte pouze historii Lumi; deník, zpětná vazba a další soukromá data zůstávají mimo toto oprávnění.
@@ -5723,9 +5714,6 @@ Zástupce se nepodařilo přidat. Zkus to znovu.
---
[launcher_clear_search]
Vymazat hledání
---
@@ -7441,12 +7429,6 @@ Vy
Lidé s přístupem
---
[launcher_list_view]
Zobrazení seznamu
---
[launcher_grid_view]
Zobrazení mřížky
---
[package_updates_title]
Aktualizace aplikací
-18
View File
@@ -2959,15 +2959,6 @@ Du hast noch keine Gewohnheiten.
[launcher_title]
Apps
---
[launcher_search]
App finden
---
[launcher_favorites]
Angeheftet
---
[launcher_no_results]
Keine Apps gefunden
---
---
[lumi_authorization_body]
Eine verknüpfte Telegram-Unterhaltung autorisiert deren Mini-App nicht. Gib nur deinen Lumi-Verlauf frei; Tagebuch, Rückmeldungen und andere private Daten bleiben ausgeschlossen.
@@ -5717,9 +5708,6 @@ Die Verknüpfung konnte nicht hinzugefügt werden. Bitte versuche es erneut.
---
[launcher_clear_search]
Suche löschen
---
@@ -7435,12 +7423,6 @@ Keine passenden Freunde
Personen mit Zugriff
---
[launcher_list_view]
Listenansicht
---
[launcher_grid_view]
Rasteransicht
---
[package_updates_title]
App-Updates
-18
View File
@@ -2983,15 +2983,6 @@ You have no habits yet.
[launcher_title]
Apps
---
[launcher_search]
Find an app
---
[launcher_favorites]
Pinned
---
[launcher_no_results]
No apps found
---
---
[lumi_authorization_body]
Linking a Telegram chat does not authorize its Mini App. Authorize only your Lumi history; Diary, feedback and other private data stay outside this grant.
@@ -5741,9 +5732,6 @@ Could not add the shortcut. Please try again.
---
[launcher_clear_search]
Clear search
---
@@ -7459,12 +7447,6 @@ No matching friends
People with access
---
[launcher_list_view]
List view
---
[launcher_grid_view]
Grid view
---
[package_updates_title]
App updates
-18
View File
@@ -2959,15 +2959,6 @@ Aún no tienes hábitos.
[launcher_title]
Aplicaciones
---
[launcher_search]
Buscar una aplicación
---
[launcher_favorites]
Fijadas
---
[launcher_no_results]
No se encontraron aplicaciones
---
---
[lumi_authorization_body]
Vincular un chat de Telegram no autoriza su miniaplicación. Autoriza solo tu historial de Lumi; el diario, los comentarios y los demás datos privados quedan fuera de este permiso.
@@ -5717,9 +5708,6 @@ No se pudo añadir el acceso directo. Inténtalo de nuevo.
---
[launcher_clear_search]
Borrar búsqueda
---
@@ -7435,12 +7423,6 @@ No hay amigos que coincidan
Personas con acceso
---
[launcher_list_view]
Vista de lista
---
[launcher_grid_view]
Vista de cuadrícula
---
[package_updates_title]
Actualizaciones de aplicaciones
-18
View File
@@ -2947,15 +2947,6 @@ Tu n'as pas encore d'habitudes.
[launcher_title]
Applications
---
[launcher_search]
Rechercher une application
---
[launcher_favorites]
Épinglées
---
[launcher_no_results]
Aucune application trouvée
---
---
[lumi_authorization_body]
Lier une conversation Telegram n’autorise pas sa mini-application. Autorisez uniquement votre historique Lumi ; le journal, les commentaires et les autres données privées restent exclus.
@@ -5705,9 +5696,6 @@ Impossible d’ajouter le raccourci. Réessaie.
---
[launcher_clear_search]
Effacer la recherche
---
@@ -7423,12 +7411,6 @@ Aucun ami correspondant
Personnes ayant accès
---
[launcher_list_view]
Vue en liste
---
[launcher_grid_view]
Vue en grille
---
[package_updates_title]
Mises à jour des applications
-18
View File
@@ -2948,15 +2948,6 @@ Kamu belum punya kebiasaan.
[launcher_title]
Aplikasi
---
[launcher_search]
Cari aplikasi
---
[launcher_favorites]
Disematkan
---
[launcher_no_results]
Tidak ada aplikasi ditemukan
---
---
[lumi_authorization_body]
Menghubungkan obrolan Telegram tidak mengizinkan aplikasi mininya. Izinkan hanya riwayat Lumi; jurnal, masukan, dan data pribadi lainnya tetap di luar izin ini.
@@ -5706,9 +5697,6 @@ Tidak dapat menambahkan pintasan. Silakan coba lagi.
---
[launcher_clear_search]
Hapus pencarian
---
@@ -7424,12 +7412,6 @@ Tidak ada teman yang cocok
Orang yang memiliki akses
---
[launcher_list_view]
Tampilan daftar
---
[launcher_grid_view]
Tampilan kisi
---
[package_updates_title]
Pembaruan aplikasi
-18
View File
@@ -2948,15 +2948,6 @@ Non hai ancora abitudini.
[launcher_title]
App
---
[launcher_search]
Trova un’app
---
[launcher_favorites]
App fissate
---
[launcher_no_results]
Nessuna app trovata
---
---
[lumi_authorization_body]
Collegare una chat Telegram non autorizza la sua mini app. Autorizza solo la cronologia di Lumi; diario, segnalazioni e altri dati privati restano esclusi.
@@ -5706,9 +5697,6 @@ Impossibile aggiungere il collegamento. Riprova.
---
[launcher_clear_search]
Cancella ricerca
---
@@ -7424,12 +7412,6 @@ Nessun amico corrispondente
Persone con accesso
---
[launcher_list_view]
Vista elenco
---
[launcher_grid_view]
Vista griglia
---
[package_updates_title]
Aggiornamenti delle app
-18
View File
@@ -2944,15 +2944,6 @@ Telegramとの接続を解除
[launcher_title]
アプリ
---
[launcher_search]
アプリを検索
---
[launcher_favorites]
ピン留め
---
[launcher_no_results]
アプリが見つかりません
---
---
[lumi_authorization_body]
Telegram のチャットを連携しても、ミニアプリは認可されません。Lumi の履歴のみを許可します。日記、フィードバック、その他の非公開データは対象外です。
@@ -5702,9 +5693,6 @@ Dewが不足しています。プロフィールでDewを追加してくださ
---
[launcher_clear_search]
検索をクリア
---
@@ -7420,12 +7408,6 @@ Inner Breeze がバージョン %s に更新されました。
アクセスできるユーザー
---
[launcher_list_view]
リスト表示
---
[launcher_grid_view]
グリッド表示
---
[package_updates_title]
アプリの更新
-18
View File
@@ -2954,15 +2954,6 @@ Telegram 연결 해제
[launcher_title]
앱
---
[launcher_search]
앱 검색
---
[launcher_favorites]
고정된 앱
---
[launcher_no_results]
앱을 찾을 수 없습니다
---
---
[lumi_authorization_body]
Telegram 채팅을 연결해도 미니 앱에 권한이 부여되지는 않습니다. Lumi 기록만 허용하며 일기, 피드백 및 다른 비공개 데이터는 이 권한에 포함되지 않습니다.
@@ -5712,9 +5703,6 @@ Dew가 부족합니다. 프로필에서 Dew를 추가하세요.
---
[launcher_clear_search]
검색 지우기
---
@@ -7430,12 +7418,6 @@ Inner Breeze가 %s 버전으로 업데이트되었어요.
액세스 권한이 있는 사용자
---
[launcher_list_view]
목록 보기
---
[launcher_grid_view]
격자 보기
---
[package_updates_title]
앱 업데이트
-18
View File
@@ -2957,15 +2957,6 @@ Você ainda não tem hábitos.
[launcher_title]
Aplicativos
---
[launcher_search]
Buscar aplicativo
---
[launcher_favorites]
Fixados
---
[launcher_no_results]
Nenhum aplicativo encontrado
---
---
[lumi_authorization_body]
Vincular uma conversa do Telegram não autoriza o seu miniaplicativo. Autorize apenas o histórico do Lumi; diário, comentários e outros dados privados ficam fora desta permissão.
@@ -5715,9 +5706,6 @@ Não foi possível adicionar o atalho. Tente novamente.
---
[launcher_clear_search]
Limpar pesquisa
---
@@ -7433,12 +7421,6 @@ Nenhum amigo encontrado
Pessoas com acesso
---
[launcher_list_view]
Vista em lista
---
[launcher_grid_view]
Vista em grade
---
[package_updates_title]
Atualizações de aplicativos
-18
View File
@@ -2953,15 +2953,6 @@ Lumi остаётся без сети, пока вы не примете её у
[launcher_title]
Приложения
---
[launcher_search]
Найти приложение
---
[launcher_favorites]
Закреплённые
---
[launcher_no_results]
Приложения не найдены
---
---
[lumi_authorization_body]
Привязка чата Telegram не разрешает доступ мини-приложению. Разрешите только историю Lumi; дневник, отзывы и другие личные данные исключены.
@@ -5711,9 +5702,6 @@ Lumi остаётся без сети, пока вы не примете её у
---
[launcher_clear_search]
Очистить поиск
---
@@ -7429,12 +7417,6 @@ Inner Breeze обновлён до версии %s.
Пользователи с доступом
---
[launcher_list_view]
Вид списком
---
[launcher_grid_view]
Вид сеткой
---
[package_updates_title]
Обновления приложений
-18
View File
@@ -2959,15 +2959,6 @@ WHM 最长屏息时间(秒)
[launcher_title]
应用
---
[launcher_search]
搜索应用
---
[launcher_favorites]
已固定
---
[launcher_no_results]
未找到应用
---
---
[lumi_authorization_body]
关联 Telegram 聊天并不等于授权其小程序。仅授权 Lumi 历史记录;日记、反馈及其他私人数据不在此权限范围内。
@@ -5717,9 +5708,6 @@ Dew不足,请在个人资料中添加Dew。
---
[launcher_clear_search]
清除搜索
---
@@ -7435,12 +7423,6 @@ Inner Breeze 已更新至 %s 版本。
有权访问的用户
---
[launcher_list_view]
列表视图
---
[launcher_grid_view]
网格视图
---
[package_updates_title]
应用更新
+3 -2
View File
@@ -52,8 +52,9 @@ stage: $(TARGET)
icon_dir="$(DESTDIR)$(PREFIX)/share/icons/hicolor/$(APP_ICON_SIZE)/apps"; \
meta_dir="$(DESTDIR)$(PREFIX)/share/metainfo"; \
mkdir -p "$$bin_dir"; \
cp "$(TARGET)" "$$bin_dir/$(APP_EXECUTABLE)"; \
chmod 755 "$$bin_dir/$(APP_EXECUTABLE)"; \
cp "$(TARGET)" "$$bin_dir/$(APP_EXECUTABLE).new"; \
chmod 755 "$$bin_dir/$(APP_EXECUTABLE).new"; \
mv -f "$$bin_dir/$(APP_EXECUTABLE).new" "$$bin_dir/$(APP_EXECUTABLE)"; \
if [ -n "$(strip $(APP_DESKTOP))" ]; then \
mkdir -p "$$app_dir"; \
sed -e 's/^Icon=.*/Icon=$(APP_ICON_NAME)/' \
+111 -178
View File
@@ -57,6 +57,8 @@
#import "tree"
#import "tree_input"
#import "widget_kind"
SharedLauncher :: #import "apps/launcher";
GridIcon :: #import "mingcute/mingcute_regular_layout_grid";
ListIcon :: #import "mingcute/mingcute_regular_list_check";
EditIcon :: #import "mingcute/mingcute_regular_edit";
@@ -178,6 +180,23 @@ LauncherLibraryMove :: (app: *InnerBreeze, items: []s32, item: s32, target: s32)
PackageFree(value)
}
// The shared screen retains its widget state; account-owned values are
// copied in and out for the current Inbe profile each frame.
launcher_screen: SharedLauncher.AppLauncherState;
launcher_screen_routes: [LAUNCHER_APP_COUNT + NODE_APP_OFFERS]s32;
LauncherScreenCards :: (context: *void, indices: []s32, bounds: Rectangle,
input: TextFieldInput, section_break: s32, columns: s32) -> bool {
app := cast(*InnerBreeze)context
routes: [LAUNCHER_APP_COUNT + NODE_APP_OFFERS]s32
for index: cast(s32)0..cast(s32)indices.count - 1 {
routes[index] = launcher_screen_routes[indices[index]]
}
quiet := app_launcher_cards_quiet(app, PointerSample(app.ui.session), bounds)
return app_launcher_shared_group(app, 0, routes[:indices.count], bounds,
input, section_break, columns, launcher_screen.grid, quiet)
}
// Whether the touch or click that is down began on the app cards.
launcher_press_on_cards: bool;
@@ -319,197 +338,111 @@ app_draw_launcher :: (app: *InnerBreeze, dock_drawn: bool) {
return
}
search_y := title_y + AppScale(56)
typed: [128]u8
field: TextFieldProps
field.focus_id = 6791
field.scale = MetricsScale()
field.value = AppTextFromCString(*app.launcher_search[0], 128)
field.clear_label = LocaleText("launcher_clear_search")
field.placeholder = LocaleText("launcher_search")
field.label = LocaleText("launcher_search")
field.cursor = app.launcher_search_cursor
field.anchor = app.launcher_search_anchor
field.scroll_x = app.launcher_search_scroll
field.focused = app.launcher_search_focused
field.max_bytes = 127
field.max_codepoints = 80
field.class_name = KssClassId(KssMakeName("launcher-search"))
field.bounds = Rectangle.{cast(float32)x, cast(float32)search_y,
cast(float32)(width - AppScale(104)), cast(float32)AppScale(48)}
field.input = SampleTextFieldInput(app.launcher_search_focused, typed[:])
searched := TextField(app.ui.session, field)
if searched.edit.changed {
unused AppReplaceText(app.launcher_search[:], searched.edit.start,
searched.edit.end, searched.edit.replacement)
app.launcher_scroll = 0
}
app.launcher_search_cursor = searched.cursor
app.launcher_search_anchor = searched.anchor
app.launcher_search_scroll = searched.scroll_x
app.launcher_search_focused = searched.focused
if searched.clipboard_write { unused TextInputWriteClipboard(searched.clipboard_text) }
for mode: cast(s32)0..cast(s32)1 {
grid := mode == 1
view: ButtonProps
view.key = KeyHash(ifx grid then "inbe/apps/grid-view" else "inbe/apps/list-view")
view.label = LocaleText(ifx grid then "launcher_grid_view" else "launcher_list_view")
view.icon_shape = ifx grid then GridIcon.Shape else ListIcon.Shape
view.icon_only = true
view.selected = app.launcher_grid_view == grid
view.emphasis = cast(ButtonEmphasis)ButtonEmphasisSoft
view.tone = cast(ButtonTone)(ifx view.selected then ButtonToneAccent else ButtonToneNeutral)
view.bounds = Rectangle.{cast(float32)(x + width - AppScale(96) + mode * AppScale(52)),
cast(float32)(search_y + AppScale(2)), cast(float32)AppScale(44), cast(float32)AppScale(44)}
if Button(app.ui.session, view) != 0 && app.launcher_grid_view != grid {
app.launcher_grid_view = grid
app.launcher_scroll = 0
app.launcher_drag_key = 0
app.launcher_drag_moving = false
save_settings(app)
app_block_current_click(app)
}
}
query := AppTextFromCString(*app.launcher_search[0], 128)
launcher_screen.query = app.launcher_search
launcher_screen.cursor = app.launcher_search_cursor
launcher_screen.anchor = app.launcher_search_anchor
launcher_screen.scroll_x = app.launcher_search_scroll
launcher_screen.focused = app.launcher_search_focused
launcher_screen.grid = app.launcher_grid_view
launcher_screen.scroll = app.launcher_scroll
items: [LAUNCHER_APP_COUNT + NODE_APP_OFFERS]SharedLauncher.AppLauncherItem
titles: [LAUNCHER_APP_COUNT + NODE_APP_OFFERS][256]u8
routes := LauncherRoutes()
canonical: [LAUNCHER_APP_COUNT]string = .{"Diary", "Habits", "Lists", "Lumi", "Practice", "Leaderboard",
"", "", "", "", "", "", "", ""}
matches: [LAUNCHER_APP_COUNT]s32
match_count: s32 = 0
for index: cast(s32)0..LAUNCHER_APP_COUNT - 1 {
// A slot without an installed app the node offers has no card.
if AppNavNodeSlot(routes[index]) >= 0 && !app_nav_route_available(app, routes[index]) {
continue
}
if LauncherMatches(app_nav_route_label(routes[index]), query) ||
LauncherMatches(canonical[index], query) {
matches[match_count] = routes[index]
match_count += 1
}
}
pinned: [LAUNCHER_APP_COUNT]s32
more: [LAUNCHER_APP_COUNT + NODE_APP_OFFERS]s32
pinned_count: s32 = 0
more_count: s32 = 0
canonical: [6]string = .{"Diary", "Habits", "Lists", "Lumi", "Practice", "Leaderboard"}
count: s32
// Favorite order is account-owned. The shared module filters and groups
// these entries, including native routes and undownloaded offers alike.
for index: cast(s32)0..app.launcher_favorite_count - 1 {
route := app.launcher_favorites[index]
for match: cast(s32)0..match_count - 1 {
if matches[match] == route {
pinned[pinned_count] = route
pinned_count += 1
}
}
launcher_screen_routes[count] = app.launcher_favorites[index]
count += 1
}
for index: cast(s32)0..match_count - 1 {
if !app_launcher_is_favorite(app, matches[index]) {
more[more_count] = matches[index]
more_count += 1
}
more_catalog: [LAUNCHER_APP_COUNT + NODE_APP_OFFERS]s32
more_catalog_count: s32
for route: routes {
if app_launcher_is_favorite(app, route) ||
(AppNavNodeSlot(route) >= 0 && !app_nav_route_available(app, route)) { continue }
more_catalog[more_catalog_count] = route
more_catalog_count += 1
}
for offer: cast(s32)0..NodeAppOfferCount() - 1 {
name := NodeAppOfferName(offer)
if NodeAppOfferShown(offer) && NodeAppSlotFor(name) < 0 && LauncherMatches(NodeAppTitle(name), query) {
more[more_count] = -offer - 2
more_count += 1
if NodeAppOfferShown(offer) && NodeAppSlotFor(name) < 0 {
more_catalog[more_catalog_count] = -offer - 2
more_catalog_count += 1
}
}
LauncherLibrarySort(app, more[:more_count])
tile_height := AppScale(64)
gap := AppScale(4)
columns: s32 = 1
if app.launcher_grid_view {
tile_height = AppScale(88)
gap = AppScale(12)
columns = MeasureGrid(GridProps.{.bounds = Rectangle.{cast(float32)x, 0.0, cast(float32)width, 0.0},
.min_item_width = AppScale(140), .max_columns = 6, .gap = gap}).columns
LauncherLibrarySort(app, more_catalog[:more_catalog_count])
for index: cast(s32)0..more_catalog_count - 1 {
launcher_screen_routes[count] = more_catalog[index]
count += 1
}
for index: cast(s32)0..count - 1 {
route := launcher_screen_routes[index]
title := ifx route >= 0 then app_nav_route_label(route) else NodeAppTitle(LauncherLibraryName(route))
unused AppCopyText(title, titles[index][:])
search := LauncherLibraryName(route)
for at: cast(s32)0..5 { if routes[at] == route { search = canonical[at] } }
items[index] = SharedLauncher.AppLauncherItem.{
.title = AppTextFromCString(*titles[index][0], 256), .search = search,
.favorite = route >= 0 && app_launcher_is_favorite(app, route)}
}
cells := MeasureGrid(GridProps.{.columns = columns, .gap = gap,
.bounds = Rectangle.{cast(float32)x, 0.0, cast(float32)width, 0.0}})
pinned_rows := GridRowCount(cells, pinned_count)
more_rows := GridRowCount(cells, more_count)
pinned_height := AppScale(36) + pinned_rows * (tile_height + gap)
more_height := AppScale(36) + more_rows * (tile_height + gap)
if more_count == 0 { more_height += AppScale(64) }
content_height := pinned_height + more_height
if pinned_count + more_count == 0 { content_height += AppScale(64) }
bottom_dock := app_content_bottom_reserved(app)
body_bottom := app.ui.view_height - bottom_dock - AppScale(12)
body_y := search_y + AppScale(68)
status := ""
if launcher_pin_status >= 0 {
status_key := ifx launcher_pin_status == 2 then "launcher_pin_added" else "launcher_pin_requested"
if launcher_pin_status == 0 { status_key = "launcher_pin_failed" }
Text(app.ui.session, TextProps.{.text = LocaleText(status_key),
.bounds = Rectangle.{cast(float32)x, cast(float32)body_y,
cast(float32)width, cast(float32)AppScale(44)}, .font = AppSmallFontSize()})
body_y += AppScale(48)
status = LocaleText(status_key)
}
scroll: ScrollProps
scroll.key = KeyHash("inbe/apps/library")
scroll.bounds = Rectangle.{cast(float32)x, cast(float32)body_y,
cast(float32)width, cast(float32)(body_bottom - body_y)}
scroll.content_height = content_height
scroll.scroll_offset = app.launcher_scroll
scrolled := Scroll(app.ui.session, scroll)
app.launcher_scroll = scrolled.scroll_offset
pinned_bounds: Rectangle
pinned_cells: GridMetrics
more_bounds: Rectangle
more_cells: GridMetrics
typed: [1024]u8
input := SampleTextFieldInput(true, typed[:])
layout := SharedLauncher.AppLauncherScreen(app.ui.session, *launcher_screen,
SharedLauncher.AppLauncherProps.{
.bounds = Rectangle.{cast(float32)x, cast(float32)search_y, cast(float32)width,
cast(float32)(app.ui.view_height - bottom_dock - AppScale(12) - search_y)},
.scale = MetricsScale(), .locale = LocaleActiveCode(), .input = input,
.search_class = KssClassId(KssMakeName("launcher-search")),
.heading_class = KssClassId(KssMakeName("launcher-heading")),
.muted_class = KssClassId(KssMakeName("launcher-muted")),
.empty_favorites = true, .status = status, .context = cast(*void)app,
.cards = LauncherScreenCards}, items[:count])
app.launcher_search = launcher_screen.query
app.launcher_search_cursor = launcher_screen.cursor
app.launcher_search_anchor = launcher_screen.anchor
app.launcher_search_scroll = launcher_screen.scroll_x
app.launcher_search_focused = launcher_screen.focused
app.launcher_scroll = launcher_screen.scroll
if layout.clipboard_write {
unused TextInputWriteClipboard(AppTextFromCString(*layout.clipboard_text[0], 128))
}
if layout.changed {
app.launcher_grid_view = launcher_screen.grid
app.launcher_drag_key = 0
app.launcher_drag_moving = false
save_settings(app)
app_block_current_click(app)
}
pinned_count := launcher_screen.favorites
more_count := launcher_screen.count - pinned_count
pinned: [LAUNCHER_APP_COUNT]s32
more: [LAUNCHER_APP_COUNT + NODE_APP_OFFERS]s32
for index: cast(s32)0..pinned_count - 1 {
pinned[index] = launcher_screen_routes[launcher_screen.visible[index]]
}
for index: cast(s32)0..more_count - 1 {
more[index] = launcher_screen_routes[launcher_screen.visible[pinned_count + index]]
}
scrolled := layout.scrolled
pinned_bounds := layout.favorites_bounds
more_bounds := layout.library_bounds
tile_height := layout.tile_height
gap := layout.gap
pinned_cells := MeasureGrid(GridProps.{.columns = layout.columns, .gap = gap,
.bounds = Rectangle.{pinned_bounds.x, pinned_bounds.y + cast(float32)AppScale(36), pinned_bounds.width, 0.0}})
more_cells := MeasureGrid(GridProps.{.columns = layout.columns, .gap = gap,
.bounds = Rectangle.{more_bounds.x, more_bounds.y + cast(float32)AppScale(36), more_bounds.width, 0.0}})
pinned_slots: [LAUNCHER_APP_COUNT]Rectangle
library_bounds: Rectangle
// Typing goes to the search field or else to a field in an app's Properties.
apps_typed: [1024]u8
apps_input := SampleTextFieldInput(!app.launcher_search_focused, apps_typed[:])
if scrolled.opened {
width = cast(s32)scrolled.content.width
y := cast(s32)scrolled.content.y
library_bounds = Rectangle.{cast(float32)x, cast(float32)(y + AppScale(36)),
cast(float32)width, cast(float32)(content_height - AppScale(36))}
pinned_bounds = Rectangle.{cast(float32)x, cast(float32)y,
cast(float32)width, cast(float32)pinned_height}
for section: cast(s32)0..cast(s32)1 {
count := ifx section == 0 then pinned_count else more_count
if section == 0 {
Text(app.ui.session, TextProps.{.text = LocaleText("launcher_favorites"),
.bounds = Rectangle.{cast(float32)x, cast(float32)y,
cast(float32)width, cast(float32)AppScale(28)},
.class_name = KssClassId(KssMakeName("launcher-heading"))})
} else {
Separator(app.ui.session, SeparatorProps.{.key = KeyHash("inbe/apps/library-divider"),
.bounds = Rectangle.{cast(float32)x, cast(float32)y,
cast(float32)width, cast(float32)AppScale(32)}})
}
if section == 1 {
more_bounds = Rectangle.{cast(float32)x, cast(float32)y,
cast(float32)width, cast(float32)more_height}
}
y += AppScale(36)
// The scroll's content may be narrower than the panel; the column
// count chosen for the panel keeps the content height exact.
section_cells := MeasureGrid(GridProps.{.columns = columns, .gap = gap,
.bounds = Rectangle.{cast(float32)x, cast(float32)y, cast(float32)width, 0.0}})
if section == 0 { pinned_cells = section_cells }
else { more_cells = section_cells }
for index: cast(s32)0..count - 1 {
route := ifx section == 0 then pinned[index] else more[index]
bounds := GridCellBounds(section_cells, index, tile_height)
if section == 0 { pinned_slots[index] = bounds }
}
y += GridRowCount(section_cells, count) * (tile_height + gap)
}
library_routes: [LAUNCHER_APP_COUNT + NODE_APP_OFFERS]s32
for index: cast(s32)0..pinned_count - 1 { library_routes[index] = pinned[index] }
for index: cast(s32)0..more_count - 1 { library_routes[pinned_count + index] = more[index] }
cards_quiet := app_launcher_cards_quiet(app, pointer, scrolled.viewport)
unused app_launcher_shared_group(app, 0, library_routes[:pinned_count + more_count],
library_bounds, apps_input, pinned_count, columns, cards_quiet)
if pinned_count + more_count == 0 {
Text(app.ui.session, TextProps.{.text = LocaleText("launcher_no_results"),
.bounds = Rectangle.{cast(float32)x, cast(float32)y,
cast(float32)width, cast(float32)AppScale(56)},
.class_name = KssClassId(KssMakeName("launcher-muted"))})
}
unused End(app.ui.session)
}
for index: cast(s32)0..pinned_count - 1 { pinned_slots[index] = GridCellBounds(pinned_cells, index, tile_height) }
query := AppTextFromCString(*app.launcher_search[0], 128)
if !dock_drawn {
app_draw_favorites_dock(app)
}
@@ -594,8 +527,8 @@ app_draw_launcher :: (app: *InnerBreeze, dock_drawn: bool) {
unused End(app.ui.session)
if app.launcher_guide_seen == 0 {
steps: [3]GuideOverlayStep
steps[0] = GuideOverlayStepFor(field.bounds, "launcher_guide_find")
steps[1] = GuideOverlayStepFor(scroll.bounds, "launcher_guide_manage")
steps[0] = GuideOverlayStepFor(layout.search_bounds, "launcher_guide_find")
steps[1] = GuideOverlayStepFor(layout.scroll_bounds, "launcher_guide_manage")
steps[2] = GuideOverlayStepFor(account.bounds, "launcher_guide_profile")
guide: GuideOverlayProps
guide.steps = *steps[0]
+3 -2
View File
@@ -471,7 +471,7 @@ app_launcher_overlay_drawn :: (section: s32) -> bool {
// running it; see AppControllerRun.
app_launcher_shared_group :: (app: *InnerBreeze, section: s32, routes: []s32,
bounds: Rectangle, input: TextFieldInput, section_break: s32, columns: s32,
quiet: bool = false) -> bool {
grid: bool, quiet: bool = false) -> bool {
group := *launcher_app_groups[section]
group.index = section
group.owner = app
@@ -492,7 +492,7 @@ app_launcher_shared_group :: (app: *InnerBreeze, section: s32, routes: []s32,
BuilderPrint(*document, "\"title\":\"\",\"locale\":")
Rules.AppsWriteQuoted(*document, LocaleActiveCode())
BuilderPrint(*document, ",\"presentation\":{\"mode\":\"%\",\"section_break\":%,\"columns\":%,\"tile_class\":%,\"action_class\":%,\"muted_class\":%},\"children\":[",
ifx app.launcher_grid_view then "icon" else "list", section_break, columns, KssClassId(KssMakeName("launcher-tile")), KssClassId(KssMakeName("launcher-action")), KssClassId(KssMakeName("launcher-muted")))
ifx grid then "icon" else "list", section_break, columns, KssClassId(KssMakeName("launcher-tile")), KssClassId(KssMakeName("launcher-action")), KssClassId(KssMakeName("launcher-muted")))
for route: routes {
if route >= 0 { LauncherAppCatalogEntry(group, *document, route) }
else { LauncherAppCatalogEntry(group, *document, -1, -route - 2) }
@@ -517,6 +517,7 @@ app_launcher_shared_group :: (app: *InnerBreeze, section: s32, routes: []s32,
group.controller.app.font = AppFontSize()
// Typing reaches the field the person focused in Properties.
group.controller.app.input = input
group.controller.app.key = ifx input.escape then 256 else 0
WidgetHostBegin(app.ui.session, LauncherAppAssetAllowed, WidgetHostPackedPath)
launcher_app_overlay_frame[section] = false
ok := Controller.AppControllerRun(*group.controller, APP_FRAME, quiet)
+4 -1
View File
@@ -1,6 +1,9 @@
// Trusted shared Apps UI reviewed for this host. Containers may carry these
// bytes, but cannot select or replace the host's controller trust anchor.
AppsControllerSha256 :: "88eaaecc551afbe973e76d1b3298c58375b070c3c279b310d409a6ada48fee1d"
AppsControllerSha256 :: "6dc552c7212e589caa1bc3daa9693697ed368ce2d926958fcd2e884e8d20572f"
// Collections published before the shared native launcher retain their controller.
AppsControllerBeforeLauncher :: "88eaaecc551afbe973e76d1b3298c58375b070c3c279b310d409a6ada48fee1d"
// Keep published icon/list collections from before cover carousels opening.
AppsControllerBeforeCovers :: "ff62f2eb5b42b73d3ca6eac91ce96af917a564787a58a6d8c5b91104e1a07fad"
+1
View File
@@ -457,6 +457,7 @@ NodeTreeStart :: (runner: *NodeAppRunner, bytes: string, verified: string,
payload := cast(*TextDescriptor)(*bytes)
Sha256Hex(payload.data, bytes.count, *digest[0])
}
unused AppHostTrustHarness(host, AppsControllerBeforeLauncher)
unused AppHostTrustHarness(host, AppsControllerBeforeCovers)
unused AppHostTrustHarness(host, AppsControllerPrevious)
unused AppHostTrustHarness(host, AppsControllerIconGrid)
+9 -2
View File
@@ -10,6 +10,7 @@ import argparse
import os
from pathlib import Path
import re
import shutil
import sqlite3
import subprocess
import tempfile
@@ -38,7 +39,7 @@ parser.add_argument("--with-tray", action="store_true",
help="Enable the desktop tray using the caller's locale settings")
arguments = parser.parse_args()
BINARY = Path(arguments.binary).resolve()
DESKTOP_ENV = ("DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "DBUS_SESSION_BUS_ADDRESS")
DESKTOP_ENV = ("DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "DBUS_SESSION_BUS_ADDRESS", "SESSION_MANAGER", "GDK_DISPLAY")
assert all(not os.environ.get(key) for key in DESKTOP_ENV), "Inherited desktop environment"
# Each favorite route's name in the navigation and on its Apps card.
ROUTE_LABELS = {12: "Lumi", 1: "Habits", 2: "Practice", 3: "Lists", 11: "Diary"}
@@ -79,7 +80,13 @@ with contextlib.ExitStack() as stack:
stack.callback(stop, display)
number = display.stdout.readline().decode().strip()
display.stdout.close()
assert number.isdecimal(), "Private display did not start"
assert number.isdecimal() and display.poll() is None, "Private display did not start"
server = Path(f"/proc/{display.pid}")
assert server.stat().st_uid == os.getuid(), "Private X server has another owner"
assert server.joinpath("exe").resolve() == Path(shutil.which("Xvfb")).resolve(), "Unexpected X server"
assert b"-displayfd\x001\x00" in server.joinpath("cmdline").read_bytes(), "Unexpected display allocation source"
display_log.write(f"Verified owned Xvfb pid={display.pid} display=:{number}\n")
display_log.flush()
env["DISPLAY"] = ":" + number
def command(*args):
+21 -21
View File
@@ -28,7 +28,7 @@
},
{
"commit": "1cb9df183089a77c8a16448a556186f30b261a98",
"dependencies": {"kryon": "p6fb45e3a87d81025"},
"dependencies": {"kryon": "pc9c8f901448f635c"},
"id": "p1b13dda539ed2a39",
"name": "Kss",
"ref": "master",
@@ -36,20 +36,12 @@
},
{
"commit": "bad2caaa84ef3eae61e40c99bf572d2b060d0ca2",
"dependencies": {"kryon": "p6fb45e3a87d81025"},
"dependencies": {"kryon": "pc9c8f901448f635c"},
"id": "p20eb23d3e6db3711",
"name": "Game2D",
"ref": "master",
"url": "https://github.com/kryonlabs/game2d.git"
},
{
"commit": "622db7474127fc47432f3786b856e505c6645b3a",
"dependencies": {"crypto": "pf039d7a776333200", "kryon": "p6fb45e3a87d81025"},
"id": "p424eeb497051c0eb",
"name": "Apps",
"ref": "master",
"url": "https://github.com/waozixyz/apps.git"
},
{
"commit": "e1f480f382d9443c4412133b55948374c77a5c21",
"dependencies": {},
@@ -68,14 +60,6 @@
"source": true,
"url": "https://github.com/raysan5/raylib.git"
},
{
"commit": "a024dc573bec70dcfe1d377d9853b4f3eda6beb4",
"dependencies": {"raylib": "p5a77c9c35110e925"},
"id": "p6fb45e3a87d81025",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "22d2ddbdc236796953c905a05a2cebf5ab1b4ff3",
"dependencies": {"liboqs": "p4b0a50b49959e674"},
@@ -95,12 +79,20 @@
},
{
"commit": "efe0ac0d83ec9c2ecb15a20a320994ca6fc347d2",
"dependencies": {"daochi_client": "p0cff069893bdc938", "kryon": "p6fb45e3a87d81025", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"},
"dependencies": {"daochi_client": "p0cff069893bdc938", "kryon": "pc9c8f901448f635c", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"},
"id": "pabca5e1965868141",
"name": "Entity",
"ref": "master",
"url": "https://github.com/waozixyz/entity.git"
},
{
"commit": "b1d4faa4de66ff799c8907ba131061be979bcc7a",
"dependencies": {"raylib": "p5a77c9c35110e925"},
"id": "pc9c8f901448f635c",
"name": "kryon",
"ref": "master",
"url": "https://github.com/kryonlabs/kryon.git"
},
{
"commit": "9ef1a3a130450d603abd029772422abd40cfcde0",
"dependencies": {},
@@ -120,7 +112,7 @@
},
{
"commit": "4b0e25bd2df86b54a8f5af3db48282bd41daab1a",
"dependencies": {"kryon": "p6fb45e3a87d81025"},
"dependencies": {"kryon": "pc9c8f901448f635c"},
"id": "pe8e21a1f2b5ff52c",
"name": "plot",
"ref": "master",
@@ -142,10 +134,18 @@
"name": "crypto",
"ref": "master",
"url": "https://github.com/ziranlang/crypto.git"
},
{
"commit": "d016377ab37ba4fb754a799569e15a4c0d195b90",
"dependencies": {"crypto": "pf039d7a776333200", "kryon": "pc9c8f901448f635c"},
"id": "pf87aa276a2b568b4",
"name": "Apps",
"ref": "master",
"url": "https://github.com/waozixyz/apps.git"
}
],
"root": {
"dependencies": {"apps": "p424eeb497051c0eb", "crypto": "pf039d7a776333200", "curl": "pd4bcd11b7d623073", "daochi_client": "p0cff069893bdc938", "entity": "pabca5e1965868141", "game2d": "p20eb23d3e6db3711", "kryon": "p6fb45e3a87d81025", "kss": "p1b13dda539ed2a39", "liboqs": "p4b0a50b49959e674", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pe8e21a1f2b5ff52c", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "sqlite": "peaa43c4b7ef72edf"},
"dependencies": {"apps": "pf87aa276a2b568b4", "crypto": "pf039d7a776333200", "curl": "pd4bcd11b7d623073", "daochi_client": "p0cff069893bdc938", "entity": "pabca5e1965868141", "game2d": "p20eb23d3e6db3711", "kryon": "pc9c8f901448f635c", "kss": "p1b13dda539ed2a39", "liboqs": "p4b0a50b49959e674", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pe8e21a1f2b5ff52c", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "sqlite": "peaa43c4b7ef72edf"},
"name": "Inbe"
},
"toolchain": {