Skip to content

Commit 375d544

Browse files
committed
refactor: add toggle to always show buttons
1 parent bb34982 commit 375d544

File tree

1 file changed

+3
-2
lines changed
  • src/main/kotlin/com/mineinabyss/guiy/components/lists

1 file changed

+3
-2
lines changed

src/main/kotlin/com/mineinabyss/guiy/components/lists/Scrollable.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ fun <T> Scrollable(
3333
isHideTooltip = true
3434
}
3535
},
36+
alwaysShowButtons: Boolean = false,
3637
content: @Composable (page: List<T>) -> Unit,
3738
) {
3839
var size by remember { mutableStateOf(Size(0, 0)) }
@@ -49,9 +50,9 @@ fun <T> Scrollable(
4950
position = navbarPosition,
5051
navbar = {
5152
NavbarButtons(navbarPosition, navbarBackground) {
52-
if (line > 0) previousButton()
53+
if (alwaysShowButtons || line > 0) previousButton()
5354
else Spacer(1, 1)
54-
if (end < items.size) nextButton()
55+
if (alwaysShowButtons || end < items.size) nextButton()
5556
else Spacer(1, 1)
5657
}
5758
},

0 commit comments

Comments
 (0)