giu icon indicating copy to clipboard operation
giu copied to clipboard

[Feature Request] Questions about the main window

Open caitou2019 opened this issue 2 years ago • 7 comments

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 avatar Jun 26 '22 16:06 caitou2019

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

gucio321 avatar Jun 27 '22 16:06 gucio321

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

caitou2019 avatar Jun 29 '22 03:06 caitou2019

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

gucio321 avatar Jun 29 '22 04:06 gucio321

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

caitou2019 avatar Jun 30 '22 01:06 caitou2019

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

gucio321 avatar Jun 30 '22 06:06 gucio321

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

gucio321 avatar Jul 22 '22 07:07 gucio321

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

MPWrobel avatar Aug 10 '22 20:08 MPWrobel

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 avatar May 09 '23 19:05 gucio321