mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2024-12-26 21:58:10 +01:00
Add remaining window methods
This commit is contained in:
parent
f54f73b105
commit
87574a40e3
1 changed files with 36 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
|||
use crate::{
|
||||
msg::{FullscreenOrMaximized, Msg, Request, RequestResponse, WindowId},
|
||||
request, send_msg,
|
||||
tag::TagHandle,
|
||||
MouseButton,
|
||||
};
|
||||
|
||||
pub struct Window;
|
||||
|
@ -23,6 +25,22 @@ impl Window {
|
|||
|
||||
window_ids.into_iter().map(WindowHandle)
|
||||
}
|
||||
|
||||
pub fn begin_move(&self, button: MouseButton) {
|
||||
let msg = Msg::WindowMoveGrab {
|
||||
button: button as u32,
|
||||
};
|
||||
|
||||
send_msg(msg).unwrap();
|
||||
}
|
||||
|
||||
pub fn begin_resize(&self, button: MouseButton) {
|
||||
let msg = Msg::WindowResizeGrab {
|
||||
button: button as u32,
|
||||
};
|
||||
|
||||
send_msg(msg).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
pub struct WindowHandle(WindowId);
|
||||
|
@ -88,4 +106,22 @@ impl WindowHandle {
|
|||
fullscreen_or_maximized,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn toggle_tag(&self, tag: &TagHandle) {
|
||||
let msg = Msg::ToggleTagOnWindow {
|
||||
window_id: self.0,
|
||||
tag_id: tag.0,
|
||||
};
|
||||
|
||||
send_msg(msg).unwrap();
|
||||
}
|
||||
|
||||
pub fn move_to_tag(&self, tag: &TagHandle) {
|
||||
let msg = Msg::MoveWindowToTag {
|
||||
window_id: self.0,
|
||||
tag_id: tag.0,
|
||||
};
|
||||
|
||||
send_msg(msg).unwrap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue