@@ -19,14 +19,10 @@ use crate::pages::{self, display, system, time};
19
19
use crate :: subscription:: desktop_files;
20
20
use crate :: widget:: { page_title, search_header} ;
21
21
use crate :: PageCommands ;
22
- use cosmic:: app:: command:: set_theme;
23
22
use cosmic:: app:: context_drawer:: ContextDrawer ;
24
- #[ cfg( feature = "single-instance" ) ]
25
- use cosmic:: app:: DbusActivationMessage ;
26
23
#[ cfg( feature = "wayland" ) ]
27
24
use cosmic:: cctk:: { sctk:: output:: OutputInfo , wayland_client:: protocol:: wl_output:: WlOutput } ;
28
25
use cosmic:: iced:: Subscription ;
29
- use cosmic:: surface_message:: SurfaceMessage ;
30
26
use cosmic:: widget:: { self , button, row, text_input} ;
31
27
use cosmic:: {
32
28
app:: { Core , Task } ,
@@ -36,6 +32,7 @@ use cosmic::{
36
32
window, Length ,
37
33
} ,
38
34
prelude:: * ,
35
+ surface,
39
36
widget:: {
40
37
column, container, icon, id_container, nav_bar, scrollable, segmented_button, settings,
41
38
} ,
@@ -140,23 +137,6 @@ impl SettingsApp {
140
137
}
141
138
}
142
139
143
- #[ cfg( feature = "wayland" ) ]
144
- impl From < Message > for cosmic:: surface_message:: MessageWrapper < Message > {
145
- fn from ( value : Message ) -> Self {
146
- match value {
147
- Message :: Surface ( msg) => cosmic:: surface_message:: MessageWrapper :: Surface ( msg) ,
148
- msg => cosmic:: surface_message:: MessageWrapper :: Message ( msg) ,
149
- }
150
- }
151
- }
152
-
153
- #[ cfg( feature = "wayland" ) ]
154
- impl From < SurfaceMessage > for Message {
155
- fn from ( value : SurfaceMessage ) -> Self {
156
- Message :: Surface ( value)
157
- }
158
- }
159
-
160
140
#[ derive( Clone , Debug ) ]
161
141
pub enum Message {
162
142
CloseContextDrawer ,
@@ -179,7 +159,7 @@ pub enum Message {
179
159
SearchSubmit ,
180
160
SetTheme ( cosmic:: theme:: Theme ) ,
181
161
SetWindowTitle ,
182
- Surface ( SurfaceMessage ) ,
162
+ Surface ( surface :: Action ) ,
183
163
}
184
164
185
165
impl cosmic:: Application for SettingsApp {
@@ -737,7 +717,7 @@ impl cosmic::Application for SettingsApp {
737
717
}
738
718
}
739
719
740
- Message :: SetTheme ( t) => return set_theme ( t) ,
720
+ Message :: SetTheme ( t) => return cosmic :: command :: set_theme ( t) ,
741
721
742
722
Message :: OpenContextDrawer ( page, title) => {
743
723
self . core . window . show_context = true ;
@@ -753,18 +733,22 @@ impl cosmic::Application for SettingsApp {
753
733
Message :: Error ( error) => {
754
734
tracing:: error!( error, "error occurred" ) ;
755
735
}
756
- Message :: Surface ( _) => { }
736
+ Message :: Surface ( a) => {
737
+ return cosmic:: task:: message ( cosmic:: Action :: Cosmic (
738
+ cosmic:: app:: Action :: Surface ( a) ,
739
+ ) ) ;
740
+ }
757
741
}
758
742
759
743
Task :: none ( )
760
744
}
761
745
762
746
#[ cfg( feature = "single-instance" ) ]
763
- fn dbus_activation ( & mut self , msg : DbusActivationMessage ) -> Task < Self :: Message > {
747
+ fn dbus_activation ( & mut self , msg : cosmic :: dbus_activation :: Message ) -> Task < Self :: Message > {
764
748
match msg. msg {
765
- cosmic:: app :: DbusActivationDetails :: Activate
766
- | cosmic:: app :: DbusActivationDetails :: Open { .. } => None ,
767
- cosmic:: app :: DbusActivationDetails :: ActivateAction { action, .. } => {
749
+ cosmic:: dbus_activation :: Details :: Activate
750
+ | cosmic:: dbus_activation :: Details :: Open { .. } => None ,
751
+ cosmic:: dbus_activation :: Details :: ActivateAction { action, .. } => {
768
752
PageCommands :: from_str ( & action)
769
753
. ok ( )
770
754
. and_then ( |action| self . subtask_to_page ( & action) )
0 commit comments