-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat: add Linux system title bar setting option #12040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
c7ffba7
6237c0b
560e1b7
eecc512
1fd1818
5f750c7
aae6238
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,6 @@ | ||||||||||||
| import { Navbar, NavbarCenter, NavbarLeft, NavbarRight } from '@renderer/components/app/Navbar' | ||||||||||||
| import { HStack } from '@renderer/components/Layout' | ||||||||||||
| import SearchPopup from '@renderer/components/Popups/SearchPopup' | ||||||||||||
| import { isLinux, isWin } from '@renderer/config/constant' | ||||||||||||
| import { modelGenerating } from '@renderer/hooks/useRuntime' | ||||||||||||
| import { useSettings } from '@renderer/hooks/useSettings' | ||||||||||||
| import { useShortcut } from '@renderer/hooks/useShortcuts' | ||||||||||||
|
|
@@ -123,7 +122,7 @@ const HeaderNavbar: FC<Props> = ({ | |||||||||||
| justifyContent: 'flex-end', | ||||||||||||
| flex: activeTopicOrSession === 'topic' ? 1 : 'none', | ||||||||||||
| position: 'relative', | ||||||||||||
| paddingRight: isWin || isLinux ? '144px' : '15px', | ||||||||||||
| paddingRight: '8px', | ||||||||||||
|
||||||||||||
| paddingRight: '8px', | |
| paddingRight: | |
| typeof navigator !== 'undefined' && /Windows|Win32|Linux/i.test(navigator.userAgent) | |
| ? '80px' | |
| : '8px', |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
This issue/comment/review was translated by Claude.
Why was this changed?
Original Content
这里为啥要改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
This comment was translated by Claude.
- WindowControls positioning has changed
Previously (main branch):
position: fixed;
top: 0;
right: 0;The window control buttons were fixed in the top-right corner of the window, so Navbar.tsx needed paddingRight: 144px to prevent content from being obscured.
Currently (feature branch):
/* Removed fixed positioning */
display: flex;The window control buttons have become flex children, directly placed inside the NavbarContainer.
- Navbar structure has also changed
Previously: WindowControls was outside the NavbarContainer, using fixed positioning
Currently: WindowControls is inside the NavbarContainer, naturally arranged as flex children
Conclusion
So paddingRight: '8px' is correct! Because:
- The window control buttons are now part of the flex layout and will automatically take up space
- No need to manually reserve 144px of space anymore
- Both Windows and Linux use the same flex layout approach
However, I've unified it to use 15px as before, which has been corrected.
Original Content
- WindowControls 定位方式改变了
之前(main 分支):
position: fixed;
top: 0;
right: 0;
窗口控制按钮是固定定位在窗口右上角的,所以 Navbar.tsx 需要 paddingRight: 144px 来避免内容被遮挡。
现在(feature 分支):
/* 移除了 fixed 定位 */
display: flex;
窗口控制按钮变成了 flex 子元素,直接放在 NavbarContainer 里面。
- Navbar 结构也改变了
之前:WindowControls 在 NavbarContainer 外面,使用 fixed 定位
现在:WindowControls 在 NavbarContainer 里面,作为 flex 子元素自然排列
结论
所以 paddingRight: '8px' 是正确的!因为:
- 窗口控制按钮现在是 flex 布局的一部分,会自动占据空间
- 不再需要手动预留 144px 的空间
- Windows 和 Linux 都使用同样的 flex 布局方式
不过还是和之前统一下使用15 px, 已经修正了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The paddingRight for TabsBar includes hardcoded values for Linux ('8px') when not in fullscreen mode. This padding should be conditional based on whether the system title bar is being used on Linux. When useSystemTitleBar is true on Linux, the custom window controls won't be displayed (they return null), so the padding calculation might need adjustment. Consider making the padding conditional to match whether WindowControls will actually be rendered.