ui: Added scroll speed setting to preferences
This commit is contained in:
@@ -204,6 +204,9 @@ QtAutocompletionList::QtAutocompletionList(QWidget* parent)
|
||||
setModelSorting(QCompleter::UnsortedModel);
|
||||
setCompletionPrefix("");
|
||||
setMaxVisibleItems(20);
|
||||
|
||||
m_scrollSpeedChangeListenerHorizontal.setScrollBar(list->horizontalScrollBar());
|
||||
m_scrollSpeedChangeListenerVertical.setScrollBar(list->verticalScrollBar());
|
||||
}
|
||||
|
||||
QtAutocompletionList::~QtAutocompletionList()
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <QListView>
|
||||
|
||||
#include "data/search/SearchMatch.h"
|
||||
#include "qt/utility/QtScrollSpeedChangeListener.h"
|
||||
|
||||
class QtAutocompletionModel
|
||||
: public QAbstractTableModel
|
||||
@@ -70,6 +71,9 @@ private slots:
|
||||
private:
|
||||
std::shared_ptr<QtAutocompletionModel> m_model;
|
||||
std::shared_ptr<QtAutocompletionDelegate> m_delegate;
|
||||
|
||||
QtScrollSpeedChangeListener m_scrollSpeedChangeListenerHorizontal;
|
||||
QtScrollSpeedChangeListener m_scrollSpeedChangeListenerVertical;
|
||||
};
|
||||
|
||||
#endif // QT_AUTOCOMPLETION_LIST
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "qt/element/QtCodeArea.h"
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <QApplication>
|
||||
#include <QFont>
|
||||
#include <QHBoxLayout>
|
||||
#include <qmenu.h>
|
||||
#include <QMenu>
|
||||
#include <QPainter>
|
||||
#include <QPushButton>
|
||||
#include <QScrollBar>
|
||||
#include <QToolTip>
|
||||
#include <qscrollbar.h>
|
||||
|
||||
#include "utility/messaging/type/MessageActivateLocalSymbols.h"
|
||||
#include "utility/messaging/type/MessageActivateTokenLocations.h"
|
||||
@@ -130,6 +130,7 @@ QtCodeArea::QtCodeArea(
|
||||
|
||||
// MouseWheelOverScrollbarFilter is deleted by parent.
|
||||
horizontalScrollBar()->installEventFilter(new MouseWheelOverScrollbarFilter(this));
|
||||
m_scrollSpeedChangeListener.setScrollBar(horizontalScrollBar());
|
||||
|
||||
createActions();
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <QPlainTextEdit>
|
||||
|
||||
#include "data/location/LocationType.h"
|
||||
#include "qt/utility/QtScrollSpeedChangeListener.h"
|
||||
#include "utility/types.h"
|
||||
|
||||
class QDragMoveEvent;
|
||||
@@ -190,6 +191,8 @@ private:
|
||||
|
||||
std::vector<int> m_lineLengths;
|
||||
int m_endTextEditPosition;
|
||||
|
||||
QtScrollSpeedChangeListener m_scrollSpeedChangeListener;
|
||||
};
|
||||
|
||||
#endif // QT_CODE_AREA_H
|
||||
|
||||
@@ -80,6 +80,8 @@ QtCodeNavigator::QtCodeNavigator(QWidget* parent)
|
||||
m_scrollArea->setWidgetResizable(true);
|
||||
m_scrollArea->setWidget(m_list);
|
||||
|
||||
m_scrollSpeedChangeListener.setScrollBar(m_scrollArea->verticalScrollBar());
|
||||
|
||||
connect(m_scrollArea->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(scrolled(int)));
|
||||
connect(this, SIGNAL(shouldScrollToSnippet(QtCodeSnippet*, uint)),
|
||||
this, SLOT(scrollToSnippet(QtCodeSnippet*, uint)), Qt::QueuedConnection);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <QScrollArea>
|
||||
|
||||
#include "qt/element/QtCodeFileList.h"
|
||||
#include "qt/utility/QtScrollSpeedChangeListener.h"
|
||||
#include "qt/utility/QtThreadedFunctor.h"
|
||||
#include "utility/messaging/MessageListener.h"
|
||||
#include "utility/messaging/type/MessageCodeReference.h"
|
||||
@@ -125,6 +126,8 @@ private:
|
||||
QtCodeFile* m_scrollToFile;
|
||||
uint m_scrollToLine;
|
||||
Id m_scrollToLocationId;
|
||||
|
||||
QtScrollSpeedChangeListener m_scrollSpeedChangeListener;
|
||||
};
|
||||
|
||||
#endif // QT_CODE_NAVIGATOR_H
|
||||
|
||||
Reference in New Issue
Block a user