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

Add more specific margin capabilities #196

Merged
merged 3 commits into from
Feb 17, 2021
Merged

Conversation

mautamu
Copy link
Member

@mautamu mautamu commented Feb 17, 2021

Good evening,

This PR adds functionality to the margins as per #194. I went with the HTML format of [top, right, bottom, left] and [top/bottom, left/right]. To change the margins, edit ~/.config/leftwm/themes/current/theme.toml from:

border_width = 4
margin = 10

to:

border_width = 4
margin = [10, 10]

I intended to apply this to borders as well, but it does not appear that this is possible due to an upstream requirement of a singular integer to define borders, but it may be possible.

@mautamu mautamu changed the title Margin4 Add more specific margin capabilities Feb 17, 2021
@lex148 lex148 merged commit 10e24ff into leftwm:master Feb 17, 2021
mautamu added a commit to mautamu/leftwm that referenced this pull request Mar 18, 2021
* Adds more customizability for window margins

* Correct order

* FMT
@@ -147,9 +148,13 @@ impl Window {
value = self.normal.w();
} else if self.floating() && self.floating.is_some() {
let relative = self.normal + self.floating.unwrap();
value = relative.w() - (self.margin * 2) - (self.border * 2);
value = relative.w()
- (self.margin.clone().left() + self.margin.clone().right())
Copy link
Member

Choose a reason for hiding this comment

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

@mautamu or @lex148: may I ask, why you apply a margin to a floating window?

Copy link
Member Author

Choose a reason for hiding this comment

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

I’m not sure exactly why it’s applied. Can try running it without and see what happens.

Copy link
Member

Choose a reason for hiding this comment

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

Might test myself as well. Was just curious if there was some reasoning behind that.

} else {
self.normal.y() + self.margin
self.normal.y() + self.margin.clone().bottom()
Copy link
Member

@VuiMuich VuiMuich Mar 28, 2021

Choose a reason for hiding this comment

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

another question if I may: why are you using .bottom() here and not .top()? Isn't the origin for determining window-positions the top-left screen corner?

Copy link
Member Author

Choose a reason for hiding this comment

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

Now that you mention it, that’s probably right. This might be an artifact from when I was confused and had the HTML top/bottom/ left/right specs backwards.

Should probably check over and see if the behaviour is what we’re expecting it to be.

Copy link
Member

@VuiMuich VuiMuich Mar 29, 2021

Choose a reason for hiding this comment

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

as I am just about to get a MarginMultiplier PR ready (just struggling to get the external command working) so I might include this..

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds great! Thanks for reviewing that. I wonder if it's partially related to #248

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it's partially related to #248

Gonna look into this tomorrow, now it's bedtime. Gn8

@mautamu mautamu deleted the margin4 branch April 6, 2021 13:19
mautamu added a commit to mautamu/leftwm that referenced this pull request May 19, 2021
* Adds more customizability for window margins

* Correct order

* FMT
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

Successfully merging this pull request may close these issues.

3 participants