mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2026-05-04 17:57:58 +02:00
scrolling: add promote layoutmsg
This commit is contained in:
parent
19dc215230
commit
c04dee3d0c
2 changed files with 14 additions and 1 deletions
|
|
@ -23,4 +23,5 @@ Adds a scrolling layout to Hyprland.
|
|||
| 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 |
|
||||
| focus | moves the focus and centers the layout, while also wrapping instead of moving to neighbring monitors. | direction |
|
||||
| promote | moves a window to its own new column | none |
|
||||
|
|
@ -990,6 +990,18 @@ std::any CScrollingLayout::layoutMessage(SLayoutMessageHeader header, std::strin
|
|||
|
||||
default: return {};
|
||||
}
|
||||
} else if (ARGS[0] == "promote") {
|
||||
const auto WDATA = dataFor(g_pCompositor->m_lastWindow.lock());
|
||||
|
||||
if (!WDATA)
|
||||
return {};
|
||||
|
||||
auto idx = WDATA->column->workspace->idx(WDATA->column.lock());
|
||||
auto col = idx == -1 ? WDATA->column->workspace->add() : WDATA->column->workspace->add(idx);
|
||||
|
||||
WDATA->column->remove(WDATA->window.lock());
|
||||
|
||||
col->add(WDATA);
|
||||
}
|
||||
|
||||
return {};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue