3djc/horus fix #4041 (#4042)

* Reduce model name size until they fit into the buffer

* SMLSIZE is better (but cut is still needed)

* Rework screen layout to handle up to 15 chars

* Allow for the two scroolbars (models and cats)
This commit is contained in:
3djc
2016-11-19 13:07:06 +01:00
committed by Bertrand Songis
parent a083342cda
commit a35d6b6a05
4 changed files with 8 additions and 8 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1005 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1005 B

+6 -6
View File
@@ -22,8 +22,8 @@
#include "storage/modelslist.h"
#define CATEGORIES_WIDTH 127
#define MODELS_LEFT 147
#define MODELS_COLUMN_WIDTH 162
#define MODELS_LEFT 127
#define MODELS_COLUMN_WIDTH 170
enum ModelSelectMode {
MODE_SELECT_MODEL,
@@ -471,7 +471,7 @@ bool menuModelSelect(event_t event)
}
if (selected) {
lcd->drawBitmap(5, LCD_H-FH, modelselModelNameBitmap);
lcdDrawText(22, LCD_H-FH-1, (*it)->name, TEXT_COLOR);
lcdDrawText(22, LCD_H-FH-1, (*it)->name, SMLSIZE|TEXT_COLOR);
}
}
}
@@ -498,9 +498,9 @@ bool menuModelSelect(event_t event)
// Footer
lcd->drawBitmap(5, LCD_H-FH-20, modelselSdFreeBitmap);
uint32_t size = sdGetSize() / 100;
lcdDrawNumber(22, LCD_H-FH-21, size, PREC1, 0, NULL, "GB");
lcd->drawBitmap(80, LCD_H-FH-20, modelselModelQtyBitmap);
lcdDrawNumber(105, LCD_H-FH-21, modelslist.modelsCount);
lcdDrawNumber(22, LCD_H-FH-21, size, PREC1|SMLSIZE, 0, NULL, "GB");
lcd->drawBitmap(70, LCD_H-FH-20, modelselModelQtyBitmap);
lcdDrawNumber(92, LCD_H-FH-21, modelslist.modelsCount,SMLSIZE);
return true;
}
+2 -2
View File
@@ -24,7 +24,7 @@
#include <list>
#include "sdcard.h"
#define MODELCELL_WIDTH 151
#define MODELCELL_WIDTH 166
#define MODELCELL_HEIGHT 59
class ModelCell
@@ -63,7 +63,7 @@ class ModelCell
}
else {
char timer[LEN_TIMER_STRING];
buffer->drawSizedText(5, 2, header.name, LEN_MODEL_NAME, ZCHAR|TEXT_COLOR);
buffer->drawSizedText(1, 2, header.name, LEN_MODEL_NAME, SMLSIZE|ZCHAR|TEXT_COLOR);
getTimerString(timer, 0);
buffer->drawText(101, 40, timer, TEXT_COLOR);
for (int i=0; i<4; i++) {