mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 12:35:42 +00:00
Draw the outline of enabled secondary buttons under the agent's latest reply (#3697)
* Draw the outline of enabled secondary buttons under the agent's latest reply * Count only the index fetch's own connections in DesktopLanguageIndexSourceTest
This commit is contained in:
1 parent
bc8a970520
commit
a9f2017aa3
2 files changed
+17
-5
No files matched your search
@@ -308,7 +308,8 @@ internal fun SecondaryButton(text: String, enabled: Boolean = true, compact: Boo
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = modifier.paneItem("btn:$text").downToFirstTile().heightIn(min = if (pill) 40.dp else if (compact) 44.dp else 48.dp).graphicsLayer { scaleX = scale; scaleY = scale }.clip(shape).background(fill).glideBorder(hot, shape, pal.signal, if (pill) Color.White.copy(alpha = 0.14f) else pal.line2)
|
||||
.alpha(if (enabled) 1f else 0.5f)
|
||||
// The label always gets a layer of its own: sharing one with the fill and outline, they did not draw under the agent's latest reply.
|
||||
.graphicsLayer { alpha = if (enabled) 1f else 0.5f }
|
||||
.hoverable(src).clickable(role = androidx.compose.ui.semantics.Role.Button, interactionSource = src, indication = LocalIndication.current, enabled = enabled, onClick = onClick)
|
||||
.controllerConfirm(enabled = enabled, onClick = onClick)
|
||||
.padding(horizontal = if (pill) 16.dp else if (compact) 10.dp else 16.dp, vertical = if (pill) 8.dp else if (compact) 7.dp else 11.dp),
|
||||
|
||||
@@ -41,7 +41,18 @@ class DesktopLanguageIndexSourceTest {
|
||||
context = ApplicationProvider.getApplicationContext()
|
||||
DownloadSource.init(context)
|
||||
DownloadSource.setMode(context, DownloadSource.MODE_MIRROR)
|
||||
}
|
||||
|
||||
// Downloads other tests leave running also go through this proxy while it is set, so it is set only around [block].
|
||||
private fun tunnelsDuring(block: () -> Unit): List<String> {
|
||||
DownloadSource.setProxy(context, "127.0.0.1:${proxy.localPort}")
|
||||
tunnels.clear()
|
||||
try {
|
||||
block()
|
||||
} finally {
|
||||
DownloadSource.setProxy(context, "")
|
||||
}
|
||||
return tunnels.toList()
|
||||
}
|
||||
|
||||
@After fun tearDown() {
|
||||
@@ -51,12 +62,12 @@ class DesktopLanguageIndexSourceTest {
|
||||
}
|
||||
|
||||
@Test fun mirrorModeWouldOtherwiseSendTheIndexThroughAMirror() {
|
||||
Downloader.downloadString(base + "desktop-kde.i18n.txt")
|
||||
assertTrue(tunnels.toString(), tunnels.any { host -> DownloadSource.MIRRORS.any { it.host == host } })
|
||||
val seen = tunnelsDuring { Downloader.downloadString(base + "desktop-kde.i18n.txt") }
|
||||
assertTrue(seen.toString(), seen.any { host -> DownloadSource.MIRRORS.any { it.host == host } })
|
||||
}
|
||||
|
||||
@Test fun indexIsFetchedOnlyFromGithubInMirrorMode() {
|
||||
assertNull(DesktopLanguage.fetchIndex(base))
|
||||
assertEquals(listOf("github.com"), tunnels.toList())
|
||||
val seen = tunnelsDuring { assertNull(DesktopLanguage.fetchIndex(base)) }
|
||||
assertEquals(listOf("github.com"), seen)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user