Have a minimum size for scrollbars

With small font sizes, the scrollbars don't need to get smaller than 14
pixels. So, don't allow the scaling to go below 1.
This commit is contained in:
Adrien Destugues
2020-12-09 21:57:31 +01:00
parent b9e10b0796
commit 369abf3be4
+3 -1
View File
@@ -13,6 +13,8 @@
#include <ScrollBar.h>
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
@@ -993,7 +995,7 @@ BScrollBar::SetBorderHighlighted(bool highlight)
void
BScrollBar::GetPreferredSize(float* _width, float* _height)
{
const float scale = be_plain_font->Size() / 12.0f;
const float scale = std::max(be_plain_font->Size() / 12.0f, 1.0f);
if (fOrientation == B_VERTICAL) {
if (_width)
*_width = B_V_SCROLL_BAR_WIDTH * scale;