Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Floating Button Bug #47

Open
echostorm opened this issue May 25, 2018 · 8 comments
Open

Floating Button Bug #47

echostorm opened this issue May 25, 2018 · 8 comments
Assignees

Comments

@echostorm
Copy link
Contributor

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!

@Feldrise
Copy link
Member

Thanks for the report, @Faymoon will have a look to this 😉.

@echostorm
Copy link
Contributor Author

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...

@Faymoon
Copy link
Contributor

Faymoon commented May 25, 2018

I will try to fix that bug 😉

@echostorm
Copy link
Contributor Author

echostorm commented May 25, 2018

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 😄

@Faymoon
Copy link
Contributor

Faymoon commented May 25, 2018

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()));

@echostorm
Copy link
Contributor Author

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 👍

@echostorm
Copy link
Contributor Author

yup works perfect now

@echostorm
Copy link
Contributor Author

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()));

@echostorm echostorm reopened this Jun 15, 2018
@Faymoon Faymoon removed the Fixed label Jun 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants