Merge pull request #1327 from Estebene/bug-command-theme

Fixed command line random theme bug #1326
This commit is contained in:
Jack 2021-05-01 16:11:24 +01:00 committed by GitHub
commit 4b9c6adae2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -16,7 +16,7 @@ function showInput(command, placeholder, defaultValue = "") {
$("#commandInput input").focus();
$("#commandInput input").attr("command", "");
$("#commandInput input").attr("command", command);
if (defaultValue != ""){
if (defaultValue != "") {
$("#commandInput input").select();
}
}
@ -46,7 +46,10 @@ function showFound() {
try {
$.each(list.list, (index, obj) => {
if (obj.found) {
if (!/theme/gi.test(obj.id) || obj.id === "toggleCustomTheme")
if (
(!/theme/gi.test(obj.id) || obj.id === "toggleCustomTheme") &&
!ThemeController.randomTheme
)
ThemeController.clearPreview();
if (!/font/gi.test(obj.id))
UpdateConfig.previewFontFamily(Config.fontFamily);
@ -118,7 +121,9 @@ function updateSuggested() {
function hide() {
UpdateConfig.previewFontFamily(Config.fontFamily);
// applyCustomThemeColors();
ThemeController.clearPreview();
if (!ThemeController.randomTheme) {
ThemeController.clearPreview();
}
$("#commandLineWrapper")
.stop(true, true)
.css("opacity", 1)

View file

@ -6,7 +6,7 @@ import Config from "./config";
import * as UI from "./ui";
let isPreviewingTheme = false;
let randomTheme = null;
export let randomTheme = null;
export const colorVars = [
"--bg-color",