Geyser:show only unhidden children#3336
Conversation
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
|
@Edru2 can you provide a way to replicate the original problem / see what your fix does? Based on your description I've made the following: function makestuff()
testlabel = Geyser.Label:new({
name = "testlabel",
x = "25%", y = "25%",
width = "50%", height = "50%",
fgColor = "black",
message = "<center>heey</center>"
})
testlabel:setColor(0,255,0,150)
testlabel2 = Geyser.Label:new({
name = "testlabel2",
x = "25%", y = "25%",
width = "50%", height = "50%",
fgColor = "black",
message = "<center>heey</center>"
}, testlabel2)
testlabel2:hide()
testlabel:show()
endAt the end however only testlabel is showing, not testlabel2 as you say it would - using latest Mudlet. |
You accidentally set testlabel2 as the parent for itself(actually, I think nil because it isn't defined yet when it's run), I think this is saying testlabel2 will show is testlabel is the parent. |
|
Good find - though it still works as expected with: function makestuff()
testlabel = Geyser.Label:new({
name = "testlabel",
x = "25%", y = "25%",
width = "50%", height = "50%",
fgColor = "black",
message = "<center>heey</center>"
})
testlabel:setColor(0,255,0,150)
testlabel2 = Geyser.Label:new({
name = "testlabel2",
x = "25%", y = "25%",
width = "50%", height = "50%",
fgColor = "black",
message = "<center>heey</center>"
}, testlabel)
testlabel2:hide()
testlabel:show()
end |
|
ahh, indeed. Just tested it myself and it seems to be working as expected. |
|
I just noticed that it mostly only happens to Geyser.Gauges. But in some cases it happened to me also for Labels but I don't know how to reproduce it. testcont = testcont or Geyser.Container:new({x=50,y=50,width=500,height=500})
testlabel = testlabel or Geyser.Label:new({x=0,y=0,width=20,height=20,color = "green",fontSize=8},testcont)
testlabel2 = testlabel2 or Geyser.Label:new({x=20,y=0,width=20,height=20,color = "red"},testcont)
testlabel3 = testlabel3 or Geyser.Label:new({x=40,y=0,width=20,height=20,color="yellow"},testcont)
testgauge = testgauge or Geyser.Gauge:new({x=40,y=40,width=200,height=20,color="yellow"},testcont)
testgauge:hide()
testcont:show()
--still shows the testgaugeEdit: testcont = testcont or Geyser.Container:new({x=50,y=50,width=500,height=500})
testlabel = testlabel or Geyser.Label:new({x=0,y=0,width=30,height=30,color = "green",fontSize=8},testcont)
testinslabel = testinslabel or Geyser.Label:new({x=0,y=0,width=20,height=20,color = "red"},testlabel)
testlabel2 = testlabel2 or Geyser.Label:new({x=40,y=0,width=20,height=20,color="yellow"},testcont)
testgauge = testgauge or Geyser.Gauge:new({x=40,y=40,width=200,height=20,color="yellow"},testcont)
testgauge:hide()
testlabel:hide()
testcont:show()
-- gauge and inside Label (red) are still shown |
|
Some issue with this PR:
|
|
Just built with this pull request included, does not appear to have broken anything with my UI as far as I can tell. My build is based on git clone of: https://github.com/Mudlet/Mudlet.git So I just: |
|
Yes this PR has issues just found out myself. testcont = testcont or Geyser.Container:new({x=50,y=50,width=500,height=500})
testlabel = testlabel or Geyser.Label:new({x=0,y=0,width=30,height=30,color = "green",fontSize=8},testcont)
testlabel:hide()
testcont:hide()
testcont:show()
testlabel:show()
--label doesn't show anymore because auto_hide is still onSorry should have tested more :( |
It should work now as expected. Testing needed.
|
Should work now as expected. |
|
Awesome! @Xekon mind retesting? |
|
Installed the latest version. The problem I was seeing (after hiding then redisplaying a window) is no longer occuring for me. |
Brief overview of PR changes/additions
When using container:show() hidden elements also will appear.
With this change the elements which have the property hidden will stay hidden.
Motivation for adding to Mudlet
Especially when using the GUIFrame with anitimer or other elements which use hide()
it can cause a mess to show everything. The problem appeared on Discord
for example:
Brax Last Sunday at 10:12
I am playing with anitimers in the drag and drop framework, if I drag a container all the 'dead' timers reappear ? What am I doing wrong hehe
Other info (issues closed, discussion etc)