-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 window resize to absolute values #6386
base: master
Are you sure you want to change the base?
Conversation
By absolute sizes do you mean size in cells or size in bias units? If you mean size in cells, there are various problems. If you set the You could possibly mean "absolute" in the sense that specifying a size But note that to be acceptable such a PR has to work for all layouts |
That's by far about an absolute bias value. In the current implementation, there's no way to specify that other than changing the global layout setting which will forcedly reshape all existing windows. I was looking for something similar to 'resize_window' for one window but in the sense of absolute value (not relative increments/decrements). The current solution allows to set absolute 'bias' for a window in a split. But I can see a relatively simple solution like adding units suffix (like 'px', 'pt', 'cells', '%') to the number argument. This feature might come later as an incremental improvement after an initial solution. Regarding all other layouts, I agree that consistency is important. I can see how it can be implemented as a more general case in the base class for all layouts. Does it also imply adding support for 'bias' option to all layouts or it's a separate thing? What do you think about this feature? |
On Thu, Jun 22, 2023 at 03:43:48AM -0700, Yury Ershov wrote:
That's by far about an absolute bias value. In the current implementation, there's no way to specify that other than changing the global layout setting which will forcedly reshape all existing windows.
I am OK with that.
I was looking for something similar to 'resize_window' for one window but in the sense of absolute value (not relative increments/decrements).
The current solution allows to set absolute 'bias' for a window in a split. But I can see a relatively simple solution like adding units suffix (like 'px', 'pt', 'cells', '%') to the number argument. This feature might come later as an incremental improvement after an initial solution.
Just cells absolute and relative are fine as far as I am concerned.
Indeed since windows only have sizes in cells, you cant really use other
units they will get rounded to nearest cells anyway.
Regarding all other layouts, I agree that consistency is important. I can see how it can be implemented as a more general case in the base class for all layouts.
Yes in order for me to consider a PR it has to be implemented for all
layouts.
Does it also imply adding support for 'bias' option to all layouts or it's a separate thing?
All layouts internally use bias already otherwise they would not be
resizeable at all. Except for the stack layout, obviously.
What do you think about this feature?
I'm OK with reviewing a PR for it.
|
Is it ok to start with just bias value (which is equal to percent) and adding cells later as a separate PR?
Sounds good.
Ah yes, I mean, bias is used internally but not every layout supports the 'bias' option as a parameter to 'enabled_layouts'. Are you also looking to enable it for all layouts too? This also might go as a separate PR as it's an independent feature which would be good for consistency. |
On Thu, Jun 22, 2023 at 02:20:23PM -0700, Yury Ershov wrote:
> Just cells absolute and relative are fine as far as I am concerned. Indeed since windows only have sizes in cells, you cant really use other units they will get rounded to nearest cells anyway.
Is it ok to start with just bias value (which is equal to percent) and adding cells later as a separate PR?
It's fine to start with bias but not that bias is only a percent in the
case of two windows involved. If there are more than two then it is no
longer a percent.
> Yes in order for me to consider a PR it has to be implemented for all layouts.
Sounds good.
>> Does it also imply adding support for 'bias' option to all layouts or it's a separate thing?
> All layouts internally use bias already otherwise they would not be resizeable at all. Except for the stack layout, obviously.
Ah yes, I mean, bias is used internally but not every layout supports the 'bias' option as a parameter to 'enabled_layouts'. Are you also looking to enable it for all layouts too? This also might go as a separate PR as it's an independent feature which would be good for consistency.
One cannot have bias as a parameter for all layouts, it is meaningless
for some layouts such as stack/horiontal/vertical, it only really works
for splits/vertical/horizontal. And I dont much see the point of it for
splits, why would you want every split you make to start out already
biased?
|
Since I use 'splits' a lot, I can tell that I expected it to be more consistent. If it has the 'bias' parameter, I don't see why it ignores it in options to 'enabled_layouts splits:bias=X'. One of possible uses is: when I open a secondary window, I might prefer it to be smaller than the main one. One of the ways to achieve it would be to specify the 'bias' parameter. By the way, the 'Pair' currently doesn't clear its 'bias' when one of windows is closed. It leads to an odd behavior of recalling the last 'bias' on the next split. To reproduce:
Result: the split ratio is not 1:1 but the same as it was adjusted. |
On Fri, Jun 23, 2023 at 01:09:20AM -0700, Yury Ershov wrote:
> One cannot have bias as a parameter for all layouts, it is meaningless for some layouts such as stack/horiontal/vertical, it only really works for splits/vertical/horizontal. And I dont much see the point of it for splits, why would you want every split you make to start out already biased?
Since I use 'splits' a lot, I can tell that I expected it to be more consistent. If it has the 'bias' parameter, I don't see why it ignores it in options to 'enabled_layouts splits:bias=X'.
One of possible uses is: when I open a secondary window, I might prefer it to be smaller than the main one. One of the ways to achieve it would be to specify the 'bias' parameter.
But setting an overall bias means that *every* split you open in that
layout will be biased.
By the way, the 'Pair' currently doesn't clear its 'bias' when one of windows is closed. It leads to an odd behavior of recalling the last 'bias' on the next split.
Yes, that's by design. If you want a pair of windows biased, I dont see
why closing one of them neccessarily means you no longer want the bias.
|
Ok but the bias is not saved for the next split level. |
dc27691
to
63df210
Compare
This is a proof-of-concept for enabling the 'split' layout to use the 'bias' option and allowing to specify the absolute values for 'resize_window' command.
The 'bias' option was previously ignored by 'splits' layout, now it's possible to do:
Only increments or decrements were previously accepted. 'width' and 'height' are for absolute percentages:
The issue is mentioned here: #6382
Please let me know if this kind of change can potentially be accepted.