pl_text_size_010
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef options_h
|
||||
#define options_h
|
||||
|
||||
#define YOVERSION "0.9.009"
|
||||
#define YOVERSION "0.9.010"
|
||||
|
||||
/*******************************************************
|
||||
DO NOT EDIT THIS FILE.
|
||||
|
||||
@@ -12,9 +12,6 @@
|
||||
#define DSP_HEIGHT 176
|
||||
#define TFT_FRAMEWDT 4
|
||||
#define MAX_WIDTH DSP_WIDTH-TFT_FRAMEWDT*2
|
||||
#define PLMITEMS 9
|
||||
#define PLMITEMLENGHT 40
|
||||
#define PLMITEMHEIGHT 22
|
||||
|
||||
#define bootLogoTop 28
|
||||
//#define DSP_QUEUE_TICKS 5
|
||||
@@ -38,8 +35,8 @@ const FillConfig heapbarConf PROGMEM = {{ 0, DSP_HEIGHT-1, 0, WA_LEFT }, DS
|
||||
/* WIDGETS */ /* { left, top, fontsize, align } */
|
||||
const WidgetConfig bootstrConf PROGMEM = { 0, 150, 1, WA_CENTER };
|
||||
const WidgetConfig bitrateConf PROGMEM = { TFT_FRAMEWDT+6, DSP_HEIGHT-TFT_FRAMEWDT-14-14, 1, WA_RIGHT };
|
||||
const WidgetConfig voltxtConf PROGMEM = { 80, DSP_HEIGHT-TFT_FRAMEWDT-14, 1, WA_RIGHT };
|
||||
const WidgetConfig iptxtConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-TFT_FRAMEWDT-14, 1, WA_LEFT };
|
||||
const WidgetConfig voltxtConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-TFT_FRAMEWDT-14, 1, WA_LEFT };
|
||||
const WidgetConfig iptxtConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-TFT_FRAMEWDT-14, 1, WA_CENTER };
|
||||
const WidgetConfig rssiConf PROGMEM = { TFT_FRAMEWDT, DSP_HEIGHT-TFT_FRAMEWDT-14, 1, WA_RIGHT };
|
||||
const WidgetConfig numConf PROGMEM = { 0, 110, 35, WA_CENTER };
|
||||
const WidgetConfig apNameConf PROGMEM = { TFT_FRAMEWDT, 38, 2, WA_CENTER };
|
||||
@@ -57,8 +54,8 @@ const VUBandsConfig bandsConf PROGMEM = { 19, 90, 2, 2, 10, 2 };
|
||||
/* STRINGS */
|
||||
const char numtxtFmt[] PROGMEM = "%d";
|
||||
const char rssiFmt[] PROGMEM = "WiFi %d";
|
||||
const char iptxtFmt[] PROGMEM = "\010 %s";
|
||||
const char voltxtFmt[] PROGMEM = "%d";
|
||||
const char iptxtFmt[] PROGMEM = "%s";
|
||||
const char voltxtFmt[] PROGMEM = "\023\025%d";
|
||||
const char bitrateFmt[] PROGMEM = "%d kBs";
|
||||
|
||||
/* MOVES */ /* { left, top, width } */
|
||||
|
||||
@@ -103,6 +103,11 @@ void DspCore::initDisplay() {
|
||||
flip();
|
||||
setTextSize(1);
|
||||
// GIVE_MUTEX();
|
||||
plItemHeight = playlistConf.widget.textsize*(CHARHEIGHT-1)+playlistConf.widget.textsize*4;
|
||||
plTtemsCount = round((float)height()/plItemHeight);
|
||||
if(plTtemsCount%2==0) plTtemsCount++;
|
||||
plCurrentPos = plTtemsCount/2;
|
||||
plYStart = (height() / 2 - plItemHeight / 2) - plItemHeight * (plTtemsCount - 1) / 2 + playlistConf.widget.textsize*2;
|
||||
}
|
||||
|
||||
void DspCore::drawLogo(uint16_t top) {
|
||||
@@ -111,23 +116,24 @@ void DspCore::drawLogo(uint16_t top) {
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::drawPlaylist(uint16_t currentItem, char* currentItemText) {
|
||||
for (byte i = 0; i < PLMITEMS; i++) {
|
||||
plMenu[i][0] = '\0';
|
||||
}
|
||||
config.fillPlMenu(plMenu, currentItem - 4, PLMITEMS);
|
||||
setTextSize(2);
|
||||
int yStart = (height() / 2 - PLMITEMHEIGHT / 2) - PLMITEMHEIGHT * (PLMITEMS - 1) / 2 + 3;
|
||||
for (byte i = 0; i < PLMITEMS; i++) {
|
||||
if (i == 4) {
|
||||
strlcpy(currentItemText, plMenu[i], PLMITEMLENGHT - 1);
|
||||
void DspCore::printPLitem(uint8_t pos, const char* item, ScrollWidget& current){
|
||||
setTextSize(playlistConf.widget.textsize);
|
||||
if (pos == plCurrentPos) {
|
||||
current.setText(item);
|
||||
} else {
|
||||
setTextColor(config.theme.playlist[abs(i - 4)-1], config.theme.background);
|
||||
setCursor(TFT_FRAMEWDT, yStart + i * PLMITEMHEIGHT);
|
||||
fillRect(0, yStart + i * PLMITEMHEIGHT-1, width(), PLMITEMHEIGHT-7, config.theme.background);
|
||||
print(utf8Rus(plMenu[i], true));
|
||||
uint8_t plColor = (abs(pos - plCurrentPos)-1)>4?4:abs(pos - plCurrentPos)-1;
|
||||
setTextColor(config.theme.playlist[plColor], config.theme.background);
|
||||
setCursor(TFT_FRAMEWDT, plYStart + pos * plItemHeight);
|
||||
fillRect(0, plYStart + pos * plItemHeight - 1, width(), plItemHeight - 2, config.theme.background);
|
||||
print(utf8Rus(item, true));
|
||||
}
|
||||
}
|
||||
|
||||
void DspCore::drawPlaylist(uint16_t currentItem) {
|
||||
uint8_t lastPos = config.fillPlMenu(currentItem - plCurrentPos, plTtemsCount);
|
||||
if(lastPos<plTtemsCount){
|
||||
fillRect(0, lastPos*plItemHeight+plYStart, width(), height()/2, config.theme.background);
|
||||
}
|
||||
}
|
||||
|
||||
void DspCore::clearDsp(bool black) {
|
||||
|
||||
@@ -13,35 +13,35 @@
|
||||
const unsigned char yofont5x7[] PROGMEM = {
|
||||
0x05, 0x07, 0x00, 0xFF,
|
||||
0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x3E, 0x55, 0x51, 0x55, 0x3E,
|
||||
0x05, 0x3E, 0x6B, 0x6F, 0x6B, 0x3E,
|
||||
0x05, 0x0C, 0x1E, 0x3C, 0x1E, 0x0C,
|
||||
0x05, 0x08, 0x1C, 0x3E, 0x1C, 0x08,
|
||||
0x05, 0x1C, 0x4A, 0x7F, 0x4A, 0x1C,
|
||||
0x05, 0x18, 0x5C, 0x7F, 0x5C, 0x18,
|
||||
0x05, 0x00, 0x1C, 0x1C, 0x1C, 0x00,
|
||||
0x05, 0x7F, 0x63, 0x63, 0x63, 0x7F,
|
||||
0x05, 0x00, 0x1C, 0x14, 0x1C, 0x00,
|
||||
0x05, 0x20, 0x20, 0x00, 0x10, 0x10, // \001 rssi 00__
|
||||
0x05, 0x08, 0x08, 0x00, 0x04, 0x04, // \002 rssi __00
|
||||
0x05, 0x60, 0x60, 0x00, 0x10, 0x10, // \003 rssi 10__
|
||||
0x05, 0x60, 0x60, 0x00, 0x70, 0x70, // \004 rssi 11__
|
||||
0x05, 0x78, 0x78, 0x00, 0x04, 0x04, // \005 rssi __10
|
||||
0x05, 0x78, 0x78, 0x00, 0x7C, 0x7C, // \006 rssi __11
|
||||
0x05, 0x00, 0x1C, 0x1C, 0x1C, 0x00, // \007 weather div
|
||||
0x05, 0x7A, 0x00, 0x7E, 0x12, 0x1E, // \010 ip
|
||||
0x05, 0x06, 0x09, 0x09, 0x06, 0x00, // \011 degree
|
||||
0x05, 0x7F, 0x63, 0x6B, 0x63, 0x7F,
|
||||
0x05, 0x30, 0x48, 0x4D, 0x33, 0x07,
|
||||
0x05, 0x06, 0x29, 0x79, 0x29, 0x06,
|
||||
0x05, 0x20, 0x50, 0x3F, 0x02, 0x0C,
|
||||
0x05, 0x60, 0x7F, 0x05, 0x35, 0x3F,
|
||||
0x05, 0x60, 0x7F, 0x05, 0x35, 0x3F, // \016 note
|
||||
0x05, 0x2A, 0x1C, 0x77, 0x1C, 0x2A,
|
||||
0x05, 0x00, 0x7F, 0x3E, 0x1C, 0x08,
|
||||
0x05, 0x08, 0x1C, 0x3E, 0x7F, 0x00,
|
||||
0x05, 0x00, 0x7F, 0x3E, 0x1C, 0x08, // \020 next/play
|
||||
0x05, 0x08, 0x1C, 0x3E, 0x7F, 0x00, // \021 prev
|
||||
0x05, 0x14, 0x22, 0x7F, 0x22, 0x14,
|
||||
0x05, 0x00, 0x5F, 0x00, 0x5F, 0x00,
|
||||
0x05, 0x06, 0x09, 0x7F, 0x01, 0x7F,
|
||||
0x05, 0x4A, 0x55, 0x55, 0x55, 0x29,
|
||||
0x05, 0x60, 0x60, 0x60, 0x60, 0x60,
|
||||
0x05, 0x00, 0x00, 0x18, 0x3C, 0x7E, // \023 speaker
|
||||
0x05, 0x18, 0x00, 0x00, 0x00, 0x00, // \024 25%
|
||||
0x05, 0x18, 0x42, 0x3C, 0x00, 0x00, // \025 50%
|
||||
0x05, 0x18, 0x42, 0x3C, 0x42, 0x3C, // \026 100%
|
||||
0x05, 0x54, 0x62, 0x7F, 0x62, 0x54,
|
||||
0x05, 0x08, 0x04, 0x7E, 0x04, 0x08,
|
||||
0x05, 0x08, 0x10, 0x3F, 0x10, 0x08,
|
||||
0x05, 0x08, 0x08, 0x2A, 0x1C, 0x08,
|
||||
0x05, 0x08, 0x1C, 0x2A, 0x08, 0x08,
|
||||
0x05, 0x1C, 0x10, 0x10, 0x10, 0x10,
|
||||
0x05, 0x1C, 0x3E, 0x08, 0x3E, 0x1C,
|
||||
0x05, 0x7F, 0x7F, 0x00, 0x7F, 0x7F, // \034 pause
|
||||
0x05, 0x55, 0x00, 0x55, 0x55, 0x55, // \035 list
|
||||
0x05, 0x30, 0x3C, 0x3F, 0x3C, 0x30,
|
||||
0x05, 0x06, 0x1E, 0x7E, 0x1E, 0x06,
|
||||
0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
Reference in New Issue
Block a user