From c5451046d44fb85f1826e9c423b634383006d889 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 21 Apr 2017 22:47:23 +0200 Subject: [PATCH] CComponentsScrollBar: fix radius for single segment Radius on top was missed if only one segment is available. --- src/gui/components/cc_frm_scrollbar.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 2fcfd737c..e890ffbef 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -183,8 +183,12 @@ void CComponentsScrollBar::initSegments() } //set corner types - sb_segments_obj->front()->setCorner(RADIUS_MIN, CORNER_TOP); - sb_segments_obj->back()->setCorner(RADIUS_MIN, CORNER_BOTTOM); + if (sb_segments_obj->size() == 1){ + sb_segments_obj->front()->setCorner(RADIUS_MIN, CORNER_ALL); + }else{ + sb_segments_obj->front()->setCorner(RADIUS_MIN, CORNER_TOP); + sb_segments_obj->back()->setCorner(RADIUS_MIN, CORNER_BOTTOM); + } }