Explorar o código

HUE-8621 [editor] Add keyboard shortcut to toggle dark mode

Ctrl/Cmd-Alt-T
Johan Ahlen %!s(int64=7) %!d(string=hai) anos
pai
achega
16fc204
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

+ 10 - 0
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -5444,6 +5444,16 @@
         }
       });
 
+      editor.commands.addCommand({
+        name: 'switchTheme',
+        bindKey: { win: 'Ctrl-Alt-t', mac: 'Command-Alt-t' },
+        exec: function () {
+          darkThemeEnabled = !darkThemeEnabled;
+          ApiHelper.getInstance().setInTotalStorage('ace', 'dark.theme.enabled', darkThemeEnabled);
+          editor.setTheme(darkThemeEnabled ? 'ace/theme/hue_dark' : 'ace/theme/hue');
+        }
+      });
+
       editor.commands.addCommand({
         name: "new",
         bindKey: {win: "Ctrl-e", mac: "Command-e"},