diff --git a/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h b/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h index 3b5f185..49ca5cc 100644 --- a/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h +++ b/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h @@ -2009,6 +2009,34 @@ public slots: //! \sa zoomIn(), zoomOut() virtual void zoomTo(int size); + //! For performance, Scintilla does not measure the display width + //! of the document to determine the properties of the horizontal + //! scroll bar. Instead, an assumed width is used. This sets the + //! document width in pixels assumed by Scintilla to \a + //! pixelWidth. The default value is 2000. + //! + //! \sa getScrollWidth(), setScrollWidthTracking() + virtual void setScrollWidth(int pixelWidth); + + //! Gets the document width in pixels assumed by Scintilla. + //! + //! \sa setScrollWidth(), setScrollWidthTracking() + virtual int getScrollWidth() const; + + //! If scroll width tracking is enabled then the scroll width is + //! adjusted to ensure that all of the lines currently displayed + //! can be completely scrolled. This mode never adjusts the scroll + //! width to be narrower. + //! Sets the scroll width tracking to \a enabled. + //! + //! \sa setScrollWidth(), getScrollWidthTracking() + virtual void setScrollWidthTracking(bool enabled); + + //! Gets the current scroll width tracking mode. + //! + //! \sa getScrollWidth(), setScrollWidthTracking() + virtual bool getScrollWidthTracking() const; + signals: //! This signal is emitted whenever the cursor position changes. \a line //! contains the line number and \a index contains the character index diff --git a/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp b/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp index 4c9fe75..31dc579 100644 --- a/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp +++ b/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp @@ -4481,3 +4481,26 @@ static QColor asQColor(long sci_colour) ((int)(sci_colour >> 8)) & 0x00ff, ((int)(sci_colour >> 16)) & 0x00ff); } + +void QsciScintilla::setScrollWidth(int pixelWidth) +{ + SendScintilla(SCI_SETSCROLLWIDTH, pixelWidth); +} + +int QsciScintilla::getScrollWidth() const +{ + return SendScintilla(SCI_GETSCROLLWIDTH); +} + +void QsciScintilla::setScrollWidthTracking(bool enabled) +{ + SendScintilla(SCI_SETSCROLLWIDTHTRACKING, enabled); +} + +bool QsciScintilla::getScrollWidthTracking() const +{ + return SendScintilla(SCI_GETSCROLLWIDTHTRACKING); +} + + +