(
tilingLayouts: string[],
setting: Gio.Settings
)
| 47 | } |
| 48 | |
| 49 | function getDefaultLayoutComboBox( |
| 50 | tilingLayouts: string[], |
| 51 | setting: Gio.Settings |
| 52 | ) { |
| 53 | const widget = new Gtk.ComboBoxText(); |
| 54 | const refreshComboBox = () => { |
| 55 | widget.remove_all(); |
| 56 | tilingLayouts.forEach((layoutKey) => { |
| 57 | if (setting.get_boolean(layoutKey)) { |
| 58 | widget.append(layoutKey, layoutKey); |
| 59 | } |
| 60 | }); |
| 61 | }; |
| 62 | tilingLayouts.forEach((layoutKey) => { |
| 63 | if (setting.get_boolean(layoutKey)) { |
| 64 | widget.append(layoutKey, layoutKey); |
| 65 | } |
| 66 | setting.connect(`changed::${layoutKey}`, refreshComboBox); |
| 67 | }); |
| 68 | setting.bind( |
| 69 | 'default-layout', |
| 70 | widget as any as GObject.Object, |
| 71 | 'active-id', |
| 72 | Gio.SettingsBindFlags.DEFAULT |
| 73 | ); |
| 74 | return widget; |
| 75 | } |
| 76 | |
| 77 | export default class MyExtensionPreferences extends ExtensionPreferences { |
| 78 | private loadPages(templateDirectory: Gio.File) { |
no test coverage detected