Skip to content

[Feat] Custom margin settings - #915

Open
r3dArch wants to merge 6 commits into
MalpenZibo:mainfrom
r3dArch:feat/improve-margin-settings
Open

[Feat] Custom margin settings#915
r3dArch wants to merge 6 commits into
MalpenZibo:mainfrom
r3dArch:feat/improve-margin-settings

Conversation

@r3dArch

@r3dArch r3dArch commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Closes #351

This allows for custom margin size in pixels without breaking the old margin system, although it removes the scaling that was applied to the old margins.

Samples with config:

1 margin = [10, 20] 2 margin = "xs" 3 margin = 20 4 margin = [50, 20] 5 margin = [10, 20, 30, 40] 6 margin = [10, "xxl", 30, 40]

edit: wrote out the margins for easier parsing.

P.S. I've really enjoyed Ashell, thank you for making it.

@MalpenZibo

Copy link
Copy Markdown
Owner

Check this #867

We already added a margin settings. For now it uses the spacing scale from the DS token but we don't have yet a way to change that scale.

@r3dArch

r3dArch commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

This PR builds on that one. It still allows specifying the margin as in #867, but also allows specifying it in pixels. To make the implementation simpler I removed margin scaling since I think most users would want to work with physical pixels, not scaled pixels; if you want, I can add scaling for just the space size margins, but I think it won't matter to most users.

@r3dArch
r3dArch marked this pull request as draft August 12, 2026 21:49
@r3dArch

r3dArch commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

I would still need to update the docs as in #867, so I've made this PR a draft for now. Please let me know if this is something you would want to merge and I'll update the docs and make any requested changes.

@r3dArch
r3dArch marked this pull request as ready for review August 18, 2026 23:05
@r3dArch

r3dArch commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

I updated the documentation. Please let me know if there is anything you'd like done differently.

Comment thread src/outputs.rs Outdated
Comment on lines +147 to +148
BarSurface::Solid => 8.,
BarSurface::Transparent => 0.,
BarSurface::Solid => 0.,
BarSurface::Transparent => 8.,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it the opposite now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had changed the transparent to be 8 because I removed the padding, but I think the solid should still be 8, so I could probably remove this match and make HEIGHT = 26 instead. I'll push some changes soon.

Comment thread src/outputs.rs
Comment on lines -168 to +161
Position::Top => top,
Position::Bottom => bottom,
Position::Top => bottom,
Position::Bottom => top,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the exclusive zone pushes other windows away from the bar, so when the bar is on the bottom it is the top margin that determines the exclusive zone and vice versa. I've retested this and it seems to work as expected.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Appearance - Custom margin & padding

2 participants