Skip to content

Commit 2939416

Browse files
da-liiiclaude
andcommitted
[222_82] 清理标签页工具栏相关代码
移除与标签页工具栏显示/隐藏相关的所有死代码: - Scheme: 移除 tab bar 偏好设置、notify-icon-bar 和 toggle-visible-icon-bar 中 index=4 的处理 - Scheme: 移除 preferences-widgets 中的 tab bar 偏好设置 - C++: 移除 new_window 中的 force_tab_bar 参数,无条件启用标签页 - C++: 移除 tm_window/tm_frame 中 toolbar index 4 的映射 - C++: 移除 message.hpp 中的 tab pages visibility 辅助函数 - C++: 移除 qt_tm_widget 中 SLOT_TAB_PAGES_VISIBILITY 的处理逻辑 标签页工具栏已是核心 UI 元素,不可隐藏。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent b7dfdff commit 2939416

8 files changed

Lines changed: 7 additions & 45 deletions

File tree

TeXmacs/progs/texmacs/menus/preferences-widgets.scm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ pretty-val : string
7575
(define (on-buffer-management-changed pretty-val)
7676
(let ((can-use-tabbar? (== pretty-val "Multiple documents share window")))
7777
(begin
78-
(set-boolean-preference "tab bar" can-use-tabbar?)
79-
(show-icon-bar 4 can-use-tabbar?)
8078
(set-pretty-preference "buffer management" pretty-val)
8179
)))
8280

TeXmacs/progs/texmacs/texmacs/tm-view.scm

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
((== var "focus dependent icons")
2929
(show-icon-bar 2 (== val "on")))
3030
((== var "user provided icons")
31-
(show-icon-bar 3 (== val "on")))
32-
((== var "tab bar")
33-
(show-icon-bar 4 (== val "on")))))
31+
(show-icon-bar 3 (== val "on")))))
3432

3533
(define (notify-status-bar var val)
3634
(show-footer (== val "on")))
@@ -60,7 +58,6 @@
6058
(define-preferences
6159
("header" "on" notify-header)
6260
("main icon bar" "off" notify-icon-bar)
63-
("tab bar" "on" notify-icon-bar)
6461
("mode dependent icons" "on" notify-icon-bar)
6562
("focus dependent icons" "on" notify-icon-bar)
6663
("user provided icons" "off" notify-icon-bar)
@@ -125,8 +122,7 @@
125122
(var (cond ((== n 0) "main icon bar")
126123
((== n 1) "mode dependent icons")
127124
((== n 2) "focus dependent icons")
128-
((== n 3) "user provided icons")
129-
((== n 4) "tab bar"))))
125+
((== n 3) "user provided icons"))))
130126
(if (== (windows-number) 1)
131127
(set-boolean-preference var val)
132128
(show-icon-bar n val))

src/Graphics/Gui/message.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -574,18 +574,6 @@ set_main_icons (widget w, widget bar) {
574574
write (w, SLOT_MAIN_ICONS, bar);
575575
}
576576

