1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Fixed a visual bug of TabBar on gnome after viewing a flash video

This commit is contained in:
nowrep 2011-07-19 15:18:49 +02:00
parent ff4314db25
commit 4c325ed108
6 changed files with 33 additions and 34 deletions

View File

@ -60,7 +60,7 @@ ClickToFlash::ClickToFlash(const QUrl &pluginUrl, const QStringList &argumentNam
frame->setStyleSheet("QFrame { border: 1px solid #e8e8e8; }"); frame->setStyleSheet("QFrame { border: 1px solid #e8e8e8; }");
frame->setContentsMargins(0,0,0,0); frame->setContentsMargins(0,0,0,0);
horizontalLayout_2 = new QHBoxLayout(frame); horizontalLayout_2 = new QHBoxLayout(frame);
toolButton = new QToolButton(frame); toolButton = new QToolButton(this);
//AdBlock //AdBlock
AdBlockManager* manager = AdBlockManager::instance(); AdBlockManager* manager = AdBlockManager::instance();

View File

@ -125,7 +125,7 @@ QSize TabBar::tabSizeHint(int index) const
return size; return size;
} }
#ifdef Q_WS_X11 #if 0
void TabBar::tabInserted(int index) void TabBar::tabInserted(int index)
{ {
// CloseButton* closeButton = new CloseButton(this); // CloseButton* closeButton = new CloseButton(this);
@ -137,35 +137,35 @@ void TabBar::tabInserted(int index)
QAbstractButton* button = (QAbstractButton*)tabButton(index, QTabBar::RightSide); QAbstractButton* button = (QAbstractButton*)tabButton(index, QTabBar::RightSide);
if (!button) if (!button)
return; return;
button->setMaximumSize(17,17); button->resize(17,17);
}
void TabBar::showCloseButton(int index)
{
TabWidget* tabWidget = qobject_cast<TabWidget*>(parentWidget());
if (!tabWidget)
return;
WebTab* webTab = qobject_cast<WebTab*>(tabWidget->widget(index));
if (webTab && webTab->isPinned())
return;
CloseButton* button = (CloseButton*)tabButton(index, QTabBar::RightSide);
if (!button)
return;
button->show();
}
void TabBar::hideCloseButton(int index)
{
CloseButton* button = (CloseButton*)tabButton(index, QTabBar::RightSide);
if (!button)
return;
button->hide();
} }
#endif #endif
//void TabBar::showCloseButton(int index)
//{
// TabWidget* tabWidget = qobject_cast<TabWidget*>(parentWidget());
// if (!tabWidget)
// return;
// WebTab* webTab = qobject_cast<WebTab*>(tabWidget->widget(index));
// if (webTab && webTab->isPinned())
// return;
// CloseButton* button = (CloseButton*)tabButton(index, QTabBar::RightSide);
// if (!button)
// return;
// button->show();
//}
//void TabBar::hideCloseButton(int index)
//{
// CloseButton* button = (CloseButton*)tabButton(index, QTabBar::RightSide);
// if (!button)
// return;
// button->hide();
//}
void TabBar::updateCloseButton(int index) void TabBar::updateCloseButton(int index)
{ {
QAbstractButton* button = (QAbstractButton*)tabButton(index, QTabBar::RightSide); QAbstractButton* button = (QAbstractButton*)tabButton(index, QTabBar::RightSide);

View File

@ -67,9 +67,7 @@ private slots:
private: private:
void mouseDoubleClickEvent(QMouseEvent* event); void mouseDoubleClickEvent(QMouseEvent* event);
QSize tabSizeHint(int index) const; QSize tabSizeHint(int index) const;
#ifdef Q_WS_X11 // void tabInserted(int index);
void tabInserted(int index);
#endif
QupZilla* p_QupZilla; QupZilla* p_QupZilla;
bool m_showCloseButtonWithOneTab; bool m_showCloseButtonWithOneTab;

View File

@ -106,7 +106,7 @@ TabWidget::TabWidget(QupZilla* mainClass, QWidget* parent) :
m_tabBar = new TabBar(p_QupZilla); m_tabBar = new TabBar(p_QupZilla);
setTabBar(m_tabBar); setTabBar(m_tabBar);
setObjectName("tabWidget"); setObjectName("tabWidget");
setStyleSheet("QTabBar::tab{ max-width:250px; }"); setStyleSheet("QTabBar::tab{ max-width:250px; max-height: 28px; }");
connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
connect(this, SIGNAL(currentChanged(int)), p_QupZilla, SLOT(refreshHistory())); connect(this, SIGNAL(currentChanged(int)), p_QupZilla, SLOT(refreshHistory()));

View File

@ -30,12 +30,13 @@ WebTab::WebTab(QupZilla* mainClass, LocationBar* locationBar)
,m_pinned(false) ,m_pinned(false)
{ {
m_layout = new QVBoxLayout(this); m_layout = new QVBoxLayout(this);
setLayout(m_layout);
m_layout->setContentsMargins(0,0,0,0); m_layout->setContentsMargins(0,0,0,0);
m_layout->setSpacing(0); m_layout->setSpacing(0);
m_view = new WebView(p_QupZilla, this); m_view = new WebView(p_QupZilla, this);
m_layout->addWidget(m_view); m_layout->addWidget(m_view);
setLayout(m_layout);
setAutoFillBackground(true); // We don't want this transparent setAutoFillBackground(true); // We don't want this transparent
connect(m_view, SIGNAL(showNotification(QWidget*)), this, SLOT(showNotification(QWidget*))); connect(m_view, SIGNAL(showNotification(QWidget*)), this, SLOT(showNotification(QWidget*)));

View File

@ -35,7 +35,7 @@
#include "progressbar.h" #include "progressbar.h"
WebView::WebView(QupZilla* mainClass, WebTab* webTab) WebView::WebView(QupZilla* mainClass, WebTab* webTab)
: QWebView() : QWebView(webTab)
,p_QupZilla(mainClass) ,p_QupZilla(mainClass)
,m_progress(0) ,m_progress(0)
,m_isLoading(false) ,m_isLoading(false)