mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Reduced speed of scrolling of RSFeedWidget
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7707 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
069e8e490a
commit
09dbb63a78
@ -20,6 +20,7 @@
|
||||
****************************************************************/
|
||||
|
||||
#include <QKeyEvent>
|
||||
#include <QScrollBar>
|
||||
|
||||
#include "RSFeedWidget.h"
|
||||
#include "ui_RSFeedWidget.h"
|
||||
@ -29,6 +30,28 @@
|
||||
|
||||
#define COLUMN_FEED 0
|
||||
|
||||
#define SINGLE_STEP 15
|
||||
|
||||
/* Redefine single step for srolling */
|
||||
class RSFeedWidgetScrollBar : public QScrollBar
|
||||
{
|
||||
public:
|
||||
RSFeedWidgetScrollBar(QWidget *parent = 0) : QScrollBar(parent) {}
|
||||
|
||||
void sliderChange(SliderChange change)
|
||||
{
|
||||
if (change == SliderStepsChange) {
|
||||
if (singleStep() > SINGLE_STEP) {
|
||||
/* Set our own value */
|
||||
setSingleStep(SINGLE_STEP);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QScrollBar::sliderChange(change);
|
||||
}
|
||||
};
|
||||
|
||||
RSFeedWidget::RSFeedWidget(QWidget *parent)
|
||||
: QWidget(parent), ui(new Ui::RSFeedWidget)
|
||||
{
|
||||
@ -49,7 +72,8 @@ RSFeedWidget::RSFeedWidget(QWidget *parent)
|
||||
mCountChangedDisabled = 0;
|
||||
|
||||
ui->treeWidget->installEventFilter(this);
|
||||
ui->treeWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
|
||||
ui->treeWidget->setVerticalScrollBar(new RSFeedWidgetScrollBar);
|
||||
}
|
||||
|
||||
RSFeedWidget::~RSFeedWidget()
|
||||
|
Loading…
Reference in New Issue
Block a user