From f70a30defa0a25b90056c8ec8e86a66de0734f76 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 5 Apr 2013 21:28:46 +0200 Subject: [PATCH] Progressbars: use default frame thickness It's unnecessary overhead to set the value everywhere, except it's needed. --- src/driver/volume.cpp | 1 + src/gui/dboxinfo.cpp | 1 - src/gui/epgview.cpp | 2 -- src/gui/infoviewer.cpp | 3 --- src/gui/infoviewer_bb.cpp | 2 -- src/gui/moviebrowser.cpp | 1 - src/gui/streaminfo2.cpp | 9 +++++---- 7 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index 82c0ec51f..052c58fa1 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -113,6 +113,7 @@ void CVolume::Init() delete volscale; volscale = new CProgressBar(progress_x, progress_y, progress_w, progress_h, colFrame, colBar, colShadow, COL_MENUCONTENT_PLUS_3, COL_MENUCONTENT_PLUS_1, true); volscale->setInvert(); + volscale->setFrameThickness(2); // mute icon mute_icon_dx = 0; diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index 8c6087633..7da5b5cba 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -443,7 +443,6 @@ void CDBoxInfoWidget::paint() if (pbw > 8) /* smaller progressbar is not useful ;) */ { CProgressBar pb(x+offsetw, ypos+3, pbw, mheight-10); - pb.setFrameThickness(0); pb.setBlink(); pb.setInvert(); pb.setValues(percent_used, 100); diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index f4a4a17b3..719533328 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -642,7 +642,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start { int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1); CProgressBar pb(pbx, sy+oy-height, 104, height-6); - pb.setFrameThickness(0); pb.setBlink(); pb.setValues(epg_done, 100); pb.paint(false); @@ -688,7 +687,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start if ( epg_done!= -1 ) { int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1); CProgressBar pb(pbx, sy+oy-height, 104, height-6); - pb.setFrameThickness(0); pb.setBlink(); pb.setValues(epg_done, 100); pb.paint(false); diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index c7bd1eaf0..aa7c22763 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -220,13 +220,11 @@ void CInfoViewer::changePB() delete sigscale; sigscale = new CProgressBar(); sigscale->setBlink(); - sigscale->setFrameThickness(0); if (snrscale) delete snrscale; snrscale = new CProgressBar(); snrscale->setBlink(); - snrscale->setFrameThickness(0); if (timescale) delete timescale; @@ -1479,7 +1477,6 @@ void CInfoViewer::display_Info(const char *current, const char *next, pb_w = BoxEndX - 10 - xStart; pb_shadow = 0; timescale->setShadowOnOff(false); - timescale->setFrameThickness(0); } switch(g_settings.infobar_progressbar) //set progressbar position { diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 98a611806..f25ca307b 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -819,14 +819,12 @@ void CInfoViewerBB::changePB() if (hddscale) delete hddscale; hddscale = new CProgressBar(); - hddscale->setFrameThickness(0); hddscale->setBlink(); hddscale->setInvert(); if (sysscale) delete sysscale; sysscale = new CProgressBar(); - sysscale->setFrameThickness(0); sysscale->setBlink(); sysscale->setInvert(); } diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 7aa357c72..e91dd8429 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1288,7 +1288,6 @@ void CMovieBrowser::info_hdd_level(bool paint_hdd) CProgressBar pb(m_cBoxFrame.iX+ m_cBoxFrameFootRel.iWidth - pbw - border, m_cBoxFrame.iY+m_cBoxFrameTitleRel.iY + border, pbw, m_cBoxFrameTitleRel.iHeight/2); pb.setBlink(); pb.setInvert(); - pb.setFrameThickness(0); pb.setValues( blocks_percent_used, 100); pb.paint(false); } diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 8fcf0f300..72f059692 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -120,12 +120,13 @@ int CStreamInfo2::doSignalStrengthLoop () #define BAR_WIDTH 150 #define BAR_HEIGHT 12 int res = menu_return::RETURN_REPAINT; - sigscale = new CProgressBar(/*true, BAR_WIDTH, BAR_HEIGHT*/); + + sigscale = new CProgressBar(); sigscale->setBlink(); - sigscale->setFrameThickness(0); - snrscale = new CProgressBar(/*true, BAR_WIDTH, BAR_HEIGHT*/); + + snrscale = new CProgressBar(); snrscale->setBlink(); - snrscale->setFrameThickness(0); + lastsnr = lastsig = -1; neutrino_msg_t msg;