Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizeable Window #10

Closed
iceener opened this issue Aug 26, 2023 · 1 comment
Closed

Resizeable Window #10

iceener opened this issue Aug 26, 2023 · 1 comment
Labels

Comments

@iceener
Copy link

iceener commented Aug 26, 2023

Hey! 👋

I need to make this window resizable, but whenever I try to do it, the window stops appearing on top of fullscreen apps.

Do you have any ideas how to implement this?

Solved, I guess. The solution below seems to work.

  1. Extend RawNSPanel with this method:
fn set_resizable(&self) {
    let current_style_mask: NSWindowStyleMask = unsafe { msg_send![self, styleMask] };
    let new_style_mask = current_style_mask | NSWindowStyleMask::NSWindowStyleMaskResizable;
    self.set_style_mask(new_style_mask.bits() as i32);
}
  1. Update init method
#[tauri::command]
pub fn init_spotlight_window(app_handle: AppHandle<Wry>, window: Window<Wry>) {
    INIT.call_once(|| {
        let panel = create_spotlight_panel(&window);
        set_state!(app_handle, panel, Some(create_spotlight_panel(&window)));
        panel.set_resizable();
        register_shortcut(app_handle);
    });
}
@ahkohd
Copy link
Owner

ahkohd commented Sep 10, 2023

Cool, glad you solved it yourself!

@ahkohd ahkohd closed this as completed Sep 10, 2023
@ahkohd ahkohd added the example label Sep 10, 2023
@ahkohd ahkohd pinned this issue Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants