From 4137a7ef798602d985fc094113b49b28706ef7f8 Mon Sep 17 00:00:00 2001 From: "Colin J. Brigato" Date: Mon, 30 Sep 2024 18:31:57 +0200 Subject: [PATCH] add brush size setting in toolbar --- examples/paint/toolbar.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/paint/toolbar.go b/examples/paint/toolbar.go index c92fda59..c9f4dc5b 100644 --- a/examples/paint/toolbar.go +++ b/examples/paint/toolbar.go @@ -161,8 +161,13 @@ func ButtonColorMaker() *g.RowWidget { imgui.ImageButton("##open_tool", openButtonImg.Texture().ID(), sz.Mul(1.7)) imgui.SameLine() imgui.ImageButton("##save_tool", saveButtonImg.Texture().ID(), sz.Mul(1.7)) + if imgui.ImageButton("##brush_tool", brushButtonImg.Texture().ID(), sz.Mul(0.9)) { + brush_size = 12.0 + } imgui.SameLine() - imgui.ImageButton("##brush_tool", brushButtonImg.Texture().ID(), sz.Mul(1.7)) + imgui.PushItemWidth(225.0) + imgui.SliderFloat("##Brush Size", &brush_size, float32(0.1), float32(72.0)) + imgui.PopItemWidth() imgui.SetCursorPos(start_ul) for i := range defaultColors { if i%2 != 0 {