本文整理汇总了TypeScript中@jupyterlab/apputils.ThemeManager.setTheme方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ThemeManager.setTheme方法的具体用法?TypeScript ThemeManager.setTheme怎么用?TypeScript ThemeManager.setTheme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@jupyterlab/apputils.ThemeManager
的用法示例。
在下文中一共展示了ThemeManager.setTheme方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
execute: args => {
const theme = args['theme'] as string;
if (theme === manager.theme) {
return;
}
manager.setTheme(theme);
}
示例2:
execute: args => {
const theme = args['theme'] as string;
if (theme === manager.theme) {
return;
}
currentTheme = theme;
manager.setTheme(theme);
commands.notifyCommandChanged(CommandIDs.changeTheme);
}
示例3:
execute: args => {
if (args['theme'] === manager.theme) {
return;
}
manager.setTheme(args['theme'] as string).then(() => {
// The theme manager only loads new CSS onto the page,
// and anything that has rendered this command's `isToggled`
// state will not have updated when that happens (such as
// the application command palette). Force a refresh of those
// rendered commands.
commands.notifyCommandChanged(CommandIDs.changeTheme);
});
}
示例4:
execute: args => {
if (args['theme'] === manager.theme) {
return;
}
manager.setTheme(args['theme'] as string);
}