Skip to content

Commit

Permalink
[81_9] Hide tabbar when user chooses 'Documents in separate windows' (#…
Browse files Browse the repository at this point in the history
…2068)

<!-- Thank you for your contribution! -->
## What
尽可能地避免出现文档渲染不一致的问题,但是没有从根本上解决
## Why
[Issues 2009](#2009)

"没有办法完全强制不允许使用tabbar,我只能做到当用户选择Documents in separate
windows的时候,用户无法显示tabbar。然而Documents in separate
windows这个情况,用户新建一个文档,在新的窗口那里又选择Multiple Document shared
window,**那么新的窗口又可以显示tabbar**,然后在tabbar关闭新建的文档,又会出现luozhiya提出的这个问题。"

这个pr是昨天就写好了的,虽然没有从根本上解决luozhiya提出的这个问题,但是当用户选择`Documents in separate
windows`的时候按道理不应该显示Tabbar。

**所以这个pr优化的问题是**:当用户选择`Documents in separate
windows`的时候自动隐藏Tabbar(但不是禁用,因为正如上述,用户还能有途径显示tabbar)。

@da-liii  @Oyyko @luozhiya
  • Loading branch information
Minzihao authored Sep 6, 2024
1 parent 47d8053 commit 096949b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions TeXmacs/plugins/lang/dic/en_US/zh_CN.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1979,6 +1979,8 @@
("system environment variables" "")
("tab bar" "标签页工具栏")
("tab" "")
("tab" "制表符")
("tab bar" "标签栏")
("tab-completion" "用制表符自动补全")
("table command" "")
("table height" "表格高度")
Expand Down
1 change: 1 addition & 0 deletions TeXmacs/plugins/lang/dic/en_US/zh_TW.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,7 @@ TeXmacs 的資料可參考 Help 說明")
("system command" "")
("system environment variables" "")
("tab" "制表符")
("tab bar" "標籤欄")
("tab-completion" "自動補齊")
("table" "表格")
("table command" "")
Expand Down
10 changes: 9 additions & 1 deletion TeXmacs/progs/texmacs/menus/preferences-widgets.scm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
(when (!= new old)
(notify-restart))))

(define (on-buffer-management-changed pretty-val)
(let ((can-use-tabbar? (== pretty-val "Multiple documents share window")))
(begin
(set-boolean-preference "tab bar" can-use-tabbar?)
(show-icon-bar 4 can-use-tabbar?)
(set-pretty-preference "buffer management" pretty-val)
)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Appearance preferences
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -92,7 +100,7 @@
(get-pretty-preference "detailed menus")
"18em"))
(item (text "Buffer management:")
(enum (set-pretty-preference "buffer management" answer)
(enum (on-buffer-management-changed answer)
'("Documents in separate windows"
"Multiple documents share window")
(get-pretty-preference "buffer management")
Expand Down
2 changes: 1 addition & 1 deletion TeXmacs/progs/texmacs/menus/view-menu.scm
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@
---
(when (visible-header?)
("Main icon bar" (toggle-visible-icon-bar 0))
("Tab bar" (toggle-visible-icon-bar 4))
("Mode dependent icons" (toggle-visible-icon-bar 1))
("Focus dependent icons" (toggle-visible-icon-bar 2))
("User provided icons" (toggle-visible-icon-bar 3)))
(if (not (window-per-buffer?)) ("Tab bar" (toggle-visible-icon-bar 4)))
("Status bar" (toggle-visible-footer))
(if (with-developer-tool?)
("Side tools" (toggle-visible-side-tools 0)))
Expand Down

0 comments on commit 096949b

Please sign in to comment.