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] Questions about the main window #525

Closed
caitou2019 opened this issue Jun 26, 2022 · 8 comments
Closed

[Feature Request] Questions about the main window #525

caitou2019 opened this issue Jun 26, 2022 · 8 comments
Labels
enhancement New feature or request

Comments

@caitou2019
Copy link

Related problem

I set the main window to be borderless (actually I don't want the main window).
Then I want to press and hold the "good" imgui window to drag.
At present, I can't drag.
image

This is my code and effect:
image

image
English annotation text of effect picture "I want to press and hold here to drag the window anywhere on the screen"

Thanks your help!!

Your request

1.Hide main window(Maybe that can replace it with no border)
2.Full screen drag and drop for sub windows

Alternative solution

It may be possible to move the main window by getting the drag message of the child window and passing it to the main window.

Additional context

package imgui

import (
"fmt"
g "github.com/AllenDang/giu"
"image/color"
)

var wnd *g.MasterWindow

func Load() {
flag := g.MasterWindowFlagsTransparent | g.MasterWindowFlagsNotResizable | g.MasterWindowFlagsFloating | g.MasterWindowFlagsFrameless
wnd = g.NewMasterWindow("Hello world", 400, 200, flag)
wnd.SetBgColor(color.RGBA{})
wnd.SetPos(800, 200)
wnd.Run(loop)
}

func loop() {
flag := g.WindowFlagsNoResize | g.WindowFlagsNoMove | g.WindowFlagsAlwaysUseWindowPadding | g.WindowFlagsAlwaysAutoResize
g.Window("good").Flags(flag).Size(400, 200).Layout(
g.Label("Hello world from giu"),
g.Row(
g.Button("Click Me").OnClick(onClickMe),
g.Button("I'm so cute").OnClick(onImSoCute),
),
)

}

func onClickMe() {
fmt.Println("Hello world!")
}

func onImSoCute() {
fmt.Println("Im sooooooo cute!!")
}

@caitou2019 caitou2019 added the enhancement New feature or request label Jun 26, 2022
@caitou2019 caitou2019 changed the title [Feature Request] [Feature Request] Questions about the main window Jun 27, 2022
@gucio321
Copy link
Collaborator

gucio321 commented Jun 27, 2022

Take a look on examples/transparent. It probably does most things your looking for

@caitou2019
Copy link
Author

I looked at examples/transparent. The effect is very similar, but the child window cannot move out of the range of the main window. What I want is that the child window will not be limited by the range of the parent window.

this is official C++ examples, githua branch is docking. The effect I want is this.
The effect is shown in the following figure:
image

@gucio321
Copy link
Collaborator

Well i don't exactly know what docking branch is but as far as i remember implementing this stuff is one of the issues @AllenDang is going to face with at first. If the feature you want is available only on the docking branch of imgui it isn't probably implemented in giu yet

@caitou2019
Copy link
Author

ok, thank u, i will wait for your integration.

@gucio321
Copy link
Collaborator

As far as i can see it is a duplicate of #512

@gucio321
Copy link
Collaborator

I just got an idea:
How about making a master window full screened, transparent and decorationless, than just add a normal giu.Window?

@MPWrobel
Copy link

I just got an idea: How about making a master window full screened, transparent and decorationless, than just add a normal giu.Window?

Then we need mouse passthrough I think. Otherwise otherwise you won't be able to interact with anything outside the app

@gucio321
Copy link
Collaborator

gucio321 commented May 9, 2023

ok, I'm going to close this as duplicate of our Docking issue #512
In case of " mouse passthrough" see #559 (I think it is the same feature)

@gucio321 gucio321 closed this as completed May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants