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

Adding the option to choose a border side, similar to margins #3674

Open
Crylia opened this issue Aug 15, 2022 · 7 comments
Open

Adding the option to choose a border side, similar to margins #3674

Crylia opened this issue Aug 15, 2022 · 7 comments

Comments

@Crylia
Copy link
Contributor

Crylia commented Aug 15, 2022

Currently if you want a border you do border_width which draws a full border. But it would actually be nice to be able to choose a single side similar to CSS or how the wibox.container.margin works.

While one is an entire container and the other a common property it would still be a good addition imo

@sclu1034
Copy link
Contributor

sclu1034 commented Aug 16, 2022

the other [is] a common property

It is not a "common" property. Whenever it is implemented, it is done so in isolation and little to nothing is shared with any other instance.
If your desired behaviour should be unified, it would need to be implemented and maintained separately in half a dozen places.

But for widgets, that would be redundant, as you can already use the very same margin container to create a selective, colored border around the child widget.

@Crylia
Copy link
Contributor Author

Crylia commented Aug 16, 2022

But for widgets, that would be redundant, as you can already use the very same margin container to create a selective, colored border around the child widget.

But this approach comes with a few downsides. You can't have a shape, the border will always be straight or at the very least have an edge on the inside since you could put a border around it, but not inside. Then there is the downside to always having a margin since it doubles as a border_width now, usually there is a property to choose weather not you want to affect the content or not(While its possible to workaround, its quiet some work as to a simple property).

@sclu1034
Copy link
Contributor

Then that would warrant a new type of container widget that can handle that stuff. But all of that complexity should not be put into widgets whose job isn't drawing borders.

@Crylia
Copy link
Contributor Author

Crylia commented Aug 16, 2022

Maybe add that to wibox.container.background instead of creating a new container.

@Elv13
Copy link
Member

Elv13 commented Aug 18, 2022

Good news everyone: #3559

But in practice there is a reason why it would be hard to add to the background container. It's actually the same reason why I made the border one. The background container, despite it's name, evolved into a "shape" container over time (yes, I did that). Shapes are just dumb paths and implementing different size would be nearly impossible. The new one, on the other hand, allows widgets or images (including inline SVG/CSS) to be used as borders. The current implementation might not do 100% what you want. Try it, break it, comment there. Beside, I agree with @sclu1034, I would rather have many annoying composition layers than implement everything in a dozen different widgets. border_* and margins/padding are in many because they have corner cases which could not be handled in any other way. That doesn't mean we should duplicate properties for the sake of it.

@naranyala
Copy link

naranyala commented Aug 19, 2023

can we achieve setting bottom border/margin to be greater than others side in each tag? only the bottom

@Crylia
Copy link
Contributor Author

Crylia commented Aug 20, 2023

can we achieve setting bottom border/margin to be greater than others side in each tag? only the bottom

Do you mean something like this?

{
  widget = wibox.container.margin,
  left = 20,
  right = 10,
  top = 40,
  bottom = 30
}

That would only work for magins but not borders, but there is a PR #3559 that adds the ability to have different borders for each side iirc

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

No branches or pull requests

4 participants