@@ -32,38 +32,37 @@ export default class extends ExtensionPreferences {
3232 'GNU General Public License, version 2 or later</a> for details.' +
3333 '</span>' ;
3434
35- this . _win = window ;
36- let settings = window . _settings = this . getSettings ( ) ;
35+ let settings = this . getSettings ( ) ;
3736
3837 // Gesture Settings
39- this . gestures = new Adw . PreferencesGroup ( { title : "Gestures" } ) ;
38+ let gestures = new Adw . PreferencesGroup ( { title : "Gestures" } ) ;
4039
41- this . gestures_noflip = new Adw . SwitchRow ( {
40+ let gestures_noflip = new Adw . SwitchRow ( {
4241 title : "Keep System Gesture" ,
4342 subtitle : "If true, extension will not hook system gesture events but Use 3 Fingers config cannot be used. Need re-enable extension to take effect"
4443 } ) ;
45- this . gestures . add ( this . gestures_noflip ) ;
46- settings . bind ( "no-count-flip" , this . gestures_noflip , 'active' , Gio . SettingsBindFlags . DEFAULT ) ;
44+ gestures . add ( gestures_noflip ) ;
45+ settings . bind ( "no-count-flip" , gestures_noflip , 'active' , Gio . SettingsBindFlags . DEFAULT ) ;
4746
48- this . gestures_3fingers = new Adw . SwitchRow ( {
47+ let gestures_3fingers = new Adw . SwitchRow ( {
4948 title : "Use 3 Fingers" ,
5049 subtitle : "If true, window gestures will use three fingers, and workspace will use four finger"
5150 } ) ;
52- this . gestures . add ( this . gestures_3fingers ) ;
53- settings . bind ( "three-finger" , this . gestures_3fingers , 'active' , Gio . SettingsBindFlags . DEFAULT ) ;
51+ gestures . add ( gestures_3fingers ) ;
52+ settings . bind ( "three-finger" , gestures_3fingers , 'active' , Gio . SettingsBindFlags . DEFAULT ) ;
5453
55- this . gestures_hswitch = new Adw . SwitchRow ( {
54+ let gestures_hswitch = new Adw . SwitchRow ( {
5655 title : "Horizontal Swipe Always Switch Windows" ,
5756 subtitle : "If true, Horizontal swipe will always switching windows just like swiping outside window area"
5857 } ) ;
59- this . gestures . add ( this . gestures_hswitch ) ;
60- settings . bind ( "horiz-swap-switch" , this . gestures_hswitch , 'active' , Gio . SettingsBindFlags . DEFAULT ) ;
58+ gestures . add ( gestures_hswitch ) ;
59+ settings . bind ( "horiz-swap-switch" , gestures_hswitch , 'active' , Gio . SettingsBindFlags . DEFAULT ) ;
6160
6261
6362 // Size Settings
64- this . tweaks = new Adw . PreferencesGroup ( { title : "Tweaks" } ) ;
63+ let tweaks = new Adw . PreferencesGroup ( { title : "Tweaks" } ) ;
6564
66- this . field_edge_size = new Adw . SpinRow ( {
65+ let field_edge_size = new Adw . SpinRow ( {
6766 title : "Edge Size for Resize" ,
6867 subtitle : "Number of pixel from window egdes to determine resize action" ,
6968 adjustment : new Gtk . Adjustment ( {
@@ -72,11 +71,11 @@ export default class extends ExtensionPreferences {
7271 step_increment : 4
7372 } )
7473 } ) ;
75- this . tweaks . add ( this . field_edge_size ) ;
76- settings . bind ( "edge-size" , this . field_edge_size , 'value' , Gio . SettingsBindFlags . DEFAULT ) ;
74+ tweaks . add ( field_edge_size ) ;
75+ settings . bind ( "edge-size" , field_edge_size , 'value' , Gio . SettingsBindFlags . DEFAULT ) ;
7776
7877
79- this . field_topedge_size = new Adw . SpinRow ( {
78+ let field_topedge_size = new Adw . SpinRow ( {
8079 title : "Title Edge size" ,
8180 subtitle : "Number of pixel from top of window to determine move action" ,
8281 adjustment : new Gtk . Adjustment ( {
@@ -85,60 +84,59 @@ export default class extends ExtensionPreferences {
8584 step_increment : 4
8685 } )
8786 } ) ;
88- this . tweaks . add ( this . field_topedge_size ) ;
89- settings . bind ( "top-edge-size" , this . field_topedge_size , 'value' , Gio . SettingsBindFlags . DEFAULT ) ;
87+ tweaks . add ( field_topedge_size ) ;
88+ settings . bind ( "top-edge-size" , field_topedge_size , 'value' , Gio . SettingsBindFlags . DEFAULT ) ;
9089
9190
92- this . field_threshold = new Adw . SpinRow ( {
91+ let field_threshold = new Adw . SpinRow ( {
9392 title : "Gesture Threshold" ,
9493 adjustment : new Gtk . Adjustment ( {
9594 lower : 16 ,
9695 upper : 64 ,
9796 step_increment : 4
9897 } )
9998 } ) ;
100- this . tweaks . add ( this . field_threshold ) ;
101- settings . bind ( "gesture-threshold" , this . field_threshold , 'value' , Gio . SettingsBindFlags . DEFAULT ) ;
99+ tweaks . add ( field_threshold ) ;
100+ settings . bind ( "gesture-threshold" , field_threshold , 'value' , Gio . SettingsBindFlags . DEFAULT ) ;
102101
103- this . field_cancel_threshold = new Adw . SpinRow ( {
102+ let field_cancel_threshold = new Adw . SpinRow ( {
104103 title : "Gesture Cancel Threshold" ,
105104 adjustment : new Gtk . Adjustment ( {
106105 lower : 4 ,
107106 upper : 32 ,
108107 step_increment : 1
109108 } )
110109 } ) ;
111- this . tweaks . add ( this . field_cancel_threshold ) ;
112- settings . bind ( "gesture-cancel-threshold" , this . field_cancel_threshold , 'value' , Gio . SettingsBindFlags . DEFAULT ) ;
110+ tweaks . add ( field_cancel_threshold ) ;
111+ settings . bind ( "gesture-cancel-threshold" , field_cancel_threshold , 'value' , Gio . SettingsBindFlags . DEFAULT ) ;
113112
114- this . field_accel = new Adw . SpinRow ( {
113+ let field_accel = new Adw . SpinRow ( {
115114 title : "Gesture Acceleration" ,
116115 adjustment : new Gtk . Adjustment ( {
117116 lower : 10 ,
118117 upper : 25 ,
119118 step_increment : 1
120119 } )
121120 } ) ;
122- this . tweaks . add ( this . field_accel ) ;
123- settings . bind ( "gesture-acceleration" , this . field_accel , 'value' , Gio . SettingsBindFlags . DEFAULT ) ;
121+ tweaks . add ( field_accel ) ;
122+ settings . bind ( "gesture-acceleration" , field_accel , 'value' , Gio . SettingsBindFlags . DEFAULT ) ;
124123
125124 // About
126- this . about = new Adw . PreferencesGroup ( { title : "About" } ) ;
127- const aboutVersion = new Adw . ActionRow ( {
125+ let about = new Adw . PreferencesGroup ( { title : "About" } ) ;
126+ let aboutVersion = new Adw . ActionRow ( {
128127 title : 'Window Gestures Version' ,
129128 } ) ;
130129 aboutVersion . add_suffix ( new Gtk . Label ( {
131130 label : this . metadata . version . toString ( ) ,
132131 css_classes : [ 'dim-label' ] ,
133132 } ) ) ;
134- this . about . add ( aboutVersion ) ;
135- const githubRow = this . _createLinkRow ( 'Source Github' , this . metadata . url ) ;
136- this . about . add ( githubRow ) ;
137- const websiteRow = this . _createLinkRow ( 'Visit Website' , WEBSITE_LINK ) ;
138- this . about . add ( websiteRow ) ;
139- const donateRow = this . _createLinkRow ( 'Donate via PayPal' , PAYPAL_LINK ) ;
140- this . about . add ( donateRow ) ;
141-
133+ about . add ( aboutVersion ) ;
134+ let githubRow = this . _createLinkRow ( window , 'Source Github' , this . metadata . url ) ;
135+ about . add ( githubRow ) ;
136+ let websiteRow = this . _createLinkRow ( window , 'Visit Website' , WEBSITE_LINK ) ;
137+ about . add ( websiteRow ) ;
138+ let donateRow = this . _createLinkRow ( window , 'Donate via PayPal' , PAYPAL_LINK ) ;
139+ about . add ( donateRow ) ;
142140
143141 // GNU
144142 const gnuSoftwareGroup = new Adw . PreferencesGroup ( ) ;
@@ -156,14 +154,14 @@ export default class extends ExtensionPreferences {
156154 gnuSoftwareGroup . add ( gnuSofwareLabelBox ) ;
157155
158156 const page = new Adw . PreferencesPage ( ) ;
159- page . add ( this . gestures ) ;
160- page . add ( this . tweaks ) ;
161- page . add ( this . about ) ;
157+ page . add ( gestures ) ;
158+ page . add ( tweaks ) ;
159+ page . add ( about ) ;
162160 page . add ( gnuSoftwareGroup ) ;
163161 window . add ( page ) ;
164162 }
165163
166- _createLinkRow ( title_row , uri ) {
164+ _createLinkRow ( window , title_row , uri ) {
167165 const image = new Gtk . Image ( {
168166 icon_name : 'adw-external-link-symbolic' ,
169167 valign : Gtk . Align . CENTER ,
@@ -173,7 +171,7 @@ export default class extends ExtensionPreferences {
173171 activatable : true ,
174172 } ) ;
175173 linkRow . connect ( 'activated' , ( ) => {
176- Gtk . show_uri ( this . _win , uri , Gdk . CURRENT_TIME ) ;
174+ Gtk . show_uri ( window , uri , Gdk . CURRENT_TIME ) ;
177175 } ) ;
178176 linkRow . add_suffix ( image ) ;
179177 return linkRow ;
0 commit comments