Skip to content

Commit

Permalink
Linter linter linter LINTER >_<
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbrigato committed Jan 12, 2025
1 parent 8df2c15 commit 24fbb28
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/transparent/transparent.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var (
isMovingFrame = false
)

func FramelessMovableWidget(widget g.Widget) *g.CustomWidget {
func framelessMovableWidget(widget g.Widget) *g.CustomWidget {
return g.Custom(func() {
if isMovingFrame && !g.IsMouseDown(g.MouseButtonLeft) {
isMovingFrame = false
Expand All @@ -34,6 +34,7 @@ func FramelessMovableWidget(widget g.Widget) *g.CustomWidget {
delta := imgui.CurrentIO().MouseDelta()
dx := int(delta.X)
dy := int(delta.Y)

if dx != 0 || dy != 0 {
ox, oy := wnd.GetPos()
wnd.SetPos(ox+dx, oy+dy)
Expand All @@ -47,7 +48,7 @@ func loop() {
g.PushColorWindowBg(color.RGBA{50, 50, 70, 130})
g.PushColorFrameBg(color.RGBA{30, 30, 60, 110})
g.SingleWindow().Layout(
FramelessMovableWidget(
framelessMovableWidget(
g.Label("Maintain Left-click on me to move the frameless window !"),
),
g.Custom(func() {
Expand Down

0 comments on commit 24fbb28

Please sign in to comment.