[Fix] Setting correct popup window size when site requested it.

- now resizing webview to desired size, not the whole popupwindow
   * popupwindow is containg statusbar + locationbar
remotes/origin/falkon
nowrep 14 years ago
parent 7536da24e1
commit bbec6d2ca4
  1. 2
      README.md
  2. 2
      src/app/qupzilla.cpp
  3. 11
      src/popupwindow/popupwindow.cpp

@ -74,6 +74,6 @@ FAQ and Changelog
If you are experiencing some sort of problem, please read the FAQ before you open an issue. If you are experiencing some sort of problem, please read the FAQ before you open an issue.
FAQ: https://github.com/nowrep/QupZilla/blob/master/FAQ FAQ: https://github.com/nowrep/QupZilla/wiki/FAQ
Changelog: https://github.com/nowrep/QupZilla/wiki/Changelog Changelog: https://github.com/nowrep/QupZilla/wiki/Changelog

@ -550,7 +550,7 @@ void QupZilla::loadSettings()
bool showAddTab = settings.value("showAddTabButton", false).toBool(); bool showAddTab = settings.value("showAddTabButton", false).toBool();
bool makeTransparent = settings.value("useTransparentBackground", false).toBool(); bool makeTransparent = settings.value("useTransparentBackground", false).toBool();
m_sideBarWidth = settings.value("SideBarWidth", 250).toInt(); m_sideBarWidth = settings.value("SideBarWidth", 250).toInt();
m_webViewWidth = settings.value("WebViewWidth", 390).toInt(); m_webViewWidth = settings.value("WebViewWidth", 2000).toInt();
QString activeSideBar = settings.value("SideBar", "None").toString(); QString activeSideBar = settings.value("SideBar", "None").toString();
settings.endGroup(); settings.endGroup();
bool adBlockEnabled = settings.value("AdBlock/enabled", true).toBool(); bool adBlockEnabled = settings.value("AdBlock/enabled", true).toBool();

@ -65,6 +65,10 @@ PopupWindow::PopupWindow(PopupWebView* view)
} }
m_locationBar->showUrl(urlToShow); m_locationBar->showUrl(urlToShow);
// Ensuring correct sizes for widgets in layout are calculated even
// before calling QWidget::show()
m_layout->activate();
} }
void PopupWindow::showNotification(QWidget* notif) void PopupWindow::showNotification(QWidget* notif)
@ -94,7 +98,12 @@ void PopupWindow::setWindowGeometry(const QRect &newRect)
{ {
if (newRect.isValid()) { if (newRect.isValid()) {
QRect oldRect = rect(); QRect oldRect = rect();
setGeometry(newRect); move(newRect.topLeft());
QSize newSize = newRect.size();
int additionalHeight = height() - m_view->height();
newSize.setHeight(newSize.height() + additionalHeight);
resize(newSize);
if (newRect.topLeft() == QPoint(0, 0) && oldRect.topLeft() == QPoint(0, 0)) { if (newRect.topLeft() == QPoint(0, 0) && oldRect.topLeft() == QPoint(0, 0)) {
qz_centerWidgetOnScreen(this); qz_centerWidgetOnScreen(this);

Loading…
Cancel
Save