Skip to content
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

accordion-padding per workspace #558

Closed
nikitabobko opened this issue Oct 3, 2024 · 5 comments
Closed

accordion-padding per workspace #558

nikitabobko opened this issue Oct 3, 2024 · 5 comments

Comments

@nikitabobko
Copy link
Owner

nikitabobko commented Oct 3, 2024

@nikitabobko: Is it possible to set accordion-padding per workspace somehow? I can't see setting it aside from the general attribute, but it would be nice. Reason being Zed editor opens several windows but has its own project switching. So I put them all on the same workspace, but don't need the accordion padding.

I didn't want to open another issue as this doesn't really seem like a bug and is closely related to this question.

Originally posted by @theherk in #374 (comment)

@nikitabobko
Copy link
Owner Author

@theherk no, it's not possible, and I think it's conceptually wrong to render containers differently based on a workspace.

Frankly speaking, I don't understand why would someone want to set paddings to zero, since it makes it hard to understand that there are more than 1 window in the container, and it makes it hard to know the orientation of the accordion.

That being said, you can easily patch AeroSpace to achieve what you need:

diff --git a/Sources/AppBundle/layout/layoutRecursive.swift b/Sources/AppBundle/layout/layoutRecursive.swift
index d1d00287..a9513c6f 100644
--- a/Sources/AppBundle/layout/layoutRecursive.swift
+++ b/Sources/AppBundle/layout/layoutRecursive.swift
@@ -123,7 +123,7 @@ private extension TilingContainer {
     func layoutAccordion(_ point: CGPoint, width: CGFloat, height: CGFloat, virtual: Rect, _ context: LayoutContext) {
         guard let mruIndex: Int = mostRecentChild?.ownIndexOrNil else { return }
         for (index, child) in children.enumerated() {
-            let padding = CGFloat(config.accordionPadding)
+            let padding = CGFloat(context.workspace.name == "zed-workspace" ? 0 : config.accordionPadding)
             let (lPadding, rPadding): (CGFloat, CGFloat) = switch index {
                 case 0 where children.count == 1: (0, 0)
                 case 0:                           (0, padding)

In future, it will be easier to install AeroSpace directly from sources #530

@nikitabobko nikitabobko changed the title @nikitabobko: Is it possible to set accordion-padding per workspace somehow? I can't see setting it aside from the general attribute, but it would be nice. Reason being Zed editor opens several windows but has its own project switching. So I put them all on the same workspace, but don't need the accordion padding. accordion-padding per workspace Oct 3, 2024
@nikitabobko
Copy link
Owner Author

Frankly speaking, I don't understand why would someone want to set paddings to zero

Conceptually, it maybe should be a separate "fullscreen-like" layout (NB: don't confuse it with the fullscreen command), but a more concrete proposal should be made. I currently lack the vision, understanding, and use cases for this feature

@nikitabobko
Copy link
Owner Author

To be even more candid, I even lack the understanding for fullscreen command. It's supported only for compatibility with other WMs #7.

I prefer accordion layout over fullscreen command because windows just always stay (almost) fullscreen. I don't need to go fullscreen back-and-forth just to switch windows on the workspace. Yes, accordion takes some screen space to display paddings - it's a reasonable price to pay to understand container orientation

@shishkin
Copy link

@nikitabobko Not for the sake of argument but just to maybe provide another perspective. I fully agree that on a large display a small potion of pixels for accordion gaps is a good trade off for providing context. But on a 14" laptop screen, setting all gaps to 0 was the first thing I changed in the default AeroSpace config. I also don't need a reminder for the accordion orientation because I only have it set horizontally (I don't really care which way, but unless I work on a vertical monitor, I don't need both orientations). Having windows in fullscreen also removes distractions and eases OCD. I actually enjoy how I configured AeroSpace with default gapless accordion layout because it forces most windows to fullscreen and I don't have to constantly fight MacOS tendency to instill "creative mess" on my desktop. I still appreciate AeroSpace's workspace organization and tiling layout is indispensable on large (for me only external) monitors.

@daibertdiego
Copy link

Maybe another feature would be the ability to choose the accordion padding based on the monitor itself. As we have for the gaps. In this way, for smaller monitors, we can use 0 padding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants