1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-21 11:50:42 +03:00

add window:set_position window:set_inner_size

This commit is contained in:
Wez Furlong 2022-07-06 18:08:38 -07:00
parent 61fb3dffe4
commit 3e01d44ece
4 changed files with 27 additions and 0 deletions

View File

@ -14,6 +14,8 @@ As features stabilize some brief notes about them will accumulate here.
#### New
* [ActivateKeyTable](config/lua/keyassignment/ActivateKeyTable.md) now supports `until_unknown=true` to implicitly pop the table when a key not defined by that table is pressed. [#2178](https://github.com/wez/wezterm/issues/2178)
* [window:copy_to_clipboard](config/lua/window/copy_to_clipboard.md) method for putting arbitrary text into the clipboard/selection.
* [window:set_inner_size](config/lua/window/set_inner_size.md) method for controlling window size.
* [window:set_position](config/lua/window/set_position.md) method for controlling window position.
* [window:get_selection_escapes_for_pane](config/lua/window/get_selection_escapes_for_pane.md) method for getting the current selection including escape sequences. [#2223](https://github.com/wez/wezterm/issues/2223)
* New [wezterm.gui](config/lua/wezterm.gui/index.md) module and [mux_window:gui_window](config/lua/mux-window/gui_window.md) method.

View File

@ -0,0 +1,6 @@
# `window:set_inner_size(width, height)`
*Since: nightly builds only*
Resizes the inner portion of the window (excluding any window decorations) to
the specified width and height.

View File

@ -0,0 +1,8 @@
# `window:set_position(x, y)`
*Since: nightly builds only*
Repositions the top-left corner of the window to the specified `x`, `y` coordinates.
Note that Wayland does not allow applications to directly control their window
placement, so this method has no effect on Wayland.

View File

@ -39,6 +39,17 @@ impl UserData for GuiWin {
methods.add_method("mux_window", |_, this, _: ()| {
Ok(mux_lua::MuxWindow(this.mux_window_id))
});
methods.add_method(
"set_inner_size",
|_, this, (width, height): (usize, usize)| {
this.window.set_inner_size(width, height);
Ok(())
},
);
methods.add_method("set_position", |_, this, (x, y): (isize, isize)| {
this.window.set_window_position(euclid::point2(x, y));
Ok(())
});
methods.add_method(
"toast_notification",
|_, _, (title, message, url, timeout): (String, String, Option<String>, Option<u64>)| {