File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
import Gio from "gi://Gio" ;
2
2
import Gtk from "gi://Gtk?version=4.0" ;
3
+ import Pango from "gi://Pango" ;
3
4
4
5
Gio . _promisify (
5
6
Gtk . FontDialog . prototype ,
6
7
"choose_family" ,
7
8
"choose_family_finish" ,
8
9
) ;
9
10
10
- const font_dialog_button = workbench . builder . get_object ( "font_dialog_button" ) ;
11
+ const font_dialog_button = workbench . builder . get_object < Gtk . FontDialogButton > ( "font_dialog_button" ) ;
11
12
const custom_button = workbench . builder . get_object ( "custom_button" ) ;
12
13
13
14
const dialog_standard = new Gtk . FontDialog ( {
@@ -29,10 +30,11 @@ const dialog_custom = new Gtk.FontDialog({
29
30
custom_button . connect ( "clicked" , ( ) => onClicked ( ) . catch ( console . error ) ) ;
30
31
31
32
async function onClicked ( ) {
33
+ // @ts -expect-error undetected async function
32
34
const family = await dialog_custom . choose_family (
33
35
workbench . window ,
34
36
null ,
35
37
null ,
36
- ) ;
38
+ ) as Pango . FontFamily ;
37
39
console . log ( `Font Family: ${ family . get_name ( ) } ` ) ;
38
40
}
You can’t perform that action at this time.
0 commit comments