1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-14 23:26:58 +02:00

Plugins: Add ability to make dialogs fit the application window (#5219)

This commit is contained in:
Ahmad Mamdouh
2021-07-22 11:21:57 +02:00
committed by GitHub
parent f611d7734b
commit c89037b4a2
6 changed files with 37 additions and 3 deletions

View File

@@ -58,6 +58,7 @@ export default class WebviewController extends ViewController {
scripts: [],
opened: false,
buttons: null,
fitToContent: true,
},
});
}
@@ -173,4 +174,11 @@ export default class WebviewController extends ViewController {
this.setStoreProp('buttons', buttons);
}
public get fitToContent(): boolean {
return this.storeView.fitToContent;
}
public set fitToContent(fitToContent: boolean) {
this.setStoreProp('fitToContent', fitToContent);
}
}

View File

@@ -98,4 +98,13 @@ export default class JoplinViewsDialogs {
return this.controller(handle).open();
}
/**
* Toggle on whether to fit the dialog size to the content or not.
* When set to false, the dialog stretches to fill the application
* window.
* @default true
*/
public async setFitToContent(handle: ViewHandle, status: boolean) {
return this.controller(handle).fitToContent = status;
}
}