Skip to content

Commit

Permalink
add open settings editor. Conform capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfulton9 committed Jun 12, 2024
1 parent e03dc79 commit 57f1a64
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
12 changes: 10 additions & 2 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function addCommands(
return settings.composite
.starredSection as ISettingsLayout['starredSection'];
},
label: trans.__('Show starred section'),
label: trans.__('Show Starred Section'),
execute: async () => {
const starredSection = settings.composite
.starredSection as ISettingsLayout['starredSection'];
Expand All @@ -95,11 +95,19 @@ export function addCommands(
return settings.composite
.searchAllSections as ISettingsLayout['searchAllSections'];
},
label: trans.__('Search in all sections'),
label: trans.__('Search in All Sections'),
execute: async () => {
const searchAllSections = settings.composite
.searchAllSections as ISettingsLayout['searchAllSections'];
await settings.set('searchAllSections', !searchAllSections);
}
});
app.commands.addCommand(CommandIDs.openSettings, {
label: trans.__('Open Settings Editor'),
execute: () => {
app.commands.execute('settingeditor:open', {
query: 'New Launcher'
});
}
});
}
5 changes: 1 addition & 4 deletions src/components/quick-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ export function QuickSettings(props: {
const menu = new MenuSvg({ commands: commands });
menu.addItem({ command: CommandIDs.showStarred, args: {} });
menu.addItem({ command: CommandIDs.searchAllSections, args: {} });
menu.addItem({
command: 'settingeditor:open',
args: { query: 'New Launcher' }
});
menu.addItem({ command: CommandIDs.openSettings, args: {} });

const iconRef = React.useRef<HTMLDivElement>(null);

Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export namespace CommandIDs {
export const toggleColumn = 'new-launcher:table-toggle-column';
export const showStarred = 'new-launcher:show-starred';
export const searchAllSections = 'new-launcher:search-all-sections';
export const openSettings = 'new-launcher:open-settings';
}

export interface ISettingsLayout {
Expand Down

0 comments on commit 57f1a64

Please sign in to comment.