@@ -22,14 +22,14 @@ mod imp;
22
22
use imp:: ModificationWindowContainer ;
23
23
24
24
// Imports
25
- use adwaita:: { gio, glib, ViewStack , Application } ;
25
+ use adwaita:: { gio, glib, Application , ViewStack } ;
26
26
use gio:: Settings ;
27
27
use glib:: { clone, translate:: FromGlib , Object , SourceId } ;
28
28
use gtk:: { prelude:: * , subclass:: prelude:: * , Align , Button , Grid , Label , LayoutChild , Orientation } ;
29
- use std:: { sync :: Arc , sync:: Mutex , cell :: RefMut , sync:: MutexGuard } ;
29
+ use std:: { cell :: RefMut , sync:: Arc , sync :: Mutex , sync:: MutexGuard } ;
30
30
31
31
// Modules
32
- use crate :: { provider :: Provider , modificationwindow :: ModificationWindow , APP_ID } ;
32
+ use crate :: { modificationwindow :: ModificationWindow , provider :: Provider , APP_ID } ;
33
33
34
34
// GObject wrapper for GpuPage
35
35
glib:: wrapper! {
@@ -382,14 +382,19 @@ impl GpuPage {
382
382
content_grid. attach ( & new_grid, 0 , 0 as i32 , 100 , 12 ) ;
383
383
384
384
// Populate view given list of properties
385
- let output: ( Grid , Vec < Label > ) = self . create_properties ( new_grid, properties, labels) ;
385
+ let output: ( Grid , Vec < Label > ) =
386
+ self . create_properties ( new_grid, properties, labels) ;
386
387
let new_view_grid: Grid = output. 0 ;
387
388
labels = output. 1 ;
388
389
389
390
// Save built view
390
391
// Add object
391
392
let new_stack_item_name: String = index. to_string ( ) + "_stack_item" ;
392
- new_stack. add_titled ( & new_view_grid, Some ( & new_stack_item_name) , & loaded_views[ index] ) ;
393
+ new_stack. add_titled (
394
+ & new_view_grid,
395
+ Some ( & new_stack_item_name) ,
396
+ & loaded_views[ index] ,
397
+ ) ;
393
398
// println!("NEW STACK ITEM: `{}`", new_stack_item_name);//TEST
394
399
// Add icon
395
400
//NOTE: see https://world.pages.gitlab.gnome.org/Rust/libadwaita-rs/stable/latest/docs/libadwaita/struct.ViewStack.html
@@ -506,7 +511,12 @@ impl GpuPage {
506
511
* Notes:
507
512
*
508
513
*/
509
- fn create_properties ( & self , grid : Grid , properties : Vec < String > , mut labels : Vec < Label > ) -> ( Grid , Vec < Label > ) {
514
+ fn create_properties (
515
+ & self ,
516
+ grid : Grid ,
517
+ properties : Vec < String > ,
518
+ mut labels : Vec < Label > ,
519
+ ) -> ( Grid , Vec < Label > ) {
510
520
// Load properties from struct
511
521
let properties_store: Arc < Mutex < Vec < String > > > = Arc :: new ( Mutex :: new ( properties) ) ;
512
522
@@ -700,7 +710,6 @@ impl GpuPage {
700
710
// Load refresh time (s) from settings
701
711
let refresh_rate: u32 = settings_obj. get :: < i32 > ( "refreshrate" ) as u32 ;
702
712
703
-
704
713
// Create thread safe container for properties
705
714
let properties_store: Arc < Mutex < Vec < String > > > = Arc :: new ( Mutex :: new ( properties) ) ;
706
715
0 commit comments