@@ -8,13 +8,13 @@ import androidx.compose.foundation.layout.Box
88import androidx.compose.foundation.layout.Column
99import androidx.compose.foundation.layout.FlowRow
1010import androidx.compose.foundation.layout.Row
11+ import androidx.compose.foundation.layout.fillMaxHeight
1112import androidx.compose.foundation.layout.fillMaxSize
1213import androidx.compose.foundation.layout.fillMaxWidth
1314import androidx.compose.foundation.layout.padding
1415import androidx.compose.foundation.layout.size
1516import androidx.compose.foundation.lazy.LazyColumn
16- import androidx.compose.foundation.lazy.LazyRow
17- import androidx.compose.foundation.lazy.items
17+ import androidx.compose.foundation.lazy.rememberLazyListState
1818import androidx.compose.foundation.shape.CircleShape
1919import androidx.compose.foundation.shape.RoundedCornerShape
2020import androidx.compose.foundation.text.KeyboardActions
@@ -24,7 +24,6 @@ import androidx.compose.material.icons.filled.Add
2424import androidx.compose.material.icons.filled.Check
2525import androidx.compose.material.icons.filled.Close
2626import androidx.compose.material.icons.filled.Remove
27- import androidx.compose.material.icons.outlined.Download
2827import androidx.compose.material.icons.outlined.Search
2928import androidx.compose.material.icons.outlined.Upload
3029import androidx.compose.material.icons.outlined.UploadFile
@@ -46,17 +45,16 @@ import androidx.paging.compose.collectAsLazyPagingItems
4645import io.github.openflocon.flocondesktop.common.ui.ContextualView
4746import io.github.openflocon.flocondesktop.features.database.DatabaseQueryLogsViewModel
4847import io.github.openflocon.flocondesktop.features.database.model.FilterChipUiModel
49- import io.github.openflocon.flocondesktop.features.network.list.model.NetworkAction
5048import io.github.openflocon.library.designsystem.FloconTheme
5149import io.github.openflocon.library.designsystem.common.FloconContextMenuItem
5250import io.github.openflocon.library.designsystem.components.FloconDropdownMenuItem
5351import io.github.openflocon.library.designsystem.components.FloconIcon
54- import io.github.openflocon.library.designsystem.components.FloconIconButton
55- import io.github.openflocon.library.designsystem.components.FloconIconToggleButton
5652import io.github.openflocon.library.designsystem.components.FloconOverflow
5753import io.github.openflocon.library.designsystem.components.FloconPageTopBar
5854import io.github.openflocon.library.designsystem.components.FloconTextFieldWithoutM3
55+ import io.github.openflocon.library.designsystem.components.FloconVerticalScrollbar
5956import io.github.openflocon.library.designsystem.components.defaultPlaceHolder
57+ import io.github.openflocon.library.designsystem.components.rememberFloconScrollbarAdapter
6058import org.koin.compose.viewmodel.koinViewModel
6159import org.koin.core.parameter.parametersOf
6260
@@ -75,6 +73,9 @@ fun DatabaseQueryLogsView(
7573 val filterChips by viewModel.filterChips.collectAsStateWithLifecycle()
7674 val searchQuery by viewModel.searchQuery.collectAsStateWithLifecycle()
7775
76+ val lazyListState = rememberLazyListState()
77+ val scrollAdapter = rememberFloconScrollbarAdapter(lazyListState)
78+
7879 Column (modifier = modifier) {
7980 DatabaseLogsHeader (
8081 modifier = Modifier .fillMaxWidth().border(
@@ -108,11 +109,16 @@ fun DatabaseQueryLogsView(
108109 shape = FloconTheme .shapes.medium
109110 )
110111 ) {
111- LazyColumn (modifier = Modifier .fillMaxSize()) {
112+ LazyColumn (
113+ modifier = Modifier .fillMaxSize(),
114+ state = lazyListState,
115+ ) {
112116 items(logs.itemCount) { index ->
113117 val log = logs[index]
114118 if (log != null ) {
115119 ContextualView (
120+ modifier = Modifier
121+ .fillMaxWidth(),
116122 items = listOf (
117123 FloconContextMenuItem .Item (" Copy Query" ) {
118124 viewModel.copyQuery(log.sqlQuery)
@@ -149,6 +155,11 @@ fun DatabaseQueryLogsView(
149155 }
150156 }
151157 }
158+ FloconVerticalScrollbar (
159+ adapter = scrollAdapter,
160+ modifier = Modifier .fillMaxHeight()
161+ .align(Alignment .TopEnd ),
162+ )
152163 }
153164 }
154165}
0 commit comments