@@ -9,9 +9,6 @@ use iced::widget::{
9
9
} ;
10
10
use iced:: { executor, Alignment , Font } ;
11
11
use iced:: { Element , Length , Task as Command , Theme } ;
12
- use iced_layershell:: actions:: {
13
- LayershellCustomActionsWithIdAndInfo , LayershellCustomActionsWithInfo ,
14
- } ;
15
12
use iced_zbus_notification:: {
16
13
start_connection, ImageInfo , LaLaMako , MessageSender , NotifyMessage , NotifyUnit , VersionInfo ,
17
14
DEFAULT_ACTION , NOTIFICATION_SERVICE_PATH ,
@@ -22,6 +19,7 @@ use zbus_mpirs::ServiceInfo;
22
19
use chrono:: prelude:: * ;
23
20
use iced_layershell:: reexport:: { Anchor , KeyboardInteractivity , Layer , NewLayerShellSettings } ;
24
21
use iced_layershell:: settings:: { LayerShellSettings , Settings } ;
22
+ use iced_layershell:: to_layer_message;
25
23
use iced_layershell:: MultiApplication ;
26
24
use iced_runtime:: window:: Action as WindowAction ;
27
25
use iced_runtime:: Action ;
@@ -34,9 +32,6 @@ mod aximer;
34
32
mod launcher;
35
33
mod zbus_mpirs;
36
34
37
- type LaLaShellIdAction = LayershellCustomActionsWithIdAndInfo < LaLaInfo > ;
38
- type LalaShellAction = LayershellCustomActionsWithInfo < LaLaInfo > ;
39
-
40
35
const BEGINNING_UP_MARGIN : i32 = 10 ;
41
36
42
37
const UNIT_MARGIN : i32 = 135 ;
@@ -533,7 +528,7 @@ impl LalaMusicBar {
533
528
}
534
529
}
535
530
536
- #[ derive ( Debug , Clone ) ]
531
+ #[ to_layer_message ( multi , info_name = "LaLaInfo" , derives = "Debug Clone" ) ]
537
532
enum Message {
538
533
RequestPre ,
539
534
RequestNext ,
@@ -560,38 +555,6 @@ enum Message {
560
555
QuiteMode ( bool ) ,
561
556
CloseErrorNotification ( iced:: window:: Id ) ,
562
557
Ready ( Sender < NotifyCommand > ) ,
563
-
564
- // LayerShellInfo
565
- NewLayerShell {
566
- info : LaLaInfo ,
567
- settings : NewLayerShellSettings ,
568
- } ,
569
- ForgetLastOutput ,
570
- MarginChange {
571
- id : iced:: window:: Id ,
572
- margin : ( i32 , i32 , i32 , i32 ) ,
573
- } ,
574
- }
575
-
576
- impl TryInto < LaLaShellIdAction > for Message {
577
- type Error = Self ;
578
- fn try_into ( self ) -> Result < LaLaShellIdAction , Self :: Error > {
579
- match self {
580
- Self :: NewLayerShell { info, settings } => Ok ( LaLaShellIdAction :: new (
581
- None ,
582
- LalaShellAction :: NewLayerShell ( ( settings, info) ) ,
583
- ) ) ,
584
- Self :: ForgetLastOutput => Ok ( LaLaShellIdAction :: new (
585
- None ,
586
- LalaShellAction :: ForgetLastOutput ,
587
- ) ) ,
588
- Self :: MarginChange { id, margin } => Ok ( LaLaShellIdAction :: new (
589
- Some ( id) ,
590
- LalaShellAction :: MarginChange ( margin) ,
591
- ) ) ,
592
- _ => Err ( self ) ,
593
- }
594
- }
595
558
}
596
559
597
560
impl From < NotifyMessage > for Message {
0 commit comments