@@ -44,8 +44,10 @@ pub struct Page {
4444enum Asset {
4545 WorkspaceSpanDisplay ,
4646 WorkspaceSeparateDisplay ,
47- WorkspaceOrientationVertical ,
48- WorkspaceOrientationHorizontal ,
47+ WorkspaceOrientationLeft ,
48+ WorkspaceOrientationRight ,
49+ WorkspaceOrientationTop ,
50+ WorkspaceOrientationBottom ,
4951 TrackpadGestureSwipeVertical ,
5052 TrackpadGestureSwipeHorizontal ,
5153 TrackpadGestureSwipeLeft ,
@@ -60,8 +62,10 @@ impl Asset {
6062 match self {
6163 Asset :: WorkspaceSpanDisplay => "assets/workspace-span-display" ,
6264 Asset :: WorkspaceSeparateDisplay => "assets/workspace-separate-display" ,
63- Asset :: WorkspaceOrientationVertical => "assets/workspace-orientation-vertical" ,
64- Asset :: WorkspaceOrientationHorizontal => "assets/workspace-orientation-horizontal" ,
65+ Asset :: WorkspaceOrientationLeft => "assets/workspace-orientation-left" ,
66+ Asset :: WorkspaceOrientationRight => "assets/workspace-orientation-right" ,
67+ Asset :: WorkspaceOrientationTop => "assets/workspace-orientation-top" ,
68+ Asset :: WorkspaceOrientationBottom => "assets/workspace-orientation-bottom" ,
6569 Asset :: TrackpadGestureSwipeVertical => "assets/trackpad-gesture-swipe-vertical" ,
6670 Asset :: TrackpadGestureSwipeHorizontal => "assets/trackpad-gesture-swipe-horizontal" ,
6771 Asset :: TrackpadGestureSwipeLeft => "assets/trackpad-gesture-swipe-left" ,
@@ -211,19 +215,36 @@ impl Page {
211215 fl!( "workspaces-orientation" , "right" ) ,
212216 ] ,
213217 } ;
218+ self . comp_workspace_config . workspace_thumbnail_placement =
219+ match self . comp_workspace_config . workspace_layout {
220+ WorkspaceLayout :: Vertical => {
221+ if self . selected_workspace_thumbnail_placement == 0 {
222+ WorkspaceThumbnailPlacement :: Left
223+ } else {
224+ WorkspaceThumbnailPlacement :: Right
225+ }
226+ }
227+ WorkspaceLayout :: Horizontal => {
228+ if self . selected_workspace_thumbnail_placement == 0 {
229+ WorkspaceThumbnailPlacement :: Top
230+ } else {
231+ WorkspaceThumbnailPlacement :: Bottom
232+ }
233+ }
234+ } ;
214235 self . save_comp_config ( ) ;
215236 }
216237 Message :: SetWorkspaceThumbnailPlacement ( value) => {
217238 self . comp_workspace_config . workspace_thumbnail_placement =
218239 match self . comp_workspace_config . workspace_layout {
219- WorkspaceLayout :: Horizontal => {
240+ WorkspaceLayout :: Vertical => {
220241 if value == 0 {
221242 WorkspaceThumbnailPlacement :: Left
222243 } else {
223244 WorkspaceThumbnailPlacement :: Right
224245 }
225246 }
226- WorkspaceLayout :: Vertical => {
247+ WorkspaceLayout :: Horizontal => {
227248 if value == 0 {
228249 WorkspaceThumbnailPlacement :: Top
229250 } else {
@@ -232,10 +253,7 @@ impl Page {
232253 }
233254 } ;
234255 self . selected_workspace_thumbnail_placement = value;
235- // TODO apply the setting
236- // if let Err(err) = self.config.set("show_workspace_number", value) {
237- // error!(?err, "Failed to set config 'show_workspace_number'");
238- // }
256+ self . save_comp_config ( ) ;
239257 }
240258 Message :: SetShowName ( value) => {
241259 self . show_workspace_name = value;
@@ -271,7 +289,7 @@ fn multi_behavior() -> Section<crate::pages::Message> {
271289 ListColumn :: default ( )
272290 . add (
273291 cosmic:: iced:: widget:: column!(
274- widget:: vertical_space( 1 ) ,
292+ widget:: vertical_space( ) . height ( 1 ) ,
275293 settings:: item_row( vec![ radio(
276294 text:: body( & descriptions[ span] ) ,
277295 WorkspaceMode :: Global ,
@@ -283,11 +301,11 @@ fn multi_behavior() -> Section<crate::pages::Message> {
283301 cosmic:: iced:: widget:: svg( asset_handle( Asset :: WorkspaceSpanDisplay ) )
284302 )
285303 . spacing ( cosmic:: theme:: active ( ) . cosmic ( ) . space_s ( ) )
286- . align_items ( Alignment :: Center ) ,
304+ . align_x ( Alignment :: Center ) ,
287305 )
288306 . add (
289307 cosmic:: iced:: widget:: column!(
290- widget:: vertical_space( 1 ) ,
308+ widget:: vertical_space( ) . height ( 1 ) ,
291309 settings:: item_row( vec![ radio(
292310 text:: body( & descriptions[ separate] ) ,
293311 WorkspaceMode :: OutputBound ,
@@ -299,7 +317,7 @@ fn multi_behavior() -> Section<crate::pages::Message> {
299317 cosmic:: iced:: widget:: svg( asset_handle( Asset :: WorkspaceSeparateDisplay ) )
300318 )
301319 . spacing ( cosmic:: theme:: active ( ) . cosmic ( ) . space_s ( ) )
302- . align_items ( Alignment :: Center ) ,
320+ . align_x ( Alignment :: Center ) ,
303321 )
304322 . spacing ( 0 ) )
305323 . title ( & section. title )
@@ -342,11 +360,15 @@ fn workspace_orientation() -> Section<crate::pages::Message> {
342360 . add (
343361 cosmic:: iced:: widget:: column!(
344362 cosmic:: iced:: widget:: svg(
345- match page. comp_workspace_config. workspace_layout {
346- WorkspaceLayout :: Vertical =>
347- asset_handle( Asset :: WorkspaceOrientationVertical ) ,
348- WorkspaceLayout :: Horizontal =>
349- asset_handle( Asset :: WorkspaceOrientationHorizontal ) ,
363+ match page. comp_workspace_config. workspace_thumbnail_placement {
364+ WorkspaceThumbnailPlacement :: Left =>
365+ asset_handle( Asset :: WorkspaceOrientationLeft ) ,
366+ WorkspaceThumbnailPlacement :: Right =>
367+ asset_handle( Asset :: WorkspaceOrientationRight ) ,
368+ WorkspaceThumbnailPlacement :: Top =>
369+ asset_handle( Asset :: WorkspaceOrientationTop ) ,
370+ WorkspaceThumbnailPlacement :: Bottom =>
371+ asset_handle( Asset :: WorkspaceOrientationBottom ) ,
350372 }
351373 ) ,
352374 cosmic:: iced:: widget:: container(
@@ -360,7 +382,7 @@ fn workspace_orientation() -> Section<crate::pages::Message> {
360382 . height( 32.0 ) ,
361383 )
362384 . spacing ( cosmic:: theme:: active ( ) . cosmic ( ) . space_m ( ) )
363- . align_items ( Alignment :: Center ) ,
385+ . align_x ( Alignment :: Center ) ,
364386 )
365387 . add ( settings:: item (
366388 & descriptions[ thumbnail_placement_label] ,
@@ -408,49 +430,49 @@ fn workspace_orientation() -> Section<crate::pages::Message> {
408430 . add (
409431 cosmic:: iced:: widget:: row!(
410432 text( & descriptions[ switch_workspace] ) ,
411- cosmic:: iced:: widget:: horizontal_space( 2 ) ,
433+ cosmic:: iced:: widget:: horizontal_space( ) . width ( 2 ) ,
412434 text( & descriptions[ switch_ws_label] ) . font( cosmic:: font:: bold( ) ) ,
413- cosmic:: iced:: widget:: horizontal_space( Length :: Fill ) ,
435+ cosmic:: iced:: widget:: horizontal_space( ) . width ( Length :: Fill ) ,
414436 cosmic:: iced:: widget:: container( cosmic:: iced:: widget:: svg(
415437 switch_ws
416438 ) )
417439 . width( 115 )
418440 . height( 92 )
419441 )
420442 . width ( Length :: Fill )
421- . align_items ( Alignment :: Center )
443+ . align_y ( Alignment :: Center )
422444 . padding ( [ 0 , 16 ] ) ,
423445 )
424446 . add (
425447 cosmic:: iced:: widget:: row!(
426448 text( & descriptions[ open_workspaces] ) ,
427- cosmic:: iced:: widget:: horizontal_space( 2 ) ,
449+ cosmic:: iced:: widget:: horizontal_space( ) . width ( 2 ) ,
428450 text( & descriptions[ open_ws_label] ) . font( cosmic:: font:: bold( ) ) ,
429- cosmic:: iced:: widget:: horizontal_space( Length :: Fill ) ,
451+ cosmic:: iced:: widget:: horizontal_space( ) . width ( Length :: Fill ) ,
430452 cosmic:: iced:: widget:: container( cosmic:: iced:: widget:: svg( open_ws) )
431453 . width( 115 )
432454 . height( 92 )
433455 )
434456 . width ( Length :: Fill )
435- . align_items ( Alignment :: Center )
457+ . align_y ( Alignment :: Center )
436458 . padding ( [ 0 , 16 ] ) ,
437459 )
438460 . add (
439461 cosmic:: widget:: list_column ( ) . add (
440462 cosmic:: iced:: widget:: row!(
441463 text( & descriptions[ open_applications] ) ,
442- cosmic:: iced:: widget:: horizontal_space( 2 ) ,
464+ cosmic:: iced:: widget:: horizontal_space( ) . width ( 2 ) ,
443465 text( & descriptions[ open_app_label] )
444466 . font( cosmic:: font:: bold( ) ) ,
445- cosmic:: iced:: widget:: horizontal_space( Length :: Fill ) ,
467+ cosmic:: iced:: widget:: horizontal_space( ) . width ( Length :: Fill ) ,
446468 cosmic:: iced:: widget:: container( cosmic:: iced:: widget:: svg(
447469 open_app
448470 ) )
449471 . width( 115 )
450472 . height( 92 )
451473 )
452474 . width ( Length :: Fill )
453- . align_items ( Alignment :: Center )
475+ . align_y ( Alignment :: Center )
454476 . padding ( [ 0 , 16 ] ) ,
455477 ) ,
456478 ) ,
0 commit comments