Skip to content

Commit

Permalink
feat: use the 0.7.1 iced_layershell
Browse files Browse the repository at this point in the history
publish new version
  • Loading branch information
Decodetalkers committed Sep 21, 2024
1 parent 3fe1c53 commit 3d3c297
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 50 deletions.
28 changes: 20 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ resolver = "2"
members = ["./lala_bar", "./iced_zbus_notification"]

[workspace.package]
version = "0.3.16"
version = "0.4.0"
edition = "2021"
authors = ["Decodertalkers <aakari@tutanota.com>"]
license = "MIT"
repository = "https://github.com/Decodetalkers/lala-bar"
readme = "README.md"

[workspace.dependencies]
iced_zbus_notification = { version = "0.3.14", path = "iced_zbus_notification" }
iced_zbus_notification = { version = "0.4.0", path = "iced_zbus_notification" }
futures = "0.3.30"
serde = { version = "1.0.210", features = ["derive"] }
url = "2.5.2"
Expand Down
2 changes: 1 addition & 1 deletion lala_bar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ iced = { version = "0.13.1", features = [
"svg",
] }
iced_runtime = "0.13.0"
iced_layershell = "0.7.0-beta1"
iced_layershell = "0.7.1"
tokio = { version = "1.40", features = ["full"] }
iced_futures = "0.13.1"
env_logger = "0.11.5"
Expand Down
41 changes: 2 additions & 39 deletions lala_bar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ use iced::widget::{
};
use iced::{executor, Alignment, Font};
use iced::{Element, Length, Task as Command, Theme};
use iced_layershell::actions::{
LayershellCustomActionsWithIdAndInfo, LayershellCustomActionsWithInfo,
};
use iced_zbus_notification::{
start_connection, ImageInfo, LaLaMako, MessageSender, NotifyMessage, NotifyUnit, VersionInfo,
DEFAULT_ACTION, NOTIFICATION_SERVICE_PATH,
Expand All @@ -22,6 +19,7 @@ use zbus_mpirs::ServiceInfo;
use chrono::prelude::*;
use iced_layershell::reexport::{Anchor, KeyboardInteractivity, Layer, NewLayerShellSettings};
use iced_layershell::settings::{LayerShellSettings, Settings};
use iced_layershell::to_layer_message;
use iced_layershell::MultiApplication;
use iced_runtime::window::Action as WindowAction;
use iced_runtime::Action;
Expand All @@ -34,9 +32,6 @@ mod aximer;
mod launcher;
mod zbus_mpirs;

type LaLaShellIdAction = LayershellCustomActionsWithIdAndInfo<LaLaInfo>;
type LalaShellAction = LayershellCustomActionsWithInfo<LaLaInfo>;

const BEGINNING_UP_MARGIN: i32 = 10;

const UNIT_MARGIN: i32 = 135;
Expand Down Expand Up @@ -533,7 +528,7 @@ impl LalaMusicBar {
}
}

#[derive(Debug, Clone)]
#[to_layer_message(multi, info_name = "LaLaInfo", derives = "Debug Clone")]
enum Message {
RequestPre,
RequestNext,
Expand All @@ -560,38 +555,6 @@ enum Message {
QuiteMode(bool),
CloseErrorNotification(iced::window::Id),
Ready(Sender<NotifyCommand>),

// LayerShellInfo
NewLayerShell {
info: LaLaInfo,
settings: NewLayerShellSettings,
},
ForgetLastOutput,
MarginChange {
id: iced::window::Id,
margin: (i32, i32, i32, i32),
},
}

impl TryInto<LaLaShellIdAction> for Message {
type Error = Self;
fn try_into(self) -> Result<LaLaShellIdAction, Self::Error> {
match self {
Self::NewLayerShell { info, settings } => Ok(LaLaShellIdAction::new(
None,
LalaShellAction::NewLayerShell((settings, info)),
)),
Self::ForgetLastOutput => Ok(LaLaShellIdAction::new(
None,
LalaShellAction::ForgetLastOutput,
)),
Self::MarginChange { id, margin } => Ok(LaLaShellIdAction::new(
Some(id),
LalaShellAction::MarginChange(margin),
)),
_ => Err(self),
}
}
}

impl From<NotifyMessage> for Message {
Expand Down

0 comments on commit 3d3c297

Please sign in to comment.