Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
oknozor committed Jan 22, 2024
1 parent d164857 commit 58bc255
Show file tree
Hide file tree
Showing 17 changed files with 799 additions and 1,182 deletions.
1,817 changes: 718 additions & 1,099 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ codegen-units = 1
lto = true

[features]
default = ["iced/wgpu", "iced/default_system_font", "iced/palette", "cli"]
default = ["iced/wgpu", "iced/palette", "cli"]
cli = ["structopt"]
debug = ["iced/debug"]

[dependencies]
iced = { version = "0.9.0", features = ["wgpu", "default_system_font", "palette", "svg", "image", "tokio"] }
iced_core = "0.9.0"
iced_native = "0.10.3"
iced_style = "0.8.0"
iced = { version = "0.10.0", features = ["wgpu", "palette", "svg", "image", "tokio"] }
iced_core = "0.10.0"
iced_runtime = "0.1.1"
iced_style = "0.9.0"
tokio = { version = "1.29.1", features = ["process", "macros", "io-util"] }
sled = "0.34.7"

pop-launcher-toolkit = { git = "https://github.com/pop-os/launcher/" }
pop-launcher-toolkit = { path = "../launcher/toolkit" }
structopt = { version = "^0", default-features = false, optional = true }
freedesktop-icons = "0.2.3"

log = { version = "^0.4" }
systemd-journal-logger = "1.0.0"
systemd-journal-logger = "2.1.1"

once_cell = "^1"
anyhow = "^1"
Expand All @@ -48,7 +48,6 @@ serde_ini = "0.2.0"
serde_json = "1.0.99"
pest = "2.7.0"
pest_derive = "2.7.0"
font-kit = "0.10.1"
ico = "0.3.0"
regex = "1.8.4"
shell-words = "^1"
Expand Down
11 changes: 4 additions & 7 deletions src/app/entries/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ use crate::app::style::rows::RowStyles;
use crate::app::Message;
use crate::icons::{fallback_icon, Extension, IconPath};
use crate::THEME;
use iced::widget::{Container, Image, Row};
use iced::widget::{column, Container, container, Image, Row, row, text};
use iced::{Alignment, Length, Renderer};
use iced_native::row;
use iced_native::widget::{column, container, text};
use std::borrow::Cow;

