Skip to content

Commit

Permalink
chore: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Aug 11, 2024
1 parent 05b1052 commit 5687f95
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 44 deletions.
46 changes: 23 additions & 23 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion lala_bar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ iced = { version = "0.12", features = [
] }
#iced_native = "0.12"
iced_runtime = "0.12"
iced_layershell = { git = "https://github.com/waycrate/exwlshelleventloop", package = "iced_layershell", branch = "mutiwindowcreate" }
iced_layershell = { git = "https://github.com/waycrate/exwlshelleventloop", package = "iced_layershell" }
tokio = { version = "1.39", features = ["full"] }
iced_futures = "0.12.0"
env_logger = "0.11.5"
Expand Down
40 changes: 20 additions & 20 deletions lala_bar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub fn main() -> Result<(), iced_layershell::Error> {
enum LaLaInfo {
Launcher,
Notify(NotifyUnitWidgetInfo),
HidenInfo,
HiddenInfo,
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -91,7 +91,7 @@ struct LalaMusicBar {
launcherid: Option<iced::window::Id>,
hidenid: Option<iced::window::Id>,
notifications: HashMap<iced::window::Id, NotifyUnitWidgetInfo>,
hidded_notifications: Vec<NotifyUnitWidgetInfo>,
hidden_notifications: Vec<NotifyUnitWidgetInfo>,
sender: Sender<NotifyCommand>,
receiver: Arc<Mutex<Receiver<NotifyCommand>>>,
}
Expand Down Expand Up @@ -377,7 +377,7 @@ impl MultiApplication for LalaMusicBar {
launcherid: None,
hidenid: None,
notifications: HashMap::new(),
hidded_notifications: Vec::new(),
hidden_notifications: Vec::new(),
sender,
receiver: Arc::new(Mutex::new(receiver)),
},
Expand All @@ -393,7 +393,7 @@ impl MultiApplication for LalaMusicBar {
if self.launcherid.is_some_and(|tid| tid == id) {
Some(LaLaInfo::Launcher)
} else if self.hidenid.is_some_and(|tid| tid == id) {
Some(LaLaInfo::HidenInfo)
Some(LaLaInfo::HiddenInfo)
} else {
self.notifications.get(&id).cloned().map(LaLaInfo::Notify)
}
Expand All @@ -407,7 +407,7 @@ impl MultiApplication for LalaMusicBar {
LaLaInfo::Notify(notify) => {
self.notifications.entry(id).or_insert(notify);
}
LaLaInfo::HidenInfo => {
LaLaInfo::HiddenInfo => {
self.hidenid = Some(id);
}
}
Expand Down Expand Up @@ -542,7 +542,7 @@ impl MultiApplication for LalaMusicBar {
}
Message::Notify(NotifyMessage::UnitAdd(notify)) => {
let mut commands = vec![];
for unit in self.hidded_notifications.iter_mut() {
for unit in self.hidden_notifications.iter_mut() {
unit.upper += 135;
unit.counter += 1;
}
Expand All @@ -551,7 +551,7 @@ impl MultiApplication for LalaMusicBar {
unit.upper += 135;
unit.counter += 1;
if unit.counter > 3 {
self.hidded_notifications.push(unit.clone());
self.hidden_notifications.push(unit.clone());
commands.push(Command::single(Action::Window(WindowAction::Close(*id))));
} else {
commands.push(Command::single(
Expand Down Expand Up @@ -588,7 +588,7 @@ impl MultiApplication for LalaMusicBar {
.into(),
));

if !self.hidded_notifications.is_empty() && self.hidenid.is_none() {
if !self.hidden_notifications.is_empty() && self.hidenid.is_none() {
commands.push(Command::single(
LaLaShellIdAction::new(
iced::window::Id::MAIN,
Expand All @@ -602,7 +602,7 @@ impl MultiApplication for LalaMusicBar {
keyboard_interactivity: KeyboardInteractivity::OnDemand,
use_last_output: true,
},
LaLaInfo::HidenInfo,
LaLaInfo::HiddenInfo,
)),
)
.into(),
Expand Down Expand Up @@ -653,7 +653,7 @@ impl MultiApplication for LalaMusicBar {
}

let remove_hided_notifications_count: Vec<usize> = self
.hidded_notifications
.hidden_notifications
.iter()
.filter(
|NotifyUnitWidgetInfo {
Expand All @@ -664,22 +664,22 @@ impl MultiApplication for LalaMusicBar {
.map(|NotifyUnitWidgetInfo { counter, .. }| *counter)
.collect();

self.hidded_notifications.retain(
self.hidden_notifications.retain(
|NotifyUnitWidgetInfo {
unit: NotifyUnit { id, .. },
..
}| *id == removed_id,
);

for count in remove_hided_notifications_count {
for unit in self.hidded_notifications.iter_mut() {
for unit in self.hidden_notifications.iter_mut() {
if unit.counter > count {
unit.counter -= 1;
unit.upper -= 135;
}
}
}
for notify in self.hidded_notifications.iter() {
for notify in self.hidden_notifications.iter() {
if notify.counter <= 4 {
commands.push(Command::single(
LaLaShellIdAction::new(
Expand All @@ -702,10 +702,10 @@ impl MultiApplication for LalaMusicBar {
}
}

self.hidded_notifications
self.hidden_notifications
.retain(|NotifyUnitWidgetInfo { counter, .. }| *counter > 4);

if self.hidded_notifications.is_empty() && self.hidenid.is_some() {
if self.hidden_notifications.is_empty() && self.hidenid.is_some() {
let hidenid = self.hidenid.unwrap();

commands.push(Command::single(Action::Window(WindowAction::Close(
Expand Down Expand Up @@ -754,7 +754,7 @@ impl MultiApplication for LalaMusicBar {
}

let mut to_show_id = None;
for (index, notify) in self.hidded_notifications.iter_mut().enumerate() {
for (index, notify) in self.hidden_notifications.iter_mut().enumerate() {
notify.counter -= 1;
notify.upper -= 135;
if notify.counter == 3 {
Expand All @@ -781,10 +781,10 @@ impl MultiApplication for LalaMusicBar {
}

if let Some(index) = to_show_id {
self.hidded_notifications.remove(index);
self.hidden_notifications.remove(index);
}

if self.hidded_notifications.is_empty() && self.hidenid.is_some() {
if self.hidden_notifications.is_empty() && self.hidenid.is_some() {
let hidenid = self.hidenid.unwrap();

commands.push(Command::single(Action::Window(WindowAction::Close(
Expand Down Expand Up @@ -929,10 +929,10 @@ impl MultiApplication for LalaMusicBar {
}
return btnwidgets;
}
LaLaInfo::HidenInfo => {
LaLaInfo::HiddenInfo => {
return text(format!(
"hidden notifications {}",
self.hidded_notifications.len()
self.hidden_notifications.len()
))
.into();
}
Expand Down

0 comments on commit 5687f95

Please sign in to comment.