From 551498fa060082e08c69a6f889bd753d45c9d45d Mon Sep 17 00:00:00 2001 From: "S. Razi Alavizadeh" Date: Tue, 21 Aug 2012 00:10:38 +0430 Subject: [PATCH 1/4] Fixed visibility of navigationbar when app. is fullscreen. --- src/lib/webview/tabbedwebview.cpp | 3 ++- src/lib/webview/tabbedwebview.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/webview/tabbedwebview.cpp b/src/lib/webview/tabbedwebview.cpp index e897ae567..1e0cb4b78 100644 --- a/src/lib/webview/tabbedwebview.cpp +++ b/src/lib/webview/tabbedwebview.cpp @@ -36,6 +36,8 @@ #include #include +bool TabbedWebView::m_navigationVisible = false; + TabbedWebView::TabbedWebView(QupZilla* mainClass, WebTab* webTab) : WebView(webTab) , p_QupZilla(mainClass) @@ -43,7 +45,6 @@ TabbedWebView::TabbedWebView(QupZilla* mainClass, WebTab* webTab) , m_webTab(webTab) , m_menu(new Menu(this)) , m_mouseTrack(false) - , m_navigationVisible(false) , m_hasRss(false) , m_rssChecked(false) { diff --git a/src/lib/webview/tabbedwebview.h b/src/lib/webview/tabbedwebview.h index 250605160..53a15be8f 100644 --- a/src/lib/webview/tabbedwebview.h +++ b/src/lib/webview/tabbedwebview.h @@ -98,7 +98,7 @@ private: Menu* m_menu; bool m_mouseTrack; - bool m_navigationVisible; + static bool m_navigationVisible; bool m_hasRss; bool m_rssChecked; From 07e17f7b475c47c7e37ea6129f9984b9a177830e Mon Sep 17 00:00:00 2001 From: "S. Razi Alavizadeh" Date: Tue, 21 Aug 2012 00:14:29 +0430 Subject: [PATCH 2/4] In Windows transparent background must be disabled when app. is fullscreen. --- src/lib/app/qupzilla.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index 5fd9c6ab9..994c8b75d 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -1454,6 +1454,11 @@ void QupZilla::fullScreen(bool make) bookmarksToolbar()->hide(); m_navigationBar->hide(); m_tabWidget->getTabBar()->hide(); +#ifdef Q_WS_WIN + if (m_usingTransparentBackground) { + QtWin::enableBlurBehindWindow(this, false); + } +#endif } else { setWindowState(windowState() & ~Qt::WindowFullScreen); @@ -1463,6 +1468,11 @@ void QupZilla::fullScreen(bool make) m_bookmarksToolbar->setVisible(m_bookmarksToolBarVisible); m_navigationBar->setVisible(m_navigationVisible); m_tabWidget->showTabBar(); +#ifdef Q_WS_WIN + if (m_usingTransparentBackground) { + QtWin::enableBlurBehindWindow(this); + } +#endif } m_actionShowFullScreen->setChecked(make); From dbcbabdec30feb3efc4b1d73e60504ce5638747d Mon Sep 17 00:00:00 2001 From: "S. Razi Alavizadeh" Date: Tue, 21 Aug 2012 00:17:43 +0430 Subject: [PATCH 3/4] Fixed 'QtWin' bug about changing of desktop composition state. --- src/lib/3rdparty/qtwin.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/3rdparty/qtwin.cpp b/src/lib/3rdparty/qtwin.cpp index 9705ea419..b2bf2606f 100644 --- a/src/lib/3rdparty/qtwin.cpp +++ b/src/lib/3rdparty/qtwin.cpp @@ -65,6 +65,7 @@ static PtrDwmEnableBlurBehindWindow pDwmEnableBlurBehindWindow = 0; static PtrDwmExtendFrameIntoClientArea pDwmExtendFrameIntoClientArea = 0; static PtrDwmGetColorizationColor pDwmGetColorizationColor = 0; +QHash widgetsBlurState = QHash(); /* * Internal helper class that notifies windows if the @@ -169,6 +170,7 @@ bool QtWin::enableBlurBehindWindow(QWidget* widget, bool enable) if (SUCCEEDED(hr)) { result = true; windowNotifier()->addWidget(widget); + widgetsBlurState.insert(widget, true); } } #endif @@ -207,6 +209,7 @@ bool QtWin::extendFrameIntoClientArea(QWidget* widget, int left, int top, int ri if (SUCCEEDED(hr)) { result = true; windowNotifier()->addWidget(widget); + widgetsBlurState.insert(widget, true); } widget->setAttribute(Qt::WA_TranslucentBackground, result); } @@ -257,6 +260,13 @@ bool WindowNotifier::winEvent(MSG* message, long* result) foreach(QWidget * widget, widgets) { if (widget) { widget->setAttribute(Qt::WA_NoSystemBackground, compositionEnabled); + bool isBlur = widgetsBlurState.value(widget, false); + if (compositionEnabled && isBlur) + { + // hack for fixing black background when enabling composition + QtWin::enableBlurBehindWindow(widget, false); + QtWin::extendFrameIntoClientArea(widget); + } widget->update(); } } From 1df223fbd1fef68e1e95fa592694cd3170268a09 Mon Sep 17 00:00:00 2001 From: "S. Razi Alavizadeh" Date: Tue, 21 Aug 2012 00:20:31 +0430 Subject: [PATCH 4/4] Fixed problem about location of 'm_buttonAddTab' when there are lots of tabs opened. --- src/lib/webview/tabwidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/webview/tabwidget.cpp b/src/lib/webview/tabwidget.cpp index 1f7b3a118..bf5ed4b7d 100644 --- a/src/lib/webview/tabwidget.cpp +++ b/src/lib/webview/tabwidget.cpp @@ -202,7 +202,10 @@ void TabWidget::moveAddTabButton(int posX) int posY = (m_tabBar->height() - m_buttonAddTab->height()) / 2; //RTL Support if (QApplication::layoutDirection() == Qt::RightToLeft) { - posX = posX - m_buttonAddTab->width(); + posX = qMax(posX - m_buttonAddTab->width(), m_buttonListTabs->width()); + } + else { + posX = qMin(posX, m_tabBar->width() - m_buttonAddTab->width() - m_buttonListTabs->width()); } m_buttonAddTab->move(posX, posY); }