577-
inline void
578-
set_tab_pages_visibility (widget w, bool visible) {
579-
// set visibility of tab bar
580-
send<bool> (w, SLOT_TAB_PAGES_VISIBILITY, visible);
581-
}
582-
583-
inline bool
584-
get_tab_pages_visibility (widget w) {
585-
// get visibility of tab bar
586-
return query<bool> (w, SLOT_TAB_PAGES_VISIBILITY);
587-
}
588-
589577
inline void
590578
set_tab_pages (widget w, widget bar) {
591579
// set tab bar

src/Plugins/Qt/qt_tm_widget.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ qt_tm_widget_rep::qt_tm_widget_rep (int mask, command _quit)
180180
visibility[7] = (mask & 128) == 128; // left side tools
181181
visibility[8] = (mask & 256) == 256; // bottom tools
182182
visibility[9] = (mask & 512) == 512; // extra bottom tools
183-
visibility[10]= (mask & 1024) == 1024; // tab page bar
184183
visibility[11]= (mask & 2048) == 2048; // auxiliary widget
185184

186185
#ifdef OS_WASM
@@ -936,8 +935,6 @@ qt_tm_widget_rep::update_visibility () {
936935
bool old_bottomVisibility= bottomTools->isVisible ();
937936
bool old_extraVisibility = extraTools->isVisible ();
938937
bool old_auxVisibility = auxiliaryWidget->isVisible ();
939-
bool old_tabVisibility=
940-
tabPageContainer ? tabPageContainer->isVisible () : false;
941938
bool old_statusVisibility= mainwindow ()->statusBar ()->isVisible ();
942939
bool old_titleVisibility = windowAgent->titleBar ()->isVisible ();
943940

@@ -951,7 +948,6 @@ qt_tm_widget_rep::update_visibility () {
951948
bool new_leftVisibility = visibility[7];
952949
bool new_bottomVisibility= visibility[8];
953950
bool new_extraVisibility = visibility[9];
954-
bool new_tabVisibility = visibility[10] && visibility[0];
955951
bool new_auxVisibility = visibility[11];
956952
bool new_titleVisibility = visibility[0];
957953

@@ -967,7 +963,6 @@ qt_tm_widget_rep::update_visibility () {
967963
new_bottomVisibility= false;
968964
new_extraVisibility = false;
969965
new_auxVisibility = false;
970-
new_tabVisibility = true;
971966
new_titleVisibility = true;
972967
}
973968

@@ -991,8 +986,6 @@ qt_tm_widget_rep::update_visibility () {
991986
extraTools->setVisible (new_extraVisibility);
992987
if (XOR (old_auxVisibility, new_auxVisibility))
993988
auxiliaryWidget->setVisible (new_auxVisibility);
994-
if (tabPageContainer && XOR (old_tabVisibility, new_tabVisibility))
995-
tabPageContainer->setVisible (new_tabVisibility);
996989
if (XOR (old_titleVisibility, new_titleVisibility))
997990
windowAgent->titleBar ()->setVisible (new_titleVisibility);
998991
if (XOR (old_statusVisibility, new_statusVisibility))
@@ -1150,11 +1143,6 @@ qt_tm_widget_rep::send (slot s, blackbox val) {
11501143
visibility[9]= open_box<bool> (val);
11511144
update_visibility ();
11521145
} break;
1153-
case SLOT_TAB_PAGES_VISIBILITY: {
1154-
check_type<bool> (val, s);
1155-
visibility[10]= open_box<bool> (val);
1156-
update_visibility ();
1157-
} break;
11581146
case SLOT_AUXILIARY_WIDGET_VISIBILITY: {
11591147
check_type<bool> (val, s);
11601148
visibility[11]= open_box<bool> (val);
@@ -1312,10 +1300,6 @@ qt_tm_widget_rep::query (slot s, int type_id) {
13121300
check_type_id<bool> (type_id, s);
13131301
return close_box<bool> (visibility[9]);
13141302

1315-
case SLOT_TAB_PAGES_VISIBILITY:
1316-
check_type_id<bool> (type_id, s);
1317-
return close_box<bool> (visibility[10]);
1318-
13191303
case SLOT_AUXILIARY_WIDGET_VISIBILITY:
13201304
check_type_id<bool> (type_id, s);
13211305
return close_box<bool> (visibility[11]);
@@ -1808,7 +1792,6 @@ qt_tm_embedded_widget_rep::send (slot s, blackbox val) {
18081792
case SLOT_LEFT_TOOLS_VISIBILITY:
18091793
case SLOT_BOTTOM_TOOLS_VISIBILITY:
18101794
case SLOT_EXTRA_TOOLS_VISIBILITY:
1811-
case SLOT_TAB_PAGES_VISIBILITY:
18121795
case SLOT_AUXILIARY_WIDGET_VISIBILITY:
18131796
case SLOT_NOTIFICATION_BAR:
18141797
case SLOT_AUXILIARY_WIDGET:
@@ -1868,7 +1851,6 @@ qt_tm_embedded_widget_rep::query (slot s, int type_id) {
18681851
case SLOT_LEFT_TOOLS_VISIBILITY:
18691852
case SLOT_BOTTOM_TOOLS_VISIBILITY:
18701853
case SLOT_EXTRA_TOOLS_VISIBILITY:
1871-
case SLOT_TAB_PAGES_VISIBILITY:
18721854
case SLOT_AUXILIARY_WIDGET_VISIBILITY:
18731855
check_type_id<bool> (type_id, s);
18741856
return close_box<bool> (false);

src/Texmacs/Data/new_window.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class kill_window_command_rep : public command_rep {
8585
};
8686

8787
url
88-
new_window (bool map_flag, tree geom, bool force_tab_bar) {
88+
new_window (bool map_flag, tree geom) {
8989
int mask= 0;
9090
if (get_preference ("header") == "on") mask+= 1;
9191
if (get_preference ("main icon bar") == "on") mask+= 2;
@@ -97,7 +97,7 @@ new_window (bool map_flag, tree geom, bool force_tab_bar) {
9797
// if (get_preference ("left tools") == "on") mask += 128;
9898
if (get_preference ("bottom tools") == "on") mask+= 256;
9999
if (get_preference ("extra tools") == "on") mask+= 512;
100-
if (force_tab_bar || get_preference ("tab bar") == "on") mask+= 1024;
100+
mask+= 1024;
101101
url* id = tm_new<url> (url_none ());
102102
command quit= tm_new<kill_window_command_rep> (id);
103103
tm_window win = tm_new<tm_window_rep> (texmacs_widget (mask, quit), geom);
@@ -303,7 +303,7 @@ ensure_window (tree geom) {
303303
// 先设置标题,再创建 view,确保标签页显示正确的标题
304304
string title= is_community_stem () ? "Mogan STEM" : "Liii STEM";
305305
set_title_buffer (name, title);
306-
url win= new_window (true, geom, true);
306+
url win= new_window (true, geom);
307307
window_set_view (win, get_passive_view (name), true);
308308
return win;
309309
#else

src/Texmacs/Data/new_window.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void switch_to_window (url win);
2626
void switch_to_parent_window ();
2727

2828
url create_buffer ();
29-
url new_window (bool map_flag= true, tree geom= "", bool force_tab_bar= false);
29+
url new_window (bool map_flag= true, tree geom= "");
3030
url open_window (tree geom= "");
3131
url ensure_window (tree geom= "");
3232
void clone_window ();

src/Texmacs/Window/tm_frame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "tm_window.hpp"
1818
#include "url.hpp"
1919

20-
#define NUM_TOOLBARS 4
20+
#define NUM_TOOLBARS 3
2121

2222
/******************************************************************************
2323
* Constructor and destructor

src/Texmacs/Window/tm_window.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ tm_window_rep::set_icon_bar_flag (int which, bool flag) {
505505
else if (which == 1) set_mode_icons_visibility (wid, flag);
506506
else if (which == 2) set_focus_icons_visibility (wid, flag);
507507
else if (which == 3) set_user_icons_visibility (wid, flag);
508-
else if (which == 4) set_tab_pages_visibility (wid, flag);
509508
}
510509

511510
void
@@ -546,7 +545,6 @@ tm_window_rep::get_icon_bar_flag (int which) {
546545
else if (which == 1) return get_mode_icons_visibility (wid);
547546
else if (which == 2) return get_focus_icons_visibility (wid);
548547
else if (which == 3) return get_user_icons_visibility (wid);
549-
else if (which == 4) return get_tab_pages_visibility (wid);
550548
else return false;
551549
}
552550

0 commit comments

Comments
 (0)