Skip to content

Commit

Permalink
volumebar: added rounded corners on, off
Browse files Browse the repository at this point in the history
  • Loading branch information
Frankenstone committed Jun 14, 2021
1 parent e0539f2 commit 29a9937
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/gui/volumebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,16 @@ CVolumeBar::CVolumeBar()
void CVolumeBar::initVarVolumeBar()
{
col_body = COL_MENUCONTENT_PLUS_0;
corner_rad = CORNER_RADIUS_MID;

if (g_settings.theme.rounded_corners == 1)
{
corner_rad = CORNER_RADIUS_MID;
}
else
{
corner_rad = CORNER_RADIUS_NONE;
}

vb_item_offset = OFFSET_INNER_SMALL;
height = CFrameBuffer::getInstance()->scale2Res(g_settings.volume_size);

Expand Down Expand Up @@ -95,7 +104,14 @@ void CVolumeBar::initVolumeBarSize()
vb_pbh = height-2*vb_item_offset;

//result for width
width = (vb_icon_w + vb_pbw + vb_digit_w) + 4*vb_item_offset + corner_rad/2;
if (g_settings.theme.rounded_corners == 1)
{
width = (vb_icon_w + vb_pbw + vb_digit_w) + 4*vb_item_offset;
}
else
{
width = (vb_icon_w + vb_pbw + vb_digit_w) + 4*vb_item_offset + corner_rad/2;
}

//adapt x-pos
vb_pbx = vb_item_offset + vb_icon_w + vb_item_offset;
Expand Down

0 comments on commit 29a9937

Please sign in to comment.