Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: toggle_floating_state and is_floating (#306) #307

Merged
merged 6 commits into from
Aug 15, 2024

Conversation

codybloemhard
Copy link
Contributor

In order to resolve issue #306

Adds:

  • StackSet<Clone + PartialEq + Eq + Hash>::is_floating
  • StackSet::toggle_floating_state
  • builtin::actions::floating::toggle_floating_focused

Copy link
Owner

@sminez sminez left a comment

Choose a reason for hiding this comment

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

Implementation looks good 👍

If you can add some teats for the toggle method then this should be good to merge.There are equivalent tests for similar methods in the file already using the test_case macro to cover the different cases you highlight in the doc comment.

Comment on lines 819 to 824
Ok(if self.is_floating(&client) {
self.sink(&client)
} else {
self.float(client, r)?;
None
})
Copy link
Owner

Choose a reason for hiding this comment

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

Can this be bound to a variable and returned as Ok(rect) rather wrapping the whole if statement

@codybloemhard
Copy link
Contributor Author

I tried to split toggle_floating_state test case into two, one using test_case to check for the different errors it can return but I couldn't assert them because Error has no PartialEq and quickly adding it into the derive didn't work out.

Copy link
Owner

@sminez sminez left a comment

Choose a reason for hiding this comment

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

A couple of minor style things but I'll fix those up post merge rather than nitpicking on this PR 🙂

Thank you for taking the time to contribute to Penrose!

@sminez sminez merged commit e0c0a2d into sminez:develop Aug 15, 2024
9 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants