@@ -5,7 +5,7 @@ use cosmic::cosmic_config::{config_subscription, Config, CosmicConfigEntry};
5
5
use cosmic:: iced:: wayland:: popup:: { destroy_popup, get_popup} ;
6
6
use cosmic:: iced:: Limits ;
7
7
use cosmic:: iced:: {
8
- widget:: { button, column, row, text, Row , Space } ,
8
+ widget:: { button, column, row, text, Row } ,
9
9
window, Alignment , Application , Color , Command , Length , Subscription ,
10
10
} ;
11
11
use cosmic:: iced_core:: alignment:: Horizontal ;
@@ -15,9 +15,9 @@ use cosmic_applet::{applet_button_theme, CosmicAppletHelper};
15
15
16
16
use cosmic:: iced_style:: application:: { self , Appearance } ;
17
17
18
- use cosmic:: iced_widget:: { scrollable, Column } ;
18
+ use cosmic:: iced_widget:: { horizontal_rule , scrollable, Column } ;
19
19
use cosmic:: theme:: { Button , Svg } ;
20
- use cosmic:: widget:: { container, divider , icon} ;
20
+ use cosmic:: widget:: { container, icon} ;
21
21
use cosmic:: Renderer ;
22
22
use cosmic:: { Element , Theme } ;
23
23
use cosmic_notifications_config:: NotificationsConfig ;
@@ -181,7 +181,7 @@ impl Application for Notifications {
181
181
) ;
182
182
popup_settings. positioner . size_limits = Limits :: NONE
183
183
. min_width ( 1.0 )
184
- . max_width ( 300 .0)
184
+ . max_width ( 444 .0)
185
185
. min_height ( 100.0 )
186
186
. max_height ( 900.0 ) ;
187
187
get_popup ( popup_settings)
@@ -268,15 +268,15 @@ impl Application for Notifications {
268
268
let do_not_disturb = row ! [ anim!(
269
269
DO_NOT_DISTURB ,
270
270
& self . timeline,
271
- String :: from( "Do Not Disturb" ) ,
271
+ String :: from( fl! ( "do-not-disturb" ) ) ,
272
272
self . config. do_not_disturb,
273
273
Message :: DoNotDisturb
274
274
)
275
275
. width( Length :: Fill ) ]
276
276
. padding ( [ 0 , 24 ] ) ;
277
277
278
- let settings =
279
- row_button ( vec ! [ "Notification Settings..." . into ( ) ] ) . on_press ( Message :: Settings ) ;
278
+ let settings = row_button ( vec ! [ text ( fl! ( "notification-settings" ) ) . into ( ) ] )
279
+ . on_press ( Message :: Settings ) ;
280
280
281
281
let notifications = if self . notifications . len ( ) == 0 {
282
282
row ! [ container(
@@ -390,46 +390,35 @@ impl Application for Notifications {
390
390
row ! ( scrollable(
391
391
Column :: with_children( notifs)
392
392
. spacing( 8 )
393
- . width( Length :: Shrink )
394
393
. height( Length :: Shrink ) ,
395
394
)
396
- . width( Length :: Shrink )
397
395
. height( Length :: Shrink ) )
398
- . width ( Length :: Shrink )
399
396
} ;
400
397
401
- let main_content = column ! [
402
- divider:: horizontal:: light( ) ,
403
- notifications,
404
- divider:: horizontal:: light( )
405
- ]
406
- . padding ( [ 0 , 24 ] )
407
- . spacing ( 12 ) ;
398
+ let main_content = column ! [ horizontal_rule( 4 ) , notifications, horizontal_rule( 4 ) ]
399
+ . padding ( [ 0 , 24 ] )
400
+ . spacing ( 12 ) ;
408
401
409
402
let content = column ! [ do_not_disturb, main_content, settings]
410
403
. align_items ( Alignment :: Start )
411
404
. spacing ( 12 )
412
- . padding ( [ 12 , 0 ] ) ;
405
+ . padding ( [ 16 , 0 ] ) ;
413
406
414
407
self . applet_helper . popup_container ( content) . into ( )
415
408
}
416
409
}
417
410
}
418
411
419
- // todo put into libcosmic doing so will fix the row_button's boarder radius
420
- fn row_button (
421
- mut content : Vec < Element < Message > > ,
422
- ) -> cosmic:: iced:: widget:: Button < Message , Renderer > {
423
- content. insert ( 0 , Space :: with_width ( Length :: Fixed ( 24.0 ) ) . into ( ) ) ;
424
- content. push ( Space :: with_width ( Length :: Fixed ( 24.0 ) ) . into ( ) ) ;
425
-
412
+ // todo put into libcosmic doing so will fix the row_button's border radius
413
+ fn row_button ( content : Vec < Element < Message > > ) -> cosmic:: iced:: widget:: Button < Message , Renderer > {
426
414
button (
427
415
Row :: with_children ( content)
428
416
. spacing ( 4 )
429
417
. align_items ( Alignment :: Center ) ,
430
418
)
431
419
. width ( Length :: Fill )
432
420
. height ( Length :: Fixed ( 36.0 ) )
421
+ . padding ( [ 0 , 24 ] )
433
422
. style ( applet_button_theme ( ) )
434
423
}
435
424
0 commit comments