Suggest popular background colors, add transparency support
Making the UI more user-friendly by suggesting some commonly used colors in the Settings menu
This commit is contained in:
parent
1ad26d1e23
commit
fa3eba219e
4 changed files with 52 additions and 21 deletions
|
@ -80,6 +80,11 @@ export class PluginEditor {
|
|||
|
||||
const toolbar = this.editor.addToolbar();
|
||||
|
||||
// save button
|
||||
const saveButton = toolbar.addSaveButton(async () => {
|
||||
await this.saveCallback(saveButton);
|
||||
});
|
||||
|
||||
// restore toolbarFile state
|
||||
this.toolbarFile = new PluginFile(STORAGE_PATH, TOOLBAR_FILENAME, JSON_MIME);
|
||||
await this.toolbarFile.loadFromSiYuanFS();
|
||||
|
@ -87,11 +92,6 @@ export class PluginEditor {
|
|||
toolbar.deserializeState(this.toolbarFile.getContent());
|
||||
}
|
||||
|
||||
// save button
|
||||
const saveButton = toolbar.addSaveButton(async () => {
|
||||
await this.saveCallback(saveButton);
|
||||
});
|
||||
|
||||
// save toolbar config on tool change (toolbar state is not saved in SVGs!)
|
||||
this.editor.notifier.on(EditorEventType.ToolUpdated, () => {
|
||||
this.toolbarFile.setContent(toolbar.serializeState());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue