@@ -12,13 +12,14 @@ import * as settings from 'settings';
12
12
import * as log from 'log' ;
13
13
14
14
interface AppWidgets {
15
+ fullscreen_launcher : any ,
15
16
inner_gap : any ,
17
+ mouse_cursor_follows_active_window : any ,
16
18
outer_gap : any ,
19
+ show_skip_taskbar : any ,
17
20
smart_gaps : any ,
18
21
snap_to_grid : any ,
19
22
window_titles : any ,
20
- show_skip_taskbar : any ,
21
- mouse_cursor_follows_active_window : any ,
22
23
}
23
24
24
25
// @ts -ignore
@@ -77,73 +78,90 @@ function settings_dialog_new(): Gtk.Container {
77
78
Settings . sync ( ) ;
78
79
} ) ;
79
80
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
+
80
87
return grid ;
81
88
}
82
89
83
90
function settings_dialog_view ( ) : [ AppWidgets , Gtk . Container ] {
84
- let grid = new Gtk . Grid ( {
91
+ const grid = new Gtk . Grid ( {
85
92
column_spacing : 12 ,
86
93
row_spacing : 12 ,
87
94
margin_start : 10 ,
88
95
margin_end : 10 ,
89
96
margin_bottom : 10 ,
90
97
margin_top : 10 ,
91
- } ) ;
98
+ } )
92
99
93
- let win_label = new Gtk . Label ( {
100
+ const win_label = new Gtk . Label ( {
94
101
label : "Show Window Titles" ,
95
102
xalign : 0.0 ,
96
103
hexpand : true
97
- } ) ;
104
+ } )
98
105
99
- let snap_label = new Gtk . Label ( {
106
+ const snap_label = new Gtk . Label ( {
100
107
label : "Snap to Grid (Floating Mode)" ,
101
108
xalign : 0.0
102
- } ) ;
109
+ } )
103
110
104
- let smart_label = new Gtk . Label ( {
111
+ const smart_label = new Gtk . Label ( {
105
112
label : "Smart Gaps" ,
106
113
xalign : 0.0
107
- } ) ;
114
+ } )
108
115
109
- let show_skip_taskbar_label = new Gtk . Label ( {
116
+ const show_skip_taskbar_label = new Gtk . Label ( {
110
117
label : "Show Minimize to Tray Windows" ,
111
118
xalign : 0.0
112
- } ) ;
119
+ } )
113
120
114
- let mouse_cursor_follows_active_window_label = new Gtk . Label ( {
121
+ const mouse_cursor_follows_active_window_label = new Gtk . Label ( {
115
122
label : "Mouse Cursor Follows Active Window" ,
116
123
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
+ } )
124
125
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
+ } )
127
130
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
+ }
130
143
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 )
133
146
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 )
136
149
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 )
139
152
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 )
141
155
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 )
143
158
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 )
145
161
146
- return [ settings , grid ] ;
162
+ logging_combo ( grid , 6 )
163
+
164
+ return [ settings , grid ]
147
165
}
148
166
149
167
function gaps_section ( grid : any , top : number ) : [ any , any ] {
@@ -204,7 +222,7 @@ function logging_combo(grid: any, top_index: number) {
204
222
log_combo . set_active_id ( `${ current_log_level } ` ) ;
205
223
log_combo . connect ( "changed" , ( ) => {
206
224
let activeId = log_combo . get_active_id ( ) ;
207
-
225
+
208
226
let settings = ExtensionUtils . getSettings ( ) ;
209
227
settings . set_uint ( 'log-level' , activeId ) ;
210
228
} ) ;
0 commit comments