sielo-legacy
sielo-legacy copied to clipboard
Floating Button Bug
on the windows 7 64bit Sielo version 1.14.00b if you place the floating button at exact edge of browser window example: at bottom left then resize window the button disappears and can no longer be found again even when you resize window multiple times!
Thanks for the report, @Faymoon will have a look to this :wink:.
just one more thing I noticed even if floating button is not near the edges of the window just minimizing and maximizing the windows 3 or more times also causes it to disappear maybe you should also change the relativePos.x and relativePos.y to take account the current browser window size...
I will try to fix that bug 😉
in browserwindow.cpp: void BrowserWindow::resizeEvent(QResizeEvent* event) { if (m_fButton) { if (m_fButton->pattern() != RootFloatingButton::Pattern::Floating) m_fButton->tabWidgetChanged(tabWidget()); else { m_fButton->move(event->size().width() / 4), event->size().height() / 4); } ^ so to keep it in top area where I want.
im using this for now as temporary way to make it always show up within browser window also even when resizing it stays near the area I want so ill stick with this until you do a better fix :smile:
I don't know if it's the behaviour that you expect but i replace the code in the else by :
m_fButton->move(std::min(m_fButton->x(), event->size().width() + m_fButton->width()), std::min(m_fButton->y(), event->size().height() + m_fButton->height()));
I did try something else which is the behavior I want: m_fButton->move(m_fButton->x() - (event->size().width() / event->oldSize().width()), m_fButton->y() - (event->size().height() / event->oldSize().height()));
for me this works perfect but ill try your way too thanks :+1:
yup works perfect now
after further testing it seems the bug wasnt solved reason: when floating button is close to the very end of bottom right corner resizing the window makes it disappear behind window bounds so it becomes invisible!
I did find a solution that I tried but isnt working very well sometimes it keeps the button in correct position and other times its sort of behind the window area but always will somehow come back to view at least if you keep resizing back and forth not a very smooth solution :(
I also asked for help on stackoverflow: https://stackoverflow.com/questions/50869151/keeping-a-floating-button-in-place-relative-to-window-and-within-window-bounds-u
The code i tried this time:
else {
if (m_fButton->x() > event->size().width())
{
m_fButton->move((event->size().width() + m_fButton->width()), (m_fButton->y()));
}
if (m_fButton->y() > event->size().height())
{
m_fButton->move((m_fButton->x()), (event->size().height() - m_fButton->height()));
}
m_fButton->move(std::min(m_fButton->x(), event->size().width() + m_fButton->width()),
std::min(m_fButton->y(), event->size().height() + m_fButton->height()));