change theme calls tehem settings

This commit is contained in:
Jan Prochazka 2022-02-26 18:48:22 +01:00
parent 7128a47f0a
commit 20c56a92ee
2 changed files with 18 additions and 14 deletions

View File

@ -29,26 +29,27 @@ import runCommand from './runCommand';
import { openWebLink } from '../utility/exportElectronFile';
import { getSettings } from '../utility/metadataLoaders';
function themeCommand(theme: ThemeDefinition) {
return {
text: theme.themeName,
onClick: () => currentTheme.set(theme.themeClassName),
// onPreview: () => {
// const old = get(currentTheme);
// currentTheme.set(css);
// return ok => {
// if (!ok) currentTheme.set(old);
// };
// },
};
}
// function themeCommand(theme: ThemeDefinition) {
// return {
// text: theme.themeName,
// onClick: () => currentTheme.set(theme.themeClassName),
// // onPreview: () => {
// // const old = get(currentTheme);
// // currentTheme.set(css);
// // return ok => {
// // if (!ok) currentTheme.set(old);
// // };
// // },
// };
// }
registerCommand({
id: 'theme.changeTheme',
category: 'Theme',
name: 'Change',
toolbarName: 'Change theme',
getSubCommands: () => get(extensions).themes.map(themeCommand),
onClick: () => showModal(SettingsModal, { selectedTab: 1 }),
// getSubCommands: () => get(extensions).themes.map(themeCommand),
});
registerCommand({

View File

@ -17,6 +17,8 @@
const electron = getElectron();
let restartWarning = false;
export let selectedTab = 0;
</script>
<SettingsFormProvider>
@ -25,6 +27,7 @@
<FormValues let:values>
<TabControl
bind:value={selectedTab}
isInline
tabs={[
{ label: 'General', slot: 1 },