Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
1. fix showing horizontal scrollbar issue on linux
  • Loading branch information
Albert.Zhou committed May 27, 2013
1 parent f8cf979 commit d097cd5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/share/wizuihelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ void CWizScrollBar::syncWith(QScrollBar* source)
m_scrollSyncSource = source;
}

void CWizScrollBar::show()
{
if (maximum() == minimum())
return;

QScrollBar::show();
m_timerScrollTimeout.start(1000);
}

void CWizScrollBar::on_sourceValueChanged(int value)
{
setSliderPosition(value);
Expand All @@ -161,7 +170,6 @@ void CWizScrollBar::on_valueChanged(int value)
}

show();
m_timerScrollTimeout.start(1000);
}

void CWizScrollBar::on_scrollTimeout()
Expand Down
1 change: 1 addition & 0 deletions src/share/wizuihelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class CWizScrollBar : public QScrollBar
public:
CWizScrollBar(QWidget* parent = 0);
void syncWith(QScrollBar* source);
void show();

virtual QSize sizeHint() const;
virtual void mouseMoveEvent(QMouseEvent* event);
Expand Down
11 changes: 11 additions & 0 deletions src/wizdocumentview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,17 @@ void CWizDocumentView::resizeEvent(QResizeEvent* event)
QWidget::resizeEvent(event);
}

void CWizDocumentView::wheelEvent(QWheelEvent* event)
{
// avoid can't horizonal scroll on linux, show both of scrollbar
#ifdef Q_WS_X11
m_vScroll->show();
m_hScroll->show();
#endif

QWidget::wheelEvent(event);
}

QWidget* CWizDocumentView::createWebScroll()
{
// outer most border frame
Expand Down
1 change: 1 addition & 0 deletions src/wizdocumentview.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class CWizDocumentView : public QWidget
int m_nSizeAdjustedTime;

virtual void resizeEvent(QResizeEvent* event);
virtual void wheelEvent(QWheelEvent* event);

private:
QPointer<QScrollArea> m_webScroll;
Expand Down

0 comments on commit d097cd5

Please sign in to comment.