Ensure that scrollbar GtkRange page increment is set to a positive value
It should not be less than the step increment, which is always one. See #18688
This commit is contained in:
@@ -201,12 +201,15 @@ void wxScrollBar::SetThumbPosition( int viewStart )
|
|||||||
|
|
||||||
void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize, bool)
|
void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize, bool)
|
||||||
{
|
{
|
||||||
if (range == 0)
|
if (range <= 0)
|
||||||
{
|
{
|
||||||
// GtkRange requires upper > lower
|
// GtkRange requires upper > lower
|
||||||
range =
|
range =
|
||||||
|
pageSize =
|
||||||
thumbSize = 1;
|
thumbSize = 1;
|
||||||
}
|
}
|
||||||
|
else if (pageSize <= 0)
|
||||||
|
pageSize = 1;
|
||||||
g_signal_handlers_block_by_func(m_widget, (void*)gtk_value_changed, this);
|
g_signal_handlers_block_by_func(m_widget, (void*)gtk_value_changed, this);
|
||||||
GtkRange* widget = GTK_RANGE(m_widget);
|
GtkRange* widget = GTK_RANGE(m_widget);
|
||||||
GtkAdjustment* adj = gtk_range_get_adjustment(widget);
|
GtkAdjustment* adj = gtk_range_get_adjustment(widget);
|
||||||
|
@@ -54,6 +54,8 @@ void wxScrollHelper::DoAdjustScrollbar(GtkRange* range,
|
|||||||
{
|
{
|
||||||
upper = (virtSize + pixelsPerLine - 1) / pixelsPerLine;
|
upper = (virtSize + pixelsPerLine - 1) / pixelsPerLine;
|
||||||
page_size = winSize / pixelsPerLine;
|
page_size = winSize / pixelsPerLine;
|
||||||
|
if (page_size == 0)
|
||||||
|
page_size = 1;
|
||||||
*lines = upper;
|
*lines = upper;
|
||||||
*linesPerPage = page_size;
|
*linesPerPage = page_size;
|
||||||
}
|
}
|
||||||
|
@@ -6011,6 +6011,8 @@ void wxWindowGTK::SetScrollbar(int orient,
|
|||||||
range =
|
range =
|
||||||
thumbVisible = 1;
|
thumbVisible = 1;
|
||||||
}
|
}
|
||||||
|
else if (thumbVisible <= 0)
|
||||||
|
thumbVisible = 1;
|
||||||
|
|
||||||
g_signal_handlers_block_by_func(
|
g_signal_handlers_block_by_func(
|
||||||
sb, (void*)gtk_scrollbar_value_changed, this);
|
sb, (void*)gtk_scrollbar_value_changed, this);
|
||||||
|
Reference in New Issue
Block a user