sioyek
sioyek copied to clipboard
Option to remove the title bar on macos
These buttons are not necessary as the sioyek are keyboard-driven. Removing this bar could reduce the distraction and increase the usage of the screen.
Many modern apps already support this (e.g., iterm2)
![image](https://user-images.githubusercontent.com/59846322/181783465-f820655c-df8f-423f-a7a0-7f77689284a2.png)
It is also easy to be done https://developer.apple.com/documentation/uikit/mac_catalyst/removing_the_title_bar_in_your_mac_app_built_with_mac_catalyst
Remove the Title Bar
If you choose to design your window without a title bar, you must remove it from the window. To remove the title bar, set the title bar’s titleVisibility property to UITitlebarTitleVisibility.hidden and the toolbar property to nil. The following code shows how to remove the title bar and its separator from the window during the setup of a new scene.
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
#if targetEnvironment(macCatalyst)
if let titlebar = windowScene.titlebar {
titlebar.titleVisibility = .hidden
titlebar.toolbar = nil
}
#endif
}
Why not just fullscreen the window (toggle_fullscreen
command)?
Why not just fullscreen the window (
toggle_fullscreen
command)?
Thank you for the reply! The main reason is that I usually have multiple windows side by side on the screen. Those space title bar and status bar took become critical especially when I work with a laptop screen
Added a toggle_titlebar
command in 43fbb014a0b20ef970b006279ca7f166e9272116. It is pretty buggy on windows though (doesn't work well with snapped windows). I don't know how well it will work on MacOS.
Wow, this is quick! I couldn't test it as I encountered some problem when building from the source... Is the prebuilt version available?
There is an experimental build here: https://github.com/hexomancer/sioyek/releases/tag/v0.31.358
It seems that it is also buggy on MacOS, the window seems cannot be resized after toggle the titlebar
Yes, that is also the case on windows. I don't know if it can be done in a cross-platform way using Qt.
Yes, it seems that it is a problem. I found this long issue from qutebrowser
, as it is also built using Qt and people are asking for the same feature https://github.com/qutebrowser/qutebrowser/issues/4067
It seems that they have a potential fix recently https://github.com/qutebrowser/qutebrowser/pull/7293.
This seems to be a MacOS-specific solution. I can't really test it on my systems.
I think in Linux, they can control the appearance of the title bar globally through the windows manager, so Linux support is not needed. So if this works in MacOS, it is sort of 'cross-platform' with the exception of windows.
Let me know if I can help with anything, although I don't know Qt but maybe I can help with testing.
Hey! Just saw this linked in the qutebrowser thread. Some good news regarding frameless windows not being resizable:
- This is fixed in Qt 6.3 via macOS: Handle window titlebar buttons independently from style mask (I2c1a9564) · Gerrit Code Review - so I suppose once this project migrates to Qt 6, things should just work.
- The workaround proposed in https://github.com/qutebrowser/qutebrowser/pull/7293 seems to work fine for qutebrowser. I have no idea how to do the same thing for a C++ project, though. I suppose it will be more difficult to mix C++ and Objective C there.
@ahrm FWIW, you might be able to get a free hosted Mac via Open Source Program - Encouraging Open Innovation | MacStadium. That's what I use for qutebrowser, and it's been a lifesaver for testing macOS-specific stuff.
@The-Compiler Thanks for the info, and also for the macstudium suggestion, will definitely check it out. And thanks for your work on qutebrowser.
I just tested toggle_titlebar
in my mac. What ends up happening is my titlebar stays but the tabs are hidden.
Any update on this, there seems to be some new issue also related to this #862 #860
I have tested it with new Qt versions but it still seems to be buggy.
@ahrm, I've tested the toggle_titlebar command on the development branch in macOS, and it works fine.