From 722a79aef15f592be0465b129c04352c2572c41b Mon Sep 17 00:00:00 2001 From: nowrep Date: Sat, 15 Oct 2011 16:37:32 +0200 Subject: [PATCH] Fixed loading animation sometimes stopped while page still loading + updated positioning of hovered link widget Also when adblock is disabled, the statusbar icon is now clickable. When running with different profile from command line argument, in preferences will be showed real starting profile, not active. --- README.md | 3 + src/adblock/adblockicon.cpp | 13 ++++- src/adblock/adblockicon.h | 1 + src/app/qupzilla.cpp | 20 +++---- src/app/qupzilla.h | 2 +- src/data/icons.qrc | 1 + src/data/icons/other/adblock-disabled.png | Bin 0 -> 1102 bytes src/data/icons/qupzillaupdate.png | Bin 5300 -> 902 bytes src/other/statusbarmessage.cpp | 67 +++++++++------------- src/other/statusbarmessage.h | 7 +-- src/preferences/preferences.cpp | 17 +++--- src/webview/webview.cpp | 14 +++-- 12 files changed, 71 insertions(+), 74 deletions(-) create mode 100644 src/data/icons/other/adblock-disabled.png diff --git a/README.md b/README.md index 5bf7e85ae..ea1678d96 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Compiling Before compiling, make sure you have have installed Qt (>=4.7) development libraries and you read BUILDING informations. + Then you can start compile by running this commands: $ cd src/ @@ -33,6 +34,7 @@ Then you can start compile by running this commands: $ make The executable binary can now be found in bin/ directory. + To install QupZilla, run this command: (it may be neccessary to run as root) $ make install @@ -53,4 +55,5 @@ FAQ and Changelog If you are experiencing some sort of issue, before you open an issue, please read FAQ. FAQ: https://github.com/nowrep/QupZilla/blob/master/FAQ + Changelog: https://github.com/nowrep/QupZilla/wiki/Changelog diff --git a/src/adblock/adblockicon.cpp b/src/adblock/adblockicon.cpp index 8cfef01b7..5c13d12ee 100644 --- a/src/adblock/adblockicon.cpp +++ b/src/adblock/adblockicon.cpp @@ -21,10 +21,9 @@ #include "webpage.h" AdBlockIcon::AdBlockIcon(QupZilla *mainClass, QWidget *parent) - :ClickableLabel(parent) - ,p_QupZilla(mainClass) + : ClickableLabel(parent) + , p_QupZilla(mainClass) { - setPixmap(QPixmap(":/icons/other/adblock.png")); setMaximumHeight(16); setCursor(Qt::PointingHandCursor); setToolTip(tr("AdBlock let you block any unwanted content on pages")); @@ -60,6 +59,14 @@ void AdBlockIcon::learnAboutRules() p_QupZilla->tabWidget()->addView(QUrl("http://adblockplus.org/en/filters"), tr("New tab"), TabWidget::NewSelectedTab); } +void AdBlockIcon::setEnabled(bool enabled) +{ + if (enabled) + setPixmap(QPixmap(":icons/other/adblock.png")); + else + setPixmap(QPixmap(":icons/other/adblock-disabled.png")); +} + AdBlockIcon::~AdBlockIcon() { } diff --git a/src/adblock/adblockicon.h b/src/adblock/adblockicon.h index 8256fb55c..0d719a8a8 100644 --- a/src/adblock/adblockicon.h +++ b/src/adblock/adblockicon.h @@ -34,6 +34,7 @@ public: signals: public slots: + void setEnabled(bool enabled); private slots: void showMenu(const QPoint &pos); diff --git a/src/app/qupzilla.cpp b/src/app/qupzilla.cpp index 0cf6de4c3..61ea39832 100644 --- a/src/app/qupzilla.cpp +++ b/src/app/qupzilla.cpp @@ -78,16 +78,16 @@ const QIcon QupZilla::qupzillaIcon() return i; } -QupZilla::QupZilla(bool tryRestore, QUrl startUrl) : - QMainWindow(0) - ,m_tryRestore(tryRestore) - ,m_historyMenuChanged(true) - ,m_bookmarksMenuChanged(true) - ,m_startingUrl(startUrl) - ,m_actionPrivateBrowsing(0) - ,m_webInspectorDock(0) - ,m_sideBar(0) - ,m_statusBarMessage(new StatusBarMessage(this)) +QupZilla::QupZilla(bool tryRestore, QUrl startUrl) + : QMainWindow(0) + , m_tryRestore(tryRestore) + , m_historyMenuChanged(true) + , m_bookmarksMenuChanged(true) + , m_startingUrl(startUrl) + , m_actionPrivateBrowsing(0) + , m_webInspectorDock(0) + , m_sideBar(0) + , m_statusBarMessage(new StatusBarMessage(this)) { setObjectName("mainwindow"); setAttribute(Qt::WA_DeleteOnClose); diff --git a/src/app/qupzilla.h b/src/app/qupzilla.h index e77793f2c..c34c35b10 100644 --- a/src/app/qupzilla.h +++ b/src/app/qupzilla.h @@ -223,7 +223,7 @@ private: QAction* m_actionRestoreTab; QLabel* m_privateBrowsing; - ClickableLabel* m_adblockIcon; + AdBlockIcon* m_adblockIcon; QPointer m_webInspectorDock; BookmarksToolbar* m_bookmarksToolbar; diff --git a/src/data/icons.qrc b/src/data/icons.qrc index a10015f1d..ea1b8505f 100644 --- a/src/data/icons.qrc +++ b/src/data/icons.qrc @@ -65,5 +65,6 @@ icons/exeicons/qupzilla256.png icons/menu/informations.png icons/faenza/user-bookmarks.png + icons/other/adblock-disabled.png diff --git a/src/data/icons/other/adblock-disabled.png b/src/data/icons/other/adblock-disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..cdab1a00d0a073265d19caa7c74f3ea371115c5a GIT binary patch literal 1102 zcmV-U1hM;xP)w?c=RJ4tYE-PLPOLNmnMg@ z(kP`3ZcuH38_3 z*P>pp%dW1jjlsdepi^s}2DD7NnSCMi!I9?)5~97%y1`B*6R6dyUjVq#sTG|Ih5PqE zF-&9X(WA$(Z41l{B7$L>(994-P*NhB&4LX2d|+U3QV78+6>1xi^KthZ`FkI+aR^ zy6+>IOv3m5WB<6(6%m1%5riQu%f_F@qV73={`$tfd$M|XI7ML?j^(ns_w&Ez;l$%Y zNeKXWeS932)$p(dYk`9>gpv|r7{H0g#pA6loas7qJrXhAFm2n8R4Ns!`*p;E7>Ec& z1Sut$bsH$91nb7Lk`k`#!Z1zPmIWe$>$-x7BBaAmGcz?#0suWdJvcZxK&ez} z+My7J0TdKW2|$M-m^F-Mh*}#Xr3BG&RGAs)&Yc4hp;+8T*!)ojh){2DFAT$g5CYV+p<1ot&Ycw~R$!&{$jFEQ z#OimqzrQj&J6kpYpin6Iu~_`aTrT(W#ft-dTU%SYT;3D=`+LY_GKfSX&|0HdEMjSC z2}hm>8A?4i_Nwqa@8=&D7vGtmpWg*K#@FQJ=D6@nL4fVlnKN z%fBoveEasTTer$j>rVgyV0wD``JtgpS4=ZvYpptd0R*iS|MBqQ?U|XGzdN=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_{n)^!+jbr~O6 zqvasfenc~YmB@&T19PVUyk1X#Jn#HHXRT<-!;nK89$Fp{r0#{bLgFC-oPt9{wWkdO zfzZG#s%3Tor-q~+tDc!`S?5Ztn6E9;@03VHtl$IT zb8pjx2dnP;n=(99b*gRO15yO1P<2X2g+zO$PZe=j9vdSRHR0O%H}KAZD$QCI^^R7U zCA)DO9c#20R2_6uhgZdWkN2Ktb%~}^ise3X z#!E3Ux|F!Rn{xK#uO!6PZ}-7}`nyZhJMKPpOU8d}v|Kb2SaB){3MyC;a+e8)2%&%x z!4>;q)ezcOhI$R{c5p7Gl{yADZDUQjAQ{jLjpT`)rRWP+W7>BLh?D>J^)qh{u0Oao z4nMxG5J&k;Kwtx+pa*zm8VU`>269HohXI9b%s{z7vbaEPaRH5D)@<9(mJOpMiBC`0 zI-maVK=vQsiD%zyGJ5@|&yLS+z2mEmW^;G0xiXe*uSnKFoX-;kLL?B05Sktda~3iJ zu?R_$P#PNMx*anI@#TX~$$$CW&uk$N6p}bqkm3?IY8zBD=r#&A40000setInterval(300); - connect(m_timer, SIGNAL(timeout()), this, SLOT(checkMainWindowFocus())); - setWindowFlags(Qt::ToolTip); setForegroundRole(QPalette::ToolTipText); setBackgroundRole(QPalette::ToolTipBase); @@ -45,52 +41,43 @@ void TipLabel::paintEvent(QPaintEvent *ev) SqueezeLabelV1::paintEvent(ev); } -void TipLabel::show() -{ - if (!p_QupZilla->weView()->hasFocus()) - return; - - m_timer->start(); - SqueezeLabelV1::show(); -} - -void TipLabel::hide() -{ - m_timer->stop(); - SqueezeLabelV1::hide(); -} - -void TipLabel::checkMainWindowFocus() -{ - if (!p_QupZilla->weView()->hasFocus()) - hide(); -} - - - StatusBarMessage::StatusBarMessage(QupZilla* mainClass) - : QObject() + : QObject(mainClass) , p_QupZilla(mainClass) + , m_statusBarText(new TipLabel(mainClass)) { - m_statusBarText = new TipLabel(mainClass); } -#define STATUS_Y_OFFSET -35 -#define STATUS_X_OFFSET +3 -#define STATUS_TOOLTIP_WIDTH_OFFSET -20 - void StatusBarMessage::showMessage(const QString &message) { - if (p_QupZilla->statusBar()->isVisible()) { + if (p_QupZilla->statusBar()->isVisible()) p_QupZilla->statusBar()->showMessage(message); - } else { - QPoint position = p_QupZilla->weView()->mapToGlobal(p_QupZilla->weView()->pos()); - position.setY( p_QupZilla->weView()->size().height() + position.y() STATUS_Y_OFFSET); - position.setX(position.x() STATUS_X_OFFSET); - m_statusBarText->move(position); - m_statusBarText->setMaximumWidth(p_QupZilla->size().width() STATUS_TOOLTIP_WIDTH_OFFSET); + else { + WebView* view = p_QupZilla->weView(); + QWebFrame* mainFrame = view->page()->mainFrame(); + + int horizontalScrollSize = 0; + int verticalScrollSize = 0; + const int scrollbarSize = p_QupZilla->style()->pixelMetric(QStyle::PM_ScrollBarExtent); + + if (mainFrame->scrollBarMaximum(Qt::Horizontal)) + horizontalScrollSize = scrollbarSize; + if (mainFrame->scrollBarMaximum(Qt::Vertical)) + verticalScrollSize = scrollbarSize; + m_statusBarText->setText(message); m_statusBarText->resize(m_statusBarText->sizeHint()); + m_statusBarText->setMaximumWidth(view->width() - verticalScrollSize); + + QPoint position; + position.setY(view->height() - horizontalScrollSize - m_statusBarText->height()); + + QRect statusRect = QRect(view->mapToGlobal(QPoint(0, position.y())), m_statusBarText->size()); + + if (statusRect.contains(QCursor::pos())) + position.setY(position.y() - m_statusBarText->height()); + + m_statusBarText->move(view->mapToGlobal(position)); m_statusBarText->show(); } } diff --git a/src/other/statusbarmessage.h b/src/other/statusbarmessage.h index 1a0380747..63127467d 100644 --- a/src/other/statusbarmessage.h +++ b/src/other/statusbarmessage.h @@ -21,6 +21,7 @@ #include #include #include "squeezelabelv1.h" +#include "animatedwidget.h" class QupZilla; class TipLabel; @@ -31,14 +32,8 @@ class TipLabel : public SqueezeLabelV1 { public: TipLabel(QupZilla* parent); void paintEvent(QPaintEvent *ev); - void show(); - void hide(); - -private slots: - void checkMainWindowFocus(); private: - QTimer* m_timer; QupZilla* p_QupZilla; }; diff --git a/src/preferences/preferences.cpp b/src/preferences/preferences.cpp index fcee61c55..e5144766e 100644 --- a/src/preferences/preferences.cpp +++ b/src/preferences/preferences.cpp @@ -101,12 +101,13 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent) : connect(ui->newTabUseActual, SIGNAL(clicked()), this, SLOT(useActualNewTab())); //PROFILES - m_actProfileName = mApp->getActiveProfilPath(); - m_actProfileName = m_actProfileName.left(m_actProfileName.length()-1); - m_actProfileName = m_actProfileName.mid(m_actProfileName.lastIndexOf("/")); - m_actProfileName.remove("/"); + QString homePath = QDir::homePath(); + homePath += "/.qupzilla/"; + QSettings profileSettings(homePath + "profiles/profiles.ini", QSettings::IniFormat); + m_actProfileName = profileSettings.value("Profiles/startProfile", "default").toString(); + ui->startProfile->addItem(m_actProfileName); - QDir profilesDir(QDir::homePath()+"/.qupzilla/profiles/"); + QDir profilesDir(QDir::homePath() + "/.qupzilla/profiles/"); QStringList list_ = profilesDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); foreach (QString name, list_) { if (m_actProfileName == name) @@ -675,9 +676,9 @@ void Preferences::saveSettings() //Profiles QString homePath = QDir::homePath(); - homePath+="/.qupzilla/"; - QSettings profileSettings(homePath+"profiles/profiles.ini", QSettings::IniFormat); - profileSettings.setValue("Profiles/startProfile",ui->startProfile->currentText()); + homePath += "/.qupzilla/"; + QSettings profileSettings(homePath + "profiles/profiles.ini", QSettings::IniFormat); + profileSettings.setValue("Profiles/startProfile", ui->startProfile->currentText()); m_pluginsList->save(); m_themesManager->save(); diff --git a/src/webview/webview.cpp b/src/webview/webview.cpp index 8971a35d7..23f3ae326 100644 --- a/src/webview/webview.cpp +++ b/src/webview/webview.cpp @@ -255,11 +255,11 @@ void WebView::titleChanged() QString title2 = title_; tabWidget()->setTabToolTip(tabIndex(),title2); - title2+=" - QupZilla"; + title2 += " - QupZilla"; if (isCurrent()) p_QupZilla->setWindowTitle(title2); - tabWidget()->setTabText(tabIndex(),title_); + tabWidget()->setTabText(tabIndex(), title_); } void WebView::iconChanged() @@ -267,15 +267,17 @@ void WebView::iconChanged() if (mApp->isClosing()) return; -// QIcon icon_ = icon(); + if (isCurrent()) + emit siteIconChanged(); + + if (m_isLoading) + return; + QIcon icon_ = siteIcon(); if (!icon_.isNull()) animationLoading(tabIndex(), false)->setPixmap(icon_.pixmap(16,16)); else animationLoading(tabIndex(), false)->setPixmap(IconProvider::fromTheme("text-plain").pixmap(16,16)); - - if (isCurrent()) - emit siteIconChanged(); } QIcon WebView::siteIcon()