Expose Battle.net launcher in Library and restore Stores to More (#3285)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-26 23:16:11 -05:00
1 parent e0296a1176
commit e71c37b34f
4 files changed
+43 -15

No files matched your search

@@ -374,7 +374,7 @@ internal fun LibraryPage(s: FrontEndState, a: FrontEndActions, selected: String,
.map { it.store.id }.toSet()
val sources = librarySources(
all, storeTabs.map { it.store.id },
listOfNotNull(Store.ITCH.id.takeIf { itchSignedIn && !soundMode }, Store.GAMEJOLT.id.takeIf { gameJoltSignedIn && !soundMode }, Library.ADDED.takeIf { stores }).toSet() + signInChips,
listOfNotNull(Store.ITCH.id.takeIf { itchSignedIn && !soundMode }, Store.GAMEJOLT.id.takeIf { gameJoltSignedIn && !soundMode }, Library.ADDED.takeIf { stores }, Store.BATTLENET.id.takeIf { stores }).toSet() + signInChips,
favorites, concealed,
offStores = if (soundMode) emptySet() else storeTabs.filterNot { it.shown }.map { it.store.id }.toSet(),
places = if (soundMode) DEFAULT_LIBRARY_PLACES else StoreTabsState.libraryPlaces,
@@ -632,7 +632,8 @@ private fun LibraryGrid(
// A search that matches nothing keeps the toolbar, so the search can still be cleared.
val customEmpty = !soundMode && source == Library.ADDED && visible.isEmpty() && hiddenUninstalled == 0 && LibraryView.query.isBlank()
val splash = !soundMode && (signInStore != null || customEmpty)
val headerItems = (if (splash) 1 else 2) + (if (sizesPending) 1 else 0) + syncing.size
val showHeader = !splash || source == Store.BATTLENET.id
val headerItems = (if (showHeader) 2 else 1) + (if (sizesPending) 1 else 0) + syncing.size
val expanded = showUninstalled == true
val notInstalled = if (expanded) visible.count { !it.installed } else hiddenUninstalled
val toggleAt = when {
@@ -766,7 +767,7 @@ private fun LibraryGrid(
Box(Modifier.onSizeChanged { chipsH = it.height }) { Rise(0) { if (soundMode) header() else filters() } }
}
val splashHeight = with(density) { (gridH - chipsH).toDp() - 28.dp }.coerceAtLeast(300.dp)
if (!splash) item(key = if (soundMode) "filters" else "header", span = { GridItemSpan(maxLineSpan) }) { Rise(1) { if (soundMode) filters() else header() } }
if (showHeader) item(key = if (soundMode) "filters" else "header", span = { GridItemSpan(maxLineSpan) }) { Rise(1) { if (soundMode) filters() else header() } }
for ((store, line) in syncing) item(key = "sync-${store.id}", span = { GridItemSpan(maxLineSpan) }) {
Column(verticalArrangement = Arrangement.spacedBy(4.dp), modifier = Modifier.fillMaxWidth()) {
Text(store.shortLabel + " · " + line, fontSize = 12.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis)
@@ -882,6 +883,12 @@ private fun LibraryHeader(
clearSearchFocus = searchCleared, inlineWhenStacked = true,
lead = soundLead,
) {
if (!soundMode && !s.shortcutPicker && source == Store.BATTLENET.id) {
SecondaryButton(
stringResource(R.string.bnet_open), enabled = !s.busy && DevPreview.library == LibraryPreview.OFF,
compact = true, modifier = Modifier.testTag("library-battlenet-open"), onClick = a.onBattleNet,
)
}
if (soundMode) HeaderIconButton(stringResource(R.string.soundtracks_saved), Icons.Filled.BookmarkBorder, "collections", onClick = onCollections)
if (!soundMode && DeveloperTools.on && DevPreview.shortcuts) LibraryPreviewButton()
DisplayButton()
@@ -27,7 +27,7 @@ internal object DeveloperTools {
internal object NavTabs {
const val MORE = "more"
val ALL = listOf("steam", "desktop", "games", "downloads", "setup", "updates", "stores", "soundtracks", "components", "storage", "sync", "decky", "boot-movies", "android-apps", "agent")
val DEFAULT_SHELVED = setOf("soundtracks", "components", "storage", "sync", "decky", "boot-movies", "agent")
val DEFAULT_SHELVED = setOf("stores", "soundtracks", "components", "storage", "sync", "decky", "boot-movies", "agent")
val DEFAULT_HIDDEN = setOf("android-apps", "agent")
private val SHELVED_WHEN_NEW = setOf("storage", "sync", "decky", "boot-movies", "agent")
private val OLD_ORDER = listOf("steam", "games", "soundtracks", "stores", "downloads", "desktop", "agent", "components", "android-apps", "storage", "sync", "setup", "updates")