scrolling: add all to colresize

ref #348
This commit is contained in:
Vaxry 2025-05-22 15:17:25 +02:00
parent 212f79fc36
commit 139cccf4ca
Signed by: vaxry
GPG key ID: 665806380871D640
2 changed files with 14 additions and 1 deletions

View file

@ -20,7 +20,7 @@ Adds a scrolling layout to Hyprland.
| name | description | params |
| --- | --- | --- |
| move | move the layout horizontally, by either a relative logical px (`-200`, `+200`) or columns (`+col`, `-col`) | move data |
| colresize | resize the current column, to either a value or by a relative value e.g. `0.5`, `+0.2`, `-0.2` or cycle the preconfigured ones with `+conf` or `-conf` | relative float / relative conf |
| colresize | resize the current column, to either a value or by a relative value e.g. `0.5`, `+0.2`, `-0.2` or cycle the preconfigured ones with `+conf` or `-conf`. Can also be `all (number)` for resizing all columns to a specific width | relative float / relative conf |
| movewindowto | same as the movewindow dispatcher but supports promotion to the right at the end | direction |
| fit | executes a fit operation based on the argument. Available: `active`, `visible`, `all`, `toend`, `tobeg` | fit mode |
| focus | moves the focus and centers the layout, while also wrapping instead of moving to neighbring monitors. | direction |

View file

@ -690,6 +690,19 @@ std::any CScrollingLayout::layoutMessage(SLayoutMessageHeader header, std::strin
if (!WDATA)
return {};
if (ARGS[1] == "all") {
float abs = 0;
try {
abs = std::stof(ARGS[2]);
} catch (...) { return {}; }
for (const auto& c : WDATA->column->workspace->columns) {
c->columnWidth = abs;
}
return {};
}
if (ARGS[1][0] == '+' || ARGS[1][0] == '-') {
if (ARGS[1] == "+conf") {
for (size_t i = 0; i < m_config.configuredWidths.size(); ++i) {