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

[Feature Request] Resizable child windows #419

Open
Arcnor opened this issue Jul 12, 2024 · 14 comments
Open

[Feature Request] Resizable child windows #419

Arcnor opened this issue Jul 12, 2024 · 14 comments
Assignees

Comments

@Arcnor
Copy link

Arcnor commented Jul 12, 2024

Currently child windows cannot be resized, only moved and/or closed. My assumption is that a resizeable "trait" (sorry if that's not the right term!) can be added, similar to the moveable one.

@djowel
Copy link
Member

djowel commented Jul 12, 2024

My assumption is that a resizeable "trait" (sorry if that's not the right term!) can be added, similar to the moveable one.

Yes, that is correct.

@djowel djowel self-assigned this Jul 12, 2024
@djowel
Copy link
Member

djowel commented Jul 12, 2024

I'm working on this.

@djowel
Copy link
Member

djowel commented Jul 13, 2024

Ah, then minimize/maximize have to be added.

@djowel
Copy link
Member

djowel commented Jul 13, 2024

Implemented now in master and skia_2024 branches.

@djowel djowel closed this as completed Jul 13, 2024
@Arcnor
Copy link
Author

Arcnor commented Jul 13, 2024

I've finally tested this, seems to work mostly ok, although (and talking about the "Child Windows" example) depending on how far into the window the mouse cursor is, it either resizes the window or triggers the scrollbar behavior (when talking about the bottom/right areas) / moves the window (when talking about the top area), but the mouse cursor is still the resize one.

There is probably a difference between the area that triggers the cursor change and the area that actually effects the resizing behavior.

@djowel
Copy link
Member

djowel commented Jul 13, 2024

I've finally tested this, seems to work mostly ok, although (and talking about the "Child Windows" example) depending on how far into the window the mouse cursor is, it either resizes the window or triggers the scrollbar behavior (when talking about the bottom/right areas) / moves the window (when talking about the top area), but the mouse cursor is still the resize one.

There is probably a difference between the area that triggers the cursor change and the area that actually effects the resizing behavior.

Right! Good observation. The active areas overlap. What I should do is move the resize area outside the scroll bar's active area. I'll see what I can do!

@djowel
Copy link
Member

djowel commented Jul 13, 2024

Try it now. master and skia_2024

@djowel
Copy link
Member

djowel commented Jul 14, 2024

Need more cursors. I added two cursors for the corner sizing (north-to-east and south-to-west) for the Mac, example:

Screenshot 2024-07-14 at 1 24 07 PM

I also fixed the correct "sizing" cursors on the Mac.

If you can add the switches for setting these new cursors for GTK and Windows, that would be great. If not, I'll have this open and get back to it later. See:

void set_cursor(cursor_type type)

in base_view.cpp

@djowel djowel reopened this Jul 14, 2024
@Arcnor
Copy link
Author

Arcnor commented Jul 14, 2024

Awesome. I actually noticed that corners were missing as well, but didn't want to bother you anymore 🙂.

I'll check and test Windows corner cursors (it's IDC_SIZENWSE and IDC_SIZENESW there), will also check GTK docs but not sure I'll be able to test the implementation, will let you know.

@Arcnor
Copy link
Author

Arcnor commented Jul 14, 2024

So I've implemented and tested Windows, the corner cursor seems to need a bit of tinkering. The area in which the cursor appear seems to be very small, and also the cursor can go from "h cursor" -> "diagonal cursor" -> "h cursor" (for example) when slowly panning the cursor from the right side of the window until you get to the corner. Same with the "v cursor".

As for GTK3 I'm having a bit of a hard time finding the diagonal cursor. I see there should be one on this image (although this might be GTK2?):

However, I can't find any diagonal cursors on the docs: https://docs.gtk.org/gdk3/enum.CursorType.html

@djowel
Copy link
Member

djowel commented Jul 14, 2024

So I've implemented and tested Windows, the corner cursor seems to need a bit of tinkering. The area in which the cursor appear seems to be very small, and also the cursor can go from "h cursor" -> "diagonal cursor" -> "h cursor" (for example) when slowly panning the cursor from the right side of the window until you get to the corner. Same with the "v cursor".

For sure. Right now the margin is just 5px. You are welcome to make some adjustments.

@djowel
Copy link
Member

djowel commented Jul 15, 2024

Did some refactoring and renames.

@djowel
Copy link
Member

djowel commented Jul 18, 2024

I'm going to move this to a feature branch (resizable_window and resizable_window_skia) until it is complete.

@djowel
Copy link
Member

djowel commented Jul 18, 2024

Done. This is moved to the resizable_window and resizable_window_skia branches now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants