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

Problems interacting with examples\custom_window_frame #3669

Closed
rustbasic opened this issue Dec 1, 2023 · 1 comment · Fixed by #3833
Closed

Problems interacting with examples\custom_window_frame #3669

rustbasic opened this issue Dec 1, 2023 · 1 comment · Fixed by #3833
Labels
bug Something is broken help wanted Extra attention is needed native-windows Running on native Windows OS rerun Desired for Rerun.io

Comments

@rustbasic
Copy link
Contributor

rustbasic commented Dec 1, 2023

Subject: "examples\custom_window_frame" issue

Dear emilk,

I'm re-raising the issue regarding the "examples\custom_window_frame" that I posted earlier,
as it has not been addressed in v0.24.1.
Even if double_clicked() is not working, clicked() should still function.

After running "examples\custom_window_frame",
when double-clicking on the title bar, the window does not maximize.
The dragging functionality works well when the title bar is clicked and held.

    if title_bar_response.double_clicked() {
        let is_maximized = ui.input(|i| i.viewport().maximized.unwrap_or(false));
        ui.ctx()
            .send_viewport_cmd(ViewportCommand::Maximized(!is_maximized));
    }
    else if title_bar_response.is_pointer_button_down_on() {
        ui.ctx().send_viewport_cmd(ViewportCommand::StartDrag);
    }

In "examples\custom_window_frame," checking only for double_clicked() as follows is fine (no problem) :

    if title_bar_response.double_clicked() {
        let is_maximized = ui.input(|i| i.viewport().maximized.unwrap_or(false));
        ui.ctx()
            .send_viewport_cmd(ViewportCommand::Maximized(!is_maximized));
    }
/*
    else if title_bar_response.is_pointer_button_down_on() {
        ui.ctx().send_viewport_cmd(ViewportCommand::StartDrag);
    }
*/

In "examples\custom_window_frame," even when double_clicked() is changed to clicked(),
if there is else if title_bar_response.is_pointer_button_down_on(), clicked() does not work.

    if title_bar_response.clicked() {
        let is_maximized = ui.input(|i| i.viewport().maximized.unwrap_or(false));
        ui.ctx()
            .send_viewport_cmd(ViewportCommand::Maximized(!is_maximized));
    }
    else if title_bar_response.is_pointer_button_down_on() {
        ui.ctx().send_viewport_cmd(ViewportCommand::StartDrag);
    }

Thanks, emilk.

Library: egui v0.24.0, egui v0.24.1
OS: Windows 10

@rustbasic rustbasic added the bug Something is broken label Dec 1, 2023
@emilk emilk added help wanted Extra attention is needed native-windows Running on native Windows OS labels Dec 4, 2023
@emilk emilk added the rerun Desired for Rerun.io label Dec 28, 2023
@emilk emilk changed the title "examples\custom_window_frame" issue Problems interacting with examples\custom_window_frame Dec 28, 2023
@dbuch
Copy link
Contributor

dbuch commented Dec 31, 2023

I tested abit here. StartDrag takes precedence for sure. The caveat is that I'm able to get a is_double_clicked() = true with touch event. I'm digging deeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken help wanted Extra attention is needed native-windows Running on native Windows OS rerun Desired for Rerun.io
Projects
None yet
3 participants