Skip to content

Commit

Permalink
fix: plugin icon in dark-theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Jambo committed Jan 1, 2024
1 parent 06f88de commit 20209e7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
5 changes: 3 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default class TypingAsstPlugin extends Plugin {
scrollArea?: Element;
settings: ExamplePluginSettings;
async loadSettings() {
this.settings = Object.assign({}, { showPlaceholder: true, cmdsSorting: HEADING_MENU }, await this.loadData());
const initialMenu = HEADING_MENU.filter(item => item === 'insert-note-callout' || !item.includes("callout"));
this.settings = Object.assign({}, { showPlaceholder: true, cmdsSorting: initialMenu }, await this.loadData());
// console.log('commands======>', this.app.commands.commands)
}

Expand Down Expand Up @@ -201,7 +202,7 @@ export default class TypingAsstPlugin extends Plugin {
this.commands = new CommandMenu({
scrollArea,
onMenu: onMenuClick,
cmds:this.settings.cmdsSorting
cmds: this.settings.cmdsSorting
});

this.btns?.remove();
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "typing-assistant",
"name": "Typing Assistant",
"version": "0.2.2",
"version": "0.2.3",
"minAppVersion": "0.15.0",
"description": "Support multiple shortcut menus to improve input efficiency",
"author": "Jambo",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typing-assistant",
"version": "0.2.2",
"version": "0.2.3",
"description": "Notion Assistant is a plugin that improves input efficiency and provides a user experience similar to that of【Notion】",
"main": "main.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/components/plugin-setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export class ExampleSettingTab extends PluginSettingTab {
} else {
HeaderItem = CmdsOff.createDiv({ cls: 'heading-item' })
}
setIcon(HeaderItem, CMD_CONFIG[cmd].icon);
const IconDiv = HeaderItem.createDiv({ cls: 'heading-item-icon' })
setIcon(IconDiv, CMD_CONFIG[cmd].icon);
new Setting(HeaderItem)
.setName(CMD_CONFIG[cmd].title)
.addToggle((component) =>
Expand Down
15 changes: 11 additions & 4 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,14 @@
border-top: none;
}
}
.heading-item path {
fill: var(--color-base-100);
stroke: var(--color-base-100);
}


.heading-item-icon{
display: flex;
align-items: center;
margin-right: 12px;
padding: 8px;
background-color: #f6f6f6;
border-radius: 3px;
box-shadow: var(--shadow-s);
}

0 comments on commit 20209e7

Please sign in to comment.