3djc/horus improve mixer setup (#3636)

* Rework to display bar on mixers, hence needs a more flexible drawSingleXXBar approach

* First working version
WARNING : displayMixConvertMask() DOES have a bug, do NOT PR without fix

* Fixed displayMixConvertMask() bug
Cosmetics on placement on status bar

* Cosmetics

* Improved graphics by mhotar !

* Fix for multiple lines mixers
Cosmetics

* Fine tune column values to handle more complex mixers lines

* Replace +=, *=, := by icons

* No needs to use mask bitmap

* Remove unwanted png file

* Fix handling and conversion of Mask to Bitmap

* use loadAndConvertMask here too

* Typo

* Screen layout fine tune

* - Move loadMaskOnBackground to framebuffer.cpp
- replace loadMaskAndConvert by loadMaskOnBackground

* Cosmetics

* Move new icons to theme loading

* Fine tune Mixer setup screen on darkblue
This commit is contained in:
3djc
2016-06-30 18:53:07 +02:00
committed by Bertrand Songis
parent 2e78dad1a7
commit e33c56d1eb
20 changed files with 177 additions and 53 deletions
+30 -17
View File
@@ -26,19 +26,6 @@ const ZoneOption OPTIONS_THEME_DEFAULT[] = {
{ NULL, ZoneOption::Bool }
};
BitmapBuffer * loadMaskOnBackground(const char * filename, LcdFlags foreground, LcdFlags background)
{
BitmapBuffer * result = NULL;
BitmapBuffer * mask = BitmapBuffer::loadMask(getThemePath(filename));
if (mask) {
result = new BitmapBuffer(BMP_RGB565, mask->getWidth(), mask->getHeight());
result->clear(background);
result->drawMask(0, 0, mask, foreground);
delete mask;
}
return result;
}
class DefaultTheme: public Theme
{
public:
@@ -158,11 +145,11 @@ class DefaultTheme: public Theme
currentMenuBackground->drawMask(10, 39, dot, MENU_TITLE_COLOR);
delete topleftBitmap;
topleftBitmap = loadMaskOnBackground("topleft.png", TITLE_BGCOLOR, HEADER_BGCOLOR);
topleftBitmap = BitmapBuffer::loadMaskOnBackground("topleft.png", TITLE_BGCOLOR, HEADER_BGCOLOR);
// Model Selection screen
delete modelselIconBitmap;
modelselIconBitmap = loadMaskOnBackground("modelsel/mask_iconback.png", TITLE_BGCOLOR, TEXT_BGCOLOR);
modelselIconBitmap = BitmapBuffer::loadMaskOnBackground("modelsel/mask_iconback.png", TITLE_BGCOLOR, TEXT_BGCOLOR);
if (modelselIconBitmap) {
BitmapBuffer * bitmap = BitmapBuffer::load(getThemePath("modelsel/icon_default.png"));
modelselIconBitmap->drawBitmap(25, 8, bitmap);
@@ -170,17 +157,43 @@ class DefaultTheme: public Theme
}
delete modelselSdFreeBitmap;
modelselSdFreeBitmap = loadMaskOnBackground("modelsel/mask_sdfree.png", TEXT_COLOR, TEXT_BGCOLOR);
modelselSdFreeBitmap = BitmapBuffer::loadMaskOnBackground("modelsel/mask_sdfree.png", TEXT_COLOR, TEXT_BGCOLOR);
delete modelselModelQtyBitmap;
modelselModelQtyBitmap = loadMaskOnBackground("modelsel/mask_modelqty.png", TEXT_COLOR, TEXT_BGCOLOR);
modelselModelQtyBitmap = BitmapBuffer::loadMaskOnBackground("modelsel/mask_modelqty.png", TEXT_COLOR, TEXT_BGCOLOR);
delete modelselModelMoveBackground;
modelselModelMoveBackground = BitmapBuffer::loadMask(getThemePath("modelsel/mask_moveback.png"));
delete modelselModelMoveIcon;
modelselModelMoveIcon = BitmapBuffer::loadMask(getThemePath("modelsel/mask_moveico.png"));
// Channels monitor screen
delete chanMonLockedBitmap;
chanMonLockedBitmap = BitmapBuffer::loadMaskOnBackground("mask_monitor_lockch.png", TEXT_COLOR, TEXT_BGCOLOR);
delete chanMonInvertedBitmap;
chanMonInvertedBitmap = BitmapBuffer::loadMaskOnBackground("mask_monitor_inver.png", TEXT_COLOR, TEXT_BGCOLOR);
// Mixer setup screen
delete mixerSetupMixerBitmap;
mixerSetupMixerBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_mixer.png", MENU_TITLE_COLOR, HEADER_BGCOLOR);
delete mixerSetupToBitmap;
mixerSetupToBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_to.png", MENU_TITLE_COLOR, HEADER_BGCOLOR);
delete mixerSetupOutputBitmap;
mixerSetupOutputBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_output.png", MENU_TITLE_COLOR, HEADER_BGCOLOR);
delete mixerSetupAddBitmap;
mixerSetupAddBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_add.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupMultiBitmap;
mixerSetupMultiBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_multi.png", TEXT_COLOR, TEXT_BGCOLOR);
delete mixerSetupReplaceBitmap;
mixerSetupReplaceBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_replace.png", TEXT_COLOR, TEXT_BGCOLOR);
delete background;
delete shadow;
delete dot;