From a39ecaf6488ebf5d338e4645264b4cb11c844b03 Mon Sep 17 00:00:00 2001 From: Hermes Date: Mon, 20 Apr 2026 19:51:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(th=5F14=5Fpanels):=20=E4=BF=AE=E5=A4=8DShor?= =?UTF-8?q?tX=E5=9B=BE=E6=A0=87=E9=80=89=E6=8B=A9=E5=99=A8=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E5=90=8E=E9=A2=84=E8=A7=88=E6=A1=86=E6=9C=AA=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将previewNameTv.setText提前到inputShortXIconTint.getValue()之前 - 为tintHex读取添加独立try-catch,避免异常阻断预览文本更新 - 为updateShortXIconPreview添加错误日志输出 --- code/th_14_panels.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/th_14_panels.js b/code/th_14_panels.js index e21fb7b..092dbaa 100644 --- a/code/th_14_panels.js +++ b/code/th_14_panels.js @@ -1077,11 +1077,12 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() { function updateShortXIconPreview() { try { var normalizedShort = currentShortXIconName ? self.normalizeShortXIconName(currentShortXIconName, false) : ""; - var tintHex = String(inputShortXIconTint.getValue() || ""); if (shortxPickerState.previewNameTv) { - shortxPickerState.previewNameTv.setText(normalizedShort ? ("已选: " + normalizedShort) : "未选择图标"); + shortxPickerState.previewNameTv.setText(normalizedShort ? ("\u5df2\u9009: " + normalizedShort) : "\u672a\u9009\u62e9\u56fe\u6807"); } if (shortxPickerState.previewIv) { + var tintHex = ""; + try { tintHex = String(inputShortXIconTint.getValue() || ""); } catch(eTint) {} var drPreview = normalizedShort ? self.resolveShortXDrawable(normalizedShort, tintHex) : null; if (drPreview) { shortxPickerState.previewIv.setImageDrawable(drPreview); @@ -1091,7 +1092,9 @@ FloatBallAppWM.prototype.buildButtonEditorPanelView = function() { try { shortxPickerState.previewIv.setAlpha(0.35); } catch(eA2) {} } } - } catch(ePreview) {} + } catch(ePreview) { + safeLog(self.L, 'e', "updateShortXIconPreview err=" + String(ePreview)); + } } function renderShortXIconGrid() {