CUpnpBrowserGui: try to reduce flicker effects on scroll

Some parts on screen should be painted only if changed.
This should help to reduce some flicker effects.
This commit is contained in:
2017-07-01 22:01:11 +02:00
parent baf441b5d0
commit 3213999198

View File

@@ -93,7 +93,7 @@ void CUpnpBrowserGui::Init()
topbox.setColorAll(COL_FRAME_PLUS_0, COL_MENUHEAD_PLUS_0, COL_SHADOW_PLUS_0, COL_MENUHEAD_TEXT);
topbox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]);
topbox.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Head_gradient_direction);
topbox.enableShadow(CC_SHADOW_ON, -1, true);
topbox.enableShadow(CC_SHADOW_ON);
infobox.enableFrame(true, 2);
infobox.setCorner(RADIUS_LARGE);
@@ -101,7 +101,7 @@ void CUpnpBrowserGui::Init()
infobox.setTextColor(COL_MENUCONTENTDARK_TEXT);
infobox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]);
infobox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction);
infobox.enableShadow(CC_SHADOW_ON, -1, true);
infobox.enableShadow(CC_SHADOW_ON);
timebox.enableFrame(true, 2);
timebox.setCorner(RADIUS_LARGE);
@@ -109,7 +109,7 @@ void CUpnpBrowserGui::Init()
timebox.setTextColor(infobox.getTextColor());
timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]);
timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction);
timebox.enableShadow(CC_SHADOW_ON, -1, true);
timebox.enableShadow(CC_SHADOW_ON);
m_width = m_frameBuffer->getScreenWidthRel();
m_height = m_frameBuffer->getScreenHeightRel();
@@ -193,7 +193,7 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/
stopAudio();
m_frameBuffer->stopFrame();
m_frameBuffer->Clear();
topbox.kill();
CZapit::getInstance()->EnablePlayback(true);
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , m_LastMode);
@@ -916,7 +916,6 @@ bool CUpnpBrowserGui::selectItem(std::string id)
delete entries;
timeout = 0;
m_frameBuffer->Clear();
return endall;
}
@@ -942,7 +941,7 @@ void CUpnpBrowserGui::paintDeviceInfo()
topbox.setDimensionsAll(m_x, m_y, m_width, m_topbox_height);
topbox.setCorner(RADIUS_LARGE);
topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER);
if (topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER))
topbox.paint0();
}
@@ -1144,7 +1143,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry)
}
topbox.setCorner(RADIUS_LARGE);
topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER);
if (topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER))
topbox.paint0();
}
@@ -1205,7 +1204,7 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing)
text = m_playing_entry.title;
text += !m_playing_entry.artist.empty() ? " - " + m_playing_entry.artist : "";
text += "\n" + m_playing_entry.album;
infobox.setText(text, CTextBox::AUTO_WIDTH);
if (infobox.setText(text, CTextBox::AUTO_WIDTH))
infobox.paint0();
}
}else{
@@ -1215,7 +1214,7 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing)
text = entry->title;
text += !entry->artist.empty() ? " - " + entry->artist : "";
text += "\n" + entry->album;
infobox.setText(text, CTextBox::AUTO_WIDTH);
if (infobox.setText(text, CTextBox::AUTO_WIDTH))
infobox.paint0();
}
if (image)