@@ -12,13 +12,14 @@ import * as settings from 'settings';
1212import * as log from 'log' ;
1313
1414interface AppWidgets {
15+ fullscreen_launcher : any ,
1516 inner_gap : any ,
17+ mouse_cursor_follows_active_window : any ,
1618 outer_gap : any ,
19+ show_skip_taskbar : any ,
1720 smart_gaps : any ,
1821 snap_to_grid : any ,
1922 window_titles : any ,
20- show_skip_taskbar : any ,
21- mouse_cursor_follows_active_window : any ,
2223}
2324
2425// @ts -ignore
@@ -77,73 +78,90 @@ function settings_dialog_new(): Gtk.Container {
7778 Settings . sync ( ) ;
7879 } ) ;
7980
81+ app . fullscreen_launcher . set_active ( ext . fullscreen_launcher ( ) )
82+ app . fullscreen_launcher . connect ( 'state-set' , ( _widget : any , state : boolean ) => {
83+ ext . set_fullscreen_launcher ( state )
84+ Settings . sync ( )
85+ } )
86+
8087 return grid ;
8188}
8289
8390function settings_dialog_view ( ) : [ AppWidgets , Gtk . Container ] {
84- let grid = new Gtk . Grid ( {
91+ const grid = new Gtk . Grid ( {
8592 column_spacing : 12 ,
8693 row_spacing : 12 ,
8794 margin_start : 10 ,
8895 margin_end : 10 ,
8996 margin_bottom : 10 ,
9097 margin_top : 10 ,
91- } ) ;
98+ } )
9299
93- let win_label = new Gtk . Label ( {
100+ const win_label = new Gtk . Label ( {
94101 label : "Show Window Titles" ,
95102 xalign : 0.0 ,
96103 hexpand : true
97- } ) ;
104+ } )
98105
99- let snap_label = new Gtk . Label ( {
106+ const snap_label = new Gtk . Label ( {
100107 label : "Snap to Grid (Floating Mode)" ,
101108 xalign : 0.0
102- } ) ;
109+ } )
103110
104- let smart_label = new Gtk . Label ( {
111+ const smart_label = new Gtk . Label ( {
105112 label : "Smart Gaps" ,
106113 xalign : 0.0
107- } ) ;
114+ } )
108115
109- let show_skip_taskbar_label = new Gtk . Label ( {
116+ const show_skip_taskbar_label = new Gtk . Label ( {
110117 label : "Show Minimize to Tray Windows" ,
111118 xalign : 0.0
112- } ) ;
119+ } )
113120
114- let mouse_cursor_follows_active_window_label = new Gtk . Label ( {
121+ const mouse_cursor_follows_active_window_label = new Gtk . Label ( {
115122 label : "Mouse Cursor Follows Active Window" ,
116123 xalign : 0.0
117- } ) ;
118-
119- let window_titles = new Gtk . Switch ( { halign : Gtk . Align . END } ) ;
120- let snap_to_grid = new Gtk . Switch ( { halign : Gtk . Align . END } ) ;
121- let smart_gaps = new Gtk . Switch ( { halign : Gtk . Align . END } ) ;
122- let show_skip_taskbar = new Gtk . Switch ( { halign : Gtk . Align . END } ) ;
123- let mouse_cursor_follows_active_window = new Gtk . Switch ( { halign : Gtk . Align . END } ) ;
124+ } )
124125
125- grid . attach ( win_label , 0 , 0 , 1 , 1 ) ;
126- grid . attach ( window_titles , 1 , 0 , 1 , 1 ) ;
126+ const fullscreen_launcher_label = new Gtk . Label ( {
127+ label : "Allow launcher over fullscreen window" ,
128+ xalign : 0.0
129+ } )
127130
128- grid . attach ( snap_label , 0 , 1 , 1 , 1 ) ;
129- grid . attach ( snap_to_grid , 1 , 1 , 1 , 1 ) ;
131+ const [ inner_gap , outer_gap ] = gaps_section ( grid , 7 ) ;
132+
133+ const settings = {
134+ inner_gap,
135+ outer_gap,
136+ fullscreen_launcher : new Gtk . Switch ( { halign : Gtk . Align . END } ) ,
137+ smart_gaps : new Gtk . Switch ( { halign : Gtk . Align . END } ) ,
138+ snap_to_grid : new Gtk . Switch ( { halign : Gtk . Align . END } ) ,
139+ window_titles : new Gtk . Switch ( { halign : Gtk . Align . END } ) ,
140+ show_skip_taskbar : new Gtk . Switch ( { halign : Gtk . Align . END } ) ,
141+ mouse_cursor_follows_active_window : new Gtk . Switch ( { halign : Gtk . Align . END } )
142+ }
130143
131- grid . attach ( smart_label , 0 , 2 , 1 , 1 ) ;
132- grid . attach ( smart_gaps , 1 , 2 , 1 , 1 ) ;
144+ grid . attach ( win_label , 0 , 0 , 1 , 1 )
145+ grid . attach ( settings . window_titles , 1 , 0 , 1 , 1 )
133146
134- grid . attach ( show_skip_taskbar_label , 0 , 3 , 1 , 1 ) ;
135- grid . attach ( show_skip_taskbar , 1 , 3 , 1 , 1 ) ;
147+ grid . attach ( snap_label , 0 , 1 , 1 , 1 )
148+ grid . attach ( settings . snap_to_grid , 1 , 1 , 1 , 1 )
136149
137- grid . attach ( mouse_cursor_follows_active_window_label , 0 , 4 , 1 , 1 ) ;
138- grid . attach ( mouse_cursor_follows_active_window , 1 , 4 , 1 , 1 ) ;
150+ grid . attach ( smart_label , 0 , 2 , 1 , 1 )
151+ grid . attach ( settings . smart_gaps , 1 , 2 , 1 , 1 )
139152
140- logging_combo ( grid , 5 ) ;
153+ grid . attach ( fullscreen_launcher_label , 0 , 3 , 1 , 1 )
154+ grid . attach ( settings . fullscreen_launcher , 1 , 3 , 1 , 1 )
141155
142- let [ inner_gap , outer_gap ] = gaps_section ( grid , 6 ) ;
156+ grid . attach ( show_skip_taskbar_label , 0 , 4 , 1 , 1 )
157+ grid . attach ( settings . show_skip_taskbar , 1 , 4 , 1 , 1 )
143158
144- let settings = { inner_gap, outer_gap, smart_gaps, snap_to_grid, window_titles, show_skip_taskbar, mouse_cursor_follows_active_window } ;
159+ grid . attach ( mouse_cursor_follows_active_window_label , 0 , 5 , 1 , 1 )
160+ grid . attach ( settings . mouse_cursor_follows_active_window , 1 , 5 , 1 , 1 )
145161
146- return [ settings , grid ] ;
162+ logging_combo ( grid , 6 )
163+
164+ return [ settings , grid ]
147165}
148166
149167function gaps_section ( grid : any , top : number ) : [ any , any ] {
@@ -204,7 +222,7 @@ function logging_combo(grid: any, top_index: number) {
204222 log_combo . set_active_id ( `${ current_log_level } ` ) ;
205223 log_combo . connect ( "changed" , ( ) => {
206224 let activeId = log_combo . get_active_id ( ) ;
207-
225+
208226 let settings = ExtensionUtils . getSettings ( ) ;
209227 settings . set_uint ( 'log-level' , activeId ) ;
210228 } ) ;
0 commit comments