Skip to content

Commit 77160c2

Browse files
committed
app: scroll when list of profiles is big
1 parent 6c0503e commit 77160c2

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

crates/companion-app/src/main.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::path::PathBuf;
1313
use std::sync::{Arc, LazyLock, Mutex, mpsc};
1414
use std::time::Duration;
1515

16-
use iced::widget::{self, Column, Space, button, column, container, row, text};
16+
use iced::widget::{self, Column, Space, button, column, container, row, scrollable, text};
1717
use iced::{Element, Fill, Font, Subscription, Task, Theme, clipboard, font};
1818
use tracing::{debug, error, info, instrument, trace};
1919
use uuid::Uuid;
@@ -400,7 +400,15 @@ fn view(state: &State) -> Element<'_, Message> {
400400
]
401401
.spacing(10);
402402

403-
container(
403+
// currently entire block is inside scrollable because when only profiles
404+
// list is in scrollable it moves buttons below it outside of screen
405+
//
406+
// scrollable(profiles).height(Fill) helps, but it remains the same heigth
407+
// when list is small
408+
//
409+
// scrollable(profiles).height(Shrink) fixes problem with small list, but
410+
// does not help with initial problem. probably this is a bug in iced
411+
container(scrollable(
404412
column![
405413
top_block,
406414
Column::from_iter(profiles),
@@ -409,7 +417,7 @@ fn view(state: &State) -> Element<'_, Message> {
409417
bottom_block,
410418
]
411419
.spacing(10),
412-
)
420+
))
413421
.padding(10)
414422
.center_x(Fill)
415423
.center_y(Fill)

0 commit comments

Comments
 (0)