Feature: Added lazy loading of settings dialog (#983)

* Feat: Added configurable lazy loading for the settings dialog.

* Allow lazyloading to be configurable
This commit is contained in:
Jas Singh
2025-06-02 02:30:10 -07:00
committed by GitHub
parent 3616e5806b
commit 8be178f5a9
6 changed files with 125 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
import { App, Gdk } from 'astal/gtk3';
import { SettingsDialogLoader } from 'src/components/settings/lazyLoader';
export const SettingsButton = (): JSX.Element => {
return (
@@ -6,7 +7,7 @@ export const SettingsButton = (): JSX.Element => {
className={'dashboard-button'}
tooltipText={'HyprPanel Configuration'}
vexpand
onButtonPressEvent={(_, event) => {
onButtonPressEvent={async (_, event) => {
const buttonClicked = event.get_button()[1];
if (buttonClicked !== Gdk.BUTTON_PRIMARY) {
@@ -14,7 +15,8 @@ export const SettingsButton = (): JSX.Element => {
}
App.get_window('dashboardmenu')?.set_visible(false);
App.toggle_window('settings-dialog');
const loader = SettingsDialogLoader.getInstance();
await loader.toggle();
}}
>
<label className={'button-label txt-icon'} label={'󰒓'} />