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

feat: Add margin_single option #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ layouts = [
border_focus_fixed='#00e8dc',
border_width=1,
border_width_single=0,
margin=0
margin=0,
margin_single=0
),
...
]
Expand Down
5 changes: 4 additions & 1 deletion plasma/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Plasma(Layout):
('border_width', 1, 'Border width'),
('border_width_single', 0, 'Border width for single window'),
('margin', 0, 'Layout margin'),
('margin_single', 0, 'Layout margin for single window'),
]
# If windows are added before configure() was called, the screen size is
# still unknown, so we need to set some arbitrary initial root dimensions
Expand Down Expand Up @@ -80,6 +81,8 @@ def configure(self, client, screen_rect):
node = self.root.find_payload(client)
border_width = self.border_width_single if self.root.tree == [node] \
else self.border_width
margin = self.margin_single if self.root.tree == [node] \
else self.margin
border_color = getattr(self, 'border_' +
('focus' if client.has_focus else 'normal') +
('' if node.flexible else '_fixed'))
Expand All @@ -91,7 +94,7 @@ def configure(self, client, screen_rect):
height-2*border_width,
border_width,
border_color,
margin=self.margin,
margin=margin,
)
# Always keep tiles below floating windows
client.window.configure(stackmode=StackMode.Below)
Expand Down