mirror of
https://github.com/wez/wezterm.git
synced 2024-11-23 06:54:45 +03:00
add window:set_position window:set_inner_size
This commit is contained in:
parent
61fb3dffe4
commit
3e01d44ece
@ -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.
|
||||
|
||||
|
6
docs/config/lua/window/set_inner_size.md
Normal file
6
docs/config/lua/window/set_inner_size.md
Normal 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.
|
8
docs/config/lua/window/set_position.md
Normal file
8
docs/config/lua/window/set_position.md
Normal 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.
|
@ -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>)| {
|
||||
|
Loading…
Reference in New Issue
Block a user