Skip to content

Commit d72a659

Browse files
committed
fix bug
1 parent be77305 commit d72a659

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

dist/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6187,7 +6187,7 @@ class Hi {
61876187
*/
61886188
async toggleLayoutMode() {
61896189
try {
6190-
this.isVerticalMode ? (this.verticalPosition = { ...this.position }, this.position = this.horizontalPosition || { x: 100, y: 100 }) : (this.horizontalPosition = { ...this.position }, this.position = this.verticalPosition || { x: 100, y: 100 }), this.isVerticalMode = !this.isVerticalMode, await this.saveLayoutMode(), await this.createTabsUI(), this.log(`📐 布局模式已切换为: ${this.isVerticalMode ? "垂直" : "水平"}`);
6190+
this.isVerticalMode ? (this.verticalPosition = { ...this.position }, this.position = this.horizontalPosition || { x: 100, y: 100 }) : (this.horizontalPosition = { ...this.position }, this.position = this.verticalPosition || { x: 100, y: 100 }), this.isVerticalMode = !this.isVerticalMode, !this.isVerticalMode && this.enableBubbleMode && (this.enableBubbleMode = !1, this.isBubbleExpanded = !1, this.verboseLog("🫧 切换到水平模式,已自动禁用气泡模式")), await this.saveLayoutMode(), await this.createTabsUI(), this.log(`📐 布局模式已切换为: ${this.isVerticalMode ? "垂直" : "水平"}`);
61916191
} catch (e) {
61926192
this.error("切换布局模式失败:", e);
61936193
}
@@ -8991,14 +8991,14 @@ class Hi {
89918991
this.isVerticalMode,
89928992
this.verticalPosition,
89938993
this.horizontalPosition
8994-
), this.isSidebarAlignmentEnabled = t.isSidebarAlignmentEnabled, this.isFloatingWindowVisible = t.isFloatingWindowVisible, this.showBlockTypeIcons = t.showBlockTypeIcons, this.showInHeadbar = t.showInHeadbar, this.horizontalTabMaxWidth = t.horizontalTabMaxWidth, this.horizontalTabMinWidth = t.horizontalTabMinWidth, this.enableEdgeHide = t.enableEdgeHide, this.enableBubbleMode = t.enableBubbleMode, this.log(`📐 布局模式已恢复: ${je(t)}, 当前位置: (${this.position.x}, ${this.position.y})`), this.isSidebarAlignmentEnabled && (this.startSidebarAlignmentObserver(), this.log("🔄 侧边栏对齐监听器已启动"));
8994+
), this.isSidebarAlignmentEnabled = t.isSidebarAlignmentEnabled, this.isFloatingWindowVisible = t.isFloatingWindowVisible, this.showBlockTypeIcons = t.showBlockTypeIcons, this.showInHeadbar = t.showInHeadbar, this.horizontalTabMaxWidth = t.horizontalTabMaxWidth, this.horizontalTabMinWidth = t.horizontalTabMinWidth, this.enableEdgeHide = t.enableEdgeHide, this.enableBubbleMode = t.enableBubbleMode, !this.isVerticalMode && this.enableBubbleMode && (this.enableBubbleMode = !1, this.isBubbleExpanded = !1, this.verboseLog("🫧 恢复配置:水平模式不支持气泡模式,已自动禁用")), this.log(`📐 布局模式已恢复: ${je(t)}, 当前位置: (${this.position.x}, ${this.position.y})`), this.isSidebarAlignmentEnabled && (this.startSidebarAlignmentObserver(), this.log("🔄 侧边栏对齐监听器已启动"));
89958995
} else {
89968996
const t = V();
89978997
this.isVerticalMode = t.isVerticalMode, this.verticalWidth = t.verticalWidth, this.verticalPosition = t.verticalPosition, this.horizontalPosition = t.horizontalPosition, this.horizontalTabMaxWidth = t.horizontalTabMaxWidth, this.horizontalTabMinWidth = t.horizontalTabMinWidth, this.enableEdgeHide = t.enableEdgeHide, this.enableBubbleMode = t.enableBubbleMode, this.position = re(
89988998
this.isVerticalMode,
89998999
this.verticalPosition,
90009000
this.horizontalPosition
9001-
), this.log("📐 布局模式: 水平 (默认)");
9001+
), !this.isVerticalMode && this.enableBubbleMode && (this.enableBubbleMode = !1, this.isBubbleExpanded = !1, this.verboseLog("🫧 默认配置:水平模式不支持气泡模式,已自动禁用")), this.log("📐 布局模式: 水平 (默认)");
90029002
}
90039003
} catch (e) {
90049004
this.error("恢复布局模式失败:", e);

src/main.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4690,6 +4690,13 @@ class OrcaTabsPlugin {
46904690
// 切换模式
46914691
this.isVerticalMode = !this.isVerticalMode;
46924692

4693+
// 【修复】如果切换到水平模式且气泡模式启用,自动禁用它
4694+
if (!this.isVerticalMode && this.enableBubbleMode) {
4695+
this.enableBubbleMode = false;
4696+
this.isBubbleExpanded = false;
4697+
this.verboseLog('🫧 切换到水平模式,已自动禁用气泡模式');
4698+
}
4699+
46934700
// 保存布局模式到API配置
46944701
await this.saveLayoutMode();
46954702

@@ -10991,6 +10998,13 @@ class OrcaTabsPlugin {
1099110998
this.enableEdgeHide = config.enableEdgeHide;
1099210999
this.enableBubbleMode = config.enableBubbleMode;
1099311000

11001+
// 【修复】如果恢复的是水平模式且气泡模式启用,自动禁用它(气泡模式仅垂直模式可用)
11002+
if (!this.isVerticalMode && this.enableBubbleMode) {
11003+
this.enableBubbleMode = false;
11004+
this.isBubbleExpanded = false;
11005+
this.verboseLog('🫧 恢复配置:水平模式不支持气泡模式,已自动禁用');
11006+
}
11007+
1099411008
this.log(`📐 布局模式已恢复: ${generateLayoutLogMessage(config)}, 当前位置: (${this.position.x}, ${this.position.y})`);
1099511009

1099611010
// 如果侧边栏对齐功能已启用,启动监听器
@@ -11014,6 +11028,14 @@ class OrcaTabsPlugin {
1101411028
this.verticalPosition,
1101511029
this.horizontalPosition
1101611030
);
11031+
11032+
// 【修复】如果默认配置是水平模式且气泡模式启用,自动禁用它(气泡模式仅垂直模式可用)
11033+
if (!this.isVerticalMode && this.enableBubbleMode) {
11034+
this.enableBubbleMode = false;
11035+
this.isBubbleExpanded = false;
11036+
this.verboseLog('🫧 默认配置:水平模式不支持气泡模式,已自动禁用');
11037+
}
11038+
1101711039
this.log(`📐 布局模式: 水平 (默认)`);
1101811040
}
1101911041
} catch (e) {

0 commit comments

Comments
 (0)