diff options
| author | Andrea Diamantini <adjam7@gmail.com> | 2009-10-23 12:12:51 +0200 | 
|---|---|---|
| committer | Andrea Diamantini <adjam7@gmail.com> | 2009-10-23 12:12:51 +0200 | 
| commit | 8ddcc01712b0971c6a5714fa59ff3c7c6ad4c51f (patch) | |
| tree | f8b1ba6d6c02c7691fc9980536d9f52daa2a5bdd /src | |
| parent | Fixing merge.. (diff) | |
| download | rekonq-8ddcc01712b0971c6a5714fa59ff3c7c6ad4c51f.tar.xz | |
What's overkilling?
checking EVERYTIME mouse move events to just fix some stupid cases?
revert a good implementation just to bug fixing the 0.1% of the cases?
Don't know! This implementation seems working to fix the flickering links
But, these are really the UI problems I'd like to get rid...
Diffstat (limited to 'src')
| -rw-r--r-- | src/mainwindow.cpp | 42 | ||||
| -rw-r--r-- | src/mainwindow.h | 4 | ||||
| -rw-r--r-- | src/webview.cpp | 10 | 
3 files changed, 44 insertions, 12 deletions
| diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 6ec6a3a6..787ecdce 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -101,6 +101,7 @@ MainWindow::MainWindow()      , m_mainBar( new KToolBar( QString("MainToolBar"), this, Qt::TopToolBarArea, true, false, false) )      , m_bmBar( new KToolBar( QString("BookmarkToolBar"), this, Qt::TopToolBarArea, true, false, false) )      , m_ac( new KActionCollection(this) ) +    , m_flickeringZone(false)  {      // enable window size "auto-save"      setAutoSaveSettings(); @@ -959,31 +960,42 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status)          break;      } +    // useful values +    int windowWidth = width(); +    int pageHeight = m_view->currentWebView()->page()->viewportSize().height(); +    int labelHeight = KGlobalSettings::generalFont().pointSize()*2 + 7; +    bool scrollbarIsVisible = m_view->currentWebView()->page()->currentFrame()->scrollBarMaximum(Qt::Horizontal); +    int scrollbarSize = 0; +    if (scrollbarIsVisible)  +    { +        //TODO: detect QStyle size +        scrollbarSize = 17; +    } +         +    // setting the popup      m_popup->setFrameShape(QFrame::NoFrame);      QLabel *label = new QLabel(msg); -    label->setMaximumWidth(width()-8);      m_popup->setLineWidth(0);      m_popup->setView(label); -    m_popup->setFixedSize(0, 0); +    m_popup->setFixedSize(windowWidth/3, labelHeight);      m_popup->layout()->setAlignment(Qt::AlignTop);      m_popup->layout()->setMargin(4); -    // setting popus in bottom-left position -    int pageHeight = m_view->currentWebView()->page()->viewportSize().height(); -    int labelHeight = KGlobalSettings::generalFont().pointSize()*2 + 7; -    bool scrollbarIsVisible = m_view->currentWebView()->page()->currentFrame()->scrollBarMaximum(Qt::Horizontal); -    int scrollbarSize = 0; -    if (scrollbarIsVisible) scrollbarSize = 17; //TODO: detect QStyle size - +    // setting popus in bottom-(left/right) position      int x = geometry().x(); -    int y = m_view->currentWebView()->mapToGlobal(QPoint(0,pageHeight)).y() - labelHeight -scrollbarSize; +    if(m_flickeringZone) +    { +        x = width() - m_popup->width(); +        label->setAlignment(Qt::AlignRight); +    } +         +    int y = m_view->currentWebView()->mapToGlobal(QPoint(0,pageHeight)).y() - labelHeight - scrollbarSize;      QPoint p(x,y);      m_popup->show(p);      if(popup_sav)          delete popup_sav; -  } @@ -1107,4 +1119,10 @@ bool MainWindow::homePage(const KUrl &url)          return true;      }      return false; -}
\ No newline at end of file +} + + +void MainWindow::setFlickeringZone(bool b) +{ +    m_flickeringZone = b; +} diff --git a/src/mainwindow.h b/src/mainwindow.h index 06fec756..41687e60 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -72,6 +72,8 @@ public:      bool homePage(const KUrl &url = KUrl("rekonq:home")); +    void setFlickeringZone(bool b); +      private:      void setupActions();      void setupTools(); @@ -170,6 +172,8 @@ private:      QPointer<KPassivePopup> m_popup;      KActionCollection *m_ac; + +    bool m_flickeringZone;  };  #endif // MAINWINDOW_H diff --git a/src/webview.cpp b/src/webview.cpp index e65aea9e..8380d064 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -451,6 +451,16 @@ void WebView::mousePressEvent(QMouseEvent *event)  void WebView::mouseMoveEvent(QMouseEvent *event)  { +    QPoint p = event->pos(); +    QSize s = size(); +    int x = s.width() / 2; +    int y = s.height() - 30;    // quite reasonable value, without performing requests, cause of speed + +    if(p.x() <= x && p.y() >= y ) +        Application::instance()->mainWindow()->setFlickeringZone(true); +    else +        Application::instance()->mainWindow()->setFlickeringZone(false); +          if( url().protocol() != "rekonq" )      {          QWebView::mouseMoveEvent(event); | 
