Skip to content

Commit 91f75b3

Browse files
committed
"fixed" window titles clipping
1 parent 5010951 commit 91f75b3

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package com.lambda.gui.components
1919

20-
import com.lambda.Lambda.LOG
2120
import com.lambda.Lambda.mc
2221
import com.lambda.config.Configurable
2322
import com.lambda.config.configurations.GuiConfig
@@ -41,10 +40,8 @@ import com.lambda.util.KeyCode
4140
import com.lambda.util.NamedEnum
4241
import com.lambda.util.WindowUtils.setLambdaWindowIcon
4342
import imgui.ImGui
44-
import imgui.ImVec2
4543
import imgui.extension.implot.ImPlot
4644
import imgui.flag.ImGuiCol
47-
import imgui.flag.ImGuiCond
4845
import imgui.flag.ImGuiHoveredFlags
4946
import imgui.flag.ImGuiWindowFlags
5047
import net.minecraft.SharedConstants
@@ -203,8 +200,6 @@ object ClickGuiLayout : Loadable, Configurable(GuiConfig) {
203200
val navWindowingDimBg by setting("Nav Windowing Dim Background", Color(204, 204, 204, 51)).group(Group.Colors)
204201
val modalWindowDimBg by setting("Modal Window Dim Background", Color(20, 20, 20, 89)).group(Group.Colors)
205202

206-
var firstRender = true
207-
208203
init {
209204
listen<GuiEvent.NewFrame> {
210205
if (!open) return@listen
@@ -225,7 +220,12 @@ object ClickGuiLayout : Loadable, Configurable(GuiConfig) {
225220
// for this use case so for the time being we will leave the positions fixed. Too bad!
226221
ImGui.setNextWindowPos(nextX, baseY)
227222

228-
window(tag.name, flags = ImGuiWindowFlags.AlwaysAutoResize) {
223+
// FixMe:
224+
// Due to the auto resize of windows, if a tag has no module names that is at least the
225+
// same length as the tag name, the title of the window will clip out the window box.
226+
// For the time being I have removed the ability to collapse the windows so the titles
227+
// have more space lol.
228+
window(tag.name, flags = ImGuiWindowFlags.AlwaysAutoResize or ImGuiWindowFlags.NoCollapse) {
229229
ModuleRegistry.modules
230230
.filter { it.tag == tag }
231231
.forEach { with(ModuleEntry(it)) { buildLayout() } }
@@ -240,8 +240,6 @@ object ClickGuiLayout : Loadable, Configurable(GuiConfig) {
240240
ImGui.showDemoWindow()
241241
ImPlot.showDemoWindow()
242242
}
243-
244-
firstRender = false
245243
}
246244
}
247245

0 commit comments

Comments
 (0)