From 9d07e548d40b95b2cf84e1ad221d042dd4fbf452 Mon Sep 17 00:00:00 2001 From: Frankenstone Date: Mon, 14 Jun 2021 20:42:55 +0200 Subject: [PATCH] volumebar: added rounded corners on, off Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/48d233adfb374db55966886fa41434a5e3f1f2e0 Author: Frankenstone Date: 2021-06-14 (Mon, 14 Jun 2021) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/volumebar.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 1ec459ec6..aed7eba35 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -51,7 +51,16 @@ CVolumeBar::CVolumeBar() void CVolumeBar::initVarVolumeBar() { col_body_std = 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); @@ -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;