pub(crate) mod db_entry;
Expand Down Expand Up @@ -44,8 +42,8 @@ pub(crate) trait AsEntry<'a> {
where
'b: 'a,
{
let title_row: iced_native::widget::Container<'_, Message, Renderer> = container(
iced_native::widget::row(vec![text(self.get_display_name())
let title_row: iced::widget::Container<'_, Message, Renderer> = container(
iced::widget::row(vec![text(self.get_display_name())
.size(theme.title.font_size)
.into()]),
)
Expand All @@ -58,8 +56,7 @@ pub(crate) trait AsEntry<'a> {
.align_x(theme.title.align_x)
.align_y(theme.title.align_y);

let description_row: std::option::Option<
iced_native::widget::Container<'_, Message, Renderer>,
let description_row: Option<Container<'_, Message, Renderer>,
> = self.get_description().map(|description| {
container(row!(
text(description.as_ref()).size(theme.description.font_size)
Expand Down
52 changes: 26 additions & 26 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
use crate::app::entries::pop_entry::PopSearchResult;
use std::path::Path;
use std::process::exit;

use iced::{Application, Command, Element, Length, Renderer, Settings, Subscription, subscription, window};
use iced::alignment::{Horizontal, Vertical};
use iced::futures::channel::mpsc::{Sender, TrySendError};
use iced::keyboard::KeyCode;
use iced::widget::{Column, column, Container, container, Row, scrollable, Text, text_input};
use iced::window::PlatformSpecific;
use iced_core::{Event, Font};
use iced_core::widget::operation::scrollable::RelativeOffset;
use iced_style::Theme;
use log::{debug, trace};
use once_cell::sync::Lazy;
use pop_launcher_toolkit::launcher::{Request, Response};

use crate::app::entries::AsEntry;
use crate::app::entries::pop_entry::PopSearchResult;
use crate::app::mode::ActiveMode;
use crate::app::plugin_matchers::Plugin;
use crate::app::state::{Selection, State};
Expand All @@ -8,25 +24,9 @@ use crate::app::subscriptions::pop_launcher::{PopLauncherSubscription, Subscript
use crate::db::desktop_entry::DesktopEntryEntity;
use crate::db::plugin::PluginCommandEntity;
use crate::db::web::WebEntity;
use crate::font::DEFAULT_FONT;
use crate::freedesktop::desktop::DesktopEntry;
use crate::icons::IconPath;
use crate::{font, THEME};
use iced::alignment::{Horizontal, Vertical};
use iced::futures::channel::mpsc::{Sender, TrySendError};
use iced::keyboard::KeyCode;
use iced::widget::{Column, Container, Row, Text};
use iced::window::PlatformSpecific;
use iced::{window, Application, Command, Element, Length, Renderer, Settings};
use iced_native::widget::scrollable::RelativeOffset;
use iced_native::widget::{column, container, scrollable, text_input};
use iced_native::{Event, Subscription};
use iced_style::Theme;
use log::{debug, trace};
use once_cell::sync::Lazy;
use pop_launcher_toolkit::launcher::{Request, Response};
use std::path::Path;
use std::process::exit;
use crate::THEME;

pub mod cache;
pub mod entries;
Expand All @@ -42,31 +42,31 @@ pub fn run() -> iced::Result {
let default_font = THEME
.font
.as_ref()
.and_then(|font| font::load(font))
.unwrap_or(DEFAULT_FONT);
.map(|font| Font::with_name(font))
.unwrap_or(Font::default());

Onagre::run(Settings {
id: Some("onagre".to_string()),
window: window::Settings {
transparent: true,
size: THEME.size,
decorations: false,
always_on_top: true,
resizable: false,
position: window::Position::Centered,
min_size: None,
max_size: None,
icon: None,
visible: true,
platform_specific: PlatformSpecific,
platform_specific: PlatformSpecific {
application_id: "onagre".to_string(),
},
level: Default::default(),
},
default_text_size: THEME.font_size as f32,
text_multithreading: false,
antialiasing: true,
exit_on_close_request: false,
default_font: Some(default_font),
default_font,
flags: (),
try_opengles_first: true,
})
}

Expand Down Expand Up @@ -607,7 +607,7 @@ impl Onagre<'_> {
}

fn keyboard_event() -> Subscription<Message> {
iced_native::subscription::events_with(|event, _status| match event {
subscription::events_with(|event, _status| match event {
Event::Window(window::Event::Unfocused) => Some(Message::Unfocused),
Event::Keyboard(iced::keyboard::Event::KeyPressed {
modifiers: _,
Expand Down
2 changes: 1 addition & 1 deletion src/app/state.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use crate::app::cache::Cache;
use crate::app::mode::ActiveMode;
use crate::app::plugin_matchers::{match_web_plugins, Plugin};
use iced_native::widget::{scrollable, text_input};
use log::debug;
use pop_launcher_toolkit::launcher::SearchResult;

use crate::app::{Message, INPUT_ID};
use crate::icons::IconPath;
use crate::THEME;
use std::collections::HashMap;
use iced::widget::{scrollable, text_input};

#[derive(Debug)]
pub struct State<'a> {
Expand Down
4 changes: 2 additions & 2 deletions src/app/style/app.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use iced_core::{Background, BorderRadius};
use crate::app::style::scrollable::scroller::ScrollerStyles;
use crate::app::style::scrollable::RowContainerStyle;
use crate::app::style::search::SearchContainerStyles;
use crate::config::color::OnagreColor;
use crate::config::padding::OnagrePadding;
use iced_native::Background;
use iced_style::container::{Appearance, StyleSheet};

// The top level container wrapping the app
Expand Down Expand Up @@ -36,7 +36,7 @@ impl StyleSheet for &AppContainerStyles {
Appearance {
text_color: Some(self.color.into()),
background: Some(Background::Color(self.background.into())),
border_radius: self.border_radius,
border_radius: BorderRadius::from(self.border_radius),
border_width: self.border_width,
border_color: self.border_color.into(),
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/style/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::config::color::OnagreColor;
use crate::config::padding::OnagrePadding;
use iced::widget::container::Appearance;
use iced::Background;
use iced_core::BorderRadius;

pub mod app;
pub mod rows;
Expand Down Expand Up @@ -108,7 +109,7 @@ impl iced::widget::container::StyleSheet for &Theme {
fn appearance(&self, _: &Self::Style) -> Appearance {
Appearance {
background: Some(Background::Color(self.background.into())),
border_radius: self.border_radius,
border_radius: BorderRadius::from(self.border_radius),
border_width: self.border_width,
text_color: Some(self.color.into()),
border_color: self.border_color.into(),
Expand Down
4 changes: 2 additions & 2 deletions src/app/style/rows/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::config::color::OnagreColor;
use crate::config::padding::OnagrePadding;
use iced::alignment::{Horizontal, Vertical};
use iced::Length;
use iced_core::Background;
use iced_core::{Background, BorderRadius};
use iced_style::container::{Appearance, StyleSheet};

#[derive(Debug, PartialEq, Clone)]
Expand Down Expand Up @@ -48,7 +48,7 @@ impl StyleSheet for &GenericContainerStyle {
Appearance {
text_color: Some(self.color.into()),
background: Some(Background::Color(self.background.into())),
border_radius: self.border_radius,
border_radius: BorderRadius::from(self.border_radius),
border_width: self.border_width,
border_color: self.border_color.into(),
}
Expand Down
6 changes: 4 additions & 2 deletions src/app/style/rows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ use crate::config::padding::OnagrePadding;
use generic::GenericContainerStyle;
use iced::alignment::{Horizontal, Vertical};
use iced::Length;
use iced_core::BorderRadius;
use icon::IconStyle;
use iced_native::Background;
use iced_style::container::{Appearance, StyleSheet};
use iced_core::Background;

pub mod generic;
pub mod icon;

Expand Down Expand Up @@ -42,7 +44,7 @@ impl StyleSheet for &RowStyles {
Appearance {
text_color: Some(self.color.into()),
background: Some(Background::Color(self.background.into())),
border_radius: self.border_radius,
border_radius: BorderRadius::from(self.border_radius),
border_width: self.border_width,
border_color: self.border_color.into(),
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/style/scrollable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::app::style::rows::RowStyles;
use crate::config::color::OnagreColor;
use crate::config::padding::OnagrePadding;
use iced::Length;
use iced_core::Background;
use iced_core::{Background, BorderRadius};
use iced_style::container::{Appearance, StyleSheet};

pub mod scroller;
Expand Down Expand Up @@ -35,7 +35,7 @@ impl StyleSheet for &RowContainerStyle {
Appearance {
text_color: Some(self.color.into()),
background: Some(Background::Color(self.background.into())),
border_radius: self.border_radius,
border_radius: BorderRadius::from(self.border_radius),
border_width: self.border_width,
border_color: self.border_color.into(),
}
Expand Down
5 changes: 3 additions & 2 deletions src/app/style/scrollable/scroller.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::config::color::OnagreColor;
use iced::widget::scrollable::Scrollbar;
use iced::Background;
use iced_core::BorderRadius;
use iced_style::scrollable::StyleSheet;
use iced_style::theme::Scrollable;

Expand Down Expand Up @@ -51,12 +52,12 @@ impl StyleSheet for &ScrollerStyles {
fn active(&self, _: &Self::Style) -> Scrollbar {
Scrollbar {
background: Some(Background::Color(self.background.into())),
border_radius: self.border_radius,
border_radius: BorderRadius::from(self.border_radius),
border_width: self.border_width,
border_color: self.border_color.into(),
scroller: iced::widget::scrollable::Scroller {
color: self.scroller_color.into(),
border_radius: self.scroller_border_radius,
border_radius: BorderRadius::from(self.scroller_border_radius),
border_width: self.scroller_border_width,
border_color: self.scroller_border_color.into(),
},
Expand Down
6 changes: 3 additions & 3 deletions src/app/style/search/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::config::color::OnagreColor;
use crate::config::padding::OnagrePadding;
use iced::alignment::{Horizontal, Vertical};
use iced::Length;
use iced_core::{Background, Color};
use iced_core::{Background, BorderRadius, Color};
use iced_style::text_input::{Appearance, StyleSheet};

#[derive(Debug, PartialEq)]
Expand Down Expand Up @@ -34,7 +34,7 @@ impl StyleSheet for &SearchInputStyles {
fn active(&self, _: &Self::Style) -> Appearance {
Appearance {
background: Background::Color(self.background.into()),
border_radius: self.border_radius,
border_radius: BorderRadius::from(self.border_radius),
border_width: self.border_width,
border_color: self.border_color.into(),
icon_color: Default::default(),
Expand Down Expand Up @@ -64,7 +64,7 @@ impl StyleSheet for &SearchInputStyles {
fn disabled(&self, _style: &Self::Style) -> Appearance {
Appearance {
background: Background::Color(self.background.into()),
border_radius: self.border_radius,
border_radius: BorderRadius::from(self.border_radius),
border_width: self.border_width,
border_color: self.border_color.into(),
icon_color: Default::default(),
Expand Down
4 changes: 2 additions & 2 deletions src/app/style/search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::config::color::OnagreColor;
use crate::config::padding::OnagrePadding;
use iced::alignment::{Horizontal, Vertical};
use iced::Length;
use iced_core::Background;
use iced_core::{Background, BorderRadius};
use iced_style::container::{Appearance, StyleSheet};
use input::SearchInputStyles;

Expand Down Expand Up @@ -41,7 +41,7 @@ impl StyleSheet for &SearchContainerStyles {
Appearance {
text_color: Some(self.color.into()),
background: Some(Background::Color(self.background.into())),
border_radius: self.border_radius,
border_radius: BorderRadius::from(self.border_radius),
border_width: self.border_width,
border_color: self.border_color.into(),
}
Expand Down
23 changes: 11 additions & 12 deletions src/app/subscriptions/plugin_configs.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
use crate::app::plugin_matchers::Plugin;
use std::hash::{Hasher};

use iced::futures::stream::BoxStream;
use iced::futures::StreamExt;
use iced_native::futures::stream::BoxStream;
use iced_native::Subscription;
use iced::Subscription;
use iced_core::event::Status;
use iced_runtime::futures::subscription::Recipe;

use crate::app::plugin_matchers::Plugin;
use crate::icons::IconPath;
use crate::THEME;
use std::hash::Hash;

pub struct PluginMatcherSubscription;

Expand All @@ -15,18 +18,14 @@ impl PluginMatcherSubscription {
}
}

impl<H, I> iced_native::subscription::Recipe<H, I> for PluginMatcherSubscription
where
H: std::hash::Hasher,
{
impl Recipe for PluginMatcherSubscription {
type Output = Plugin;

fn hash(&self, state: &mut H) {
std::any::TypeId::of::<Self>().hash(state);
"PluginMatcherSubscription".hash(state)
fn hash(&self, state: &mut iced_core::Hasher) {
state.write("PluginMatcherSubscription".as_bytes())
}

fn stream(self: Box<Self>, _: BoxStream<I>) -> BoxStream<Self::Output> {
fn stream(self: Box<Self>, _: BoxStream<(iced::Event, Status)>) -> BoxStream<Self::Output> {
Box::pin(
pop_launcher_toolkit::service::load::from_paths().map(|(path, config, regex)| {
let icon: Option<IconPath> = THEME.icon_theme.as_ref().and_then(|theme| {
Expand Down
Loading

0 comments on commit 58bc255

Please sign in to comment.