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 11import Gio from "gi://Gio" ;
22import Gtk from "gi://Gtk?version=4.0" ;
3+ import Pango from "gi://Pango" ;
34
45Gio . _promisify (
56 Gtk . FontDialog . prototype ,
67 "choose_family" ,
78 "choose_family_finish" ,
89) ;
910
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" ) ;
1112const custom_button = workbench . builder . get_object ( "custom_button" ) ;
1213
1314const dialog_standard = new Gtk . FontDialog ( {
@@ -29,10 +30,11 @@ const dialog_custom = new Gtk.FontDialog({
2930custom_button . connect ( "clicked" , ( ) => onClicked ( ) . catch ( console . error ) ) ;
3031
3132async function onClicked ( ) {
33+ // @ts -expect-error undetected async function
3234 const family = await dialog_custom . choose_family (
3335 workbench . window ,
3436 null ,
3537 null ,
36- ) ;
38+ ) as Pango . FontFamily ;
3739 console . log ( `Font Family: ${ family . get_name ( ) } ` ) ;
3840}
You can’t perform that action at this time.
0 commit comments