Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set max height for previews #794

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,9 @@ impl App {
}

fn desktop_view_options(&self) -> Element<Message> {
let cosmic_theme::Spacing { space_l, .. } = theme::active().cosmic().spacing;
let cosmic_theme::Spacing {
space_m, space_l, ..
} = theme::active().cosmic().spacing;
let config = self.config.desktop;

let mut children = Vec::new();
Expand Down Expand Up @@ -1349,6 +1351,7 @@ impl App {

widget::column::with_children(children)
.padding([0, space_l, space_l, space_l])
.spacing(space_m)
.into()
}

Expand Down
26 changes: 12 additions & 14 deletions src/tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1400,11 +1400,11 @@ impl Item {

let mut column = widget::column().spacing(space_m);

column = column.push(widget::row::with_children(vec![
widget::horizontal_space().into(),
self.preview(sizes),
widget::horizontal_space().into(),
]));
column = column.push(
widget::container(self.preview(sizes))
.center_x(Length::Fill)
.max_height(THUMBNAIL_SIZE as f32),
);

let mut details = widget::column().spacing(space_xxxs);
details = details.push(widget::text::heading(self.name.clone()));
Expand Down Expand Up @@ -3922,15 +3922,13 @@ impl Tab {
}
Element::from(dnd_grid)
}),
mouse_area::MouseArea::new(
widget::container(widget::column::with_children(children)).width(Length::Fill),
)
.on_press(|_| Message::Click(None))
.on_drag(Message::Drag)
.on_drag_end(|_| Message::DragEnd(None))
.show_drag_rect(true)
.on_release(|_| Message::ClickRelease(None))
.into(),
mouse_area::MouseArea::new(widget::column::with_children(children).width(Length::Fill))
.on_press(|_| Message::Click(None))
.on_drag(Message::Drag)
.on_drag_end(|_| Message::DragEnd(None))
.show_drag_rect(true)
.on_release(|_| Message::ClickRelease(None))
.into(),
true,
)
}
Expand Down