Skip to content

Commit

Permalink
fix: fix iced migration issues
Browse files Browse the repository at this point in the history
  • Loading branch information
oknozor committed Feb 16, 2024
1 parent fa562ae commit be78857
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/entries/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub(crate) trait AsEntry<'a> {
};

let row = row
.height(Length::Fill)
.height(Length::Shrink)
.width(Length::Fill)
.spacing(theme.spacing)
// See : https://github.com/iced-rs/iced/pull/1044
Expand Down
15 changes: 8 additions & 7 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use iced::alignment::{Horizontal, Vertical};
use iced::futures::channel::mpsc::{Sender, TrySendError};
use iced::keyboard::Key;
use iced::widget::{column, container, scrollable, text_input, Column, Container, Row, Text};
use iced::{event, window, Application, Command, Element, Length, Settings, Subscription};
use iced::{
event, window, Application, Command, Element, Length, Renderer, Settings, Subscription,
};
use iced_core::keyboard::key::Named;
use iced_core::widget::operation::scrollable::RelativeOffset;
use iced_core::window::settings::PlatformSpecific;
Expand Down Expand Up @@ -158,8 +160,6 @@ impl Application for Onagre<'_> {
..
} if *history => {
// FIXME the .into() doesn't work anymore -- need to check why!
vec![]
/*
let icon = self.state.plugin_matchers.get_plugin_icon(plugin_name);
self.state
.cache
Expand All @@ -168,17 +168,18 @@ impl Application for Onagre<'_> {
.enumerate()
.map(|(idx, entry)| entry.to_row(selected, idx, icon.as_ref()).into())
.collect()
*/
}
ActiveMode::Web { modifier, .. } => {
let icon = self.state.plugin_matchers.get_plugin_icon("web");
self.state
let rows: Vec<Element<'_, Message, Theme, Renderer>> = self
.state
.cache
.web_history(modifier)
.iter()
.enumerate()
.map(|(idx, entry)| entry.to_row(selected, idx, icon.as_ref()).into())
.collect()
.collect();
rows
}
ActiveMode::History => {
let icon = self
Expand Down Expand Up @@ -245,7 +246,7 @@ impl Application for Onagre<'_> {
.align_y(THEME.search_input().align_y);

let search_bar = Row::new().width(Length::Fill).height(Length::Fill);
// Either plugin_hint is enabled and we try to display it
// Either plugin_hint is enabled, and we try to display it
// Or we display the normal search input
let search_bar = match THEME.plugin_hint() {
None => search_bar.push(search_input),
Expand Down

0 comments on commit be78857

Please sign in to comment.