MCPcopy Create free account
hub / github.com/material-shell/material-shell / loadPages

Method loadPages

src/prefs/prefs.ts:78–569  ·  view source on GitHub ↗
(templateDirectory: Gio.File)

Source from the content-addressed store, hash-verified

76
77export default class MyExtensionPreferences extends ExtensionPreferences {
78 private loadPages(templateDirectory: Gio.File) {
79 @registerGObjectClass
80 class SettingListBoxRow extends Gtk.ListBoxRow {
81 static metaInfo: GObject.MetaInfo<any, any, any> = {
82 GTypeName: 'SettingListBoxRow',
83 Template: templateDirectory
84 .get_child('setting_list_box_row.ui')
85 .get_uri()!,
86 Properties: {
87 'settings-widget': GObject.ParamSpec.object(
88 'settings-widget',
89 'Settings Widget',
90 'The widget in which the user sets the settings value',
91 GObject.ParamFlags.READWRITE,
92 Gtk.Widget.$gtype
93 ),
94 },
95 InternalChildren: [
96 'name_label',
97 'description_label',
98 'widget_container',
99 ],
100 };
101
102 private declare _name_label: Gtk.Label;
103 private declare _description_label: Gtk.Label;
104 private declare _widget_container: Gtk.Box;
105 private _settings_widget: Gtk.Widget;
106
107 constructor(
108 summary: string,
109 description: string,
110 widget: Gtk.Widget
111 ) {
112 super();
113 this._name_label.set_text(summary);
114 this._description_label.set_text(description);
115 this._settings_widget = widget;
116 this._widget_container.append(this._settings_widget);
117 }
118 }
119
120 @registerGObjectClass
121 class HotkeyRowData extends GObject.Object {
122 key: string;
123 summary: string;
124 accelName: string;
125
126 constructor(key: string, summary: string, accelName: string) {
127 super();
128 this.key = key;
129 this.summary = summary;
130 this.accelName = accelName;
131 }
132 }
133
134 @registerGObjectClass
135 class HotkeyListBox extends Gtk.ListBox {

Callers 1

fillPreferencesWindowMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected