[Horus] Widget selection new design by Martin
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 304 B |
Binary file not shown.
|
After Width: | Height: | Size: 345 B |
Binary file not shown.
|
After Width: | Height: | Size: 315 B |
@@ -342,3 +342,15 @@ const uint8_t LBM_BUTTON_OFF[] __DMA = {
|
||||
#include "alpha_button_off.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SWIPE_CIRCLE[] __DMA = {
|
||||
#include "mask_swipe_circle.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SWIPE_LEFT[] __DMA = {
|
||||
#include "mask_swipe_arrow.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SWIPE_RIGHT[] __DMA = {
|
||||
#include "mask_swipe_right.lbm"
|
||||
};
|
||||
|
||||
|
||||
@@ -97,4 +97,8 @@ extern const uint8_t LBM_CARROUSSEL_RIGHT[];
|
||||
extern const uint8_t LBM_BUTTON_ON[];
|
||||
extern const uint8_t LBM_BUTTON_OFF[];
|
||||
|
||||
extern const uint8_t LBM_SWIPE_CIRCLE[];
|
||||
extern const uint8_t LBM_SWIPE_LEFT[];
|
||||
extern const uint8_t LBM_SWIPE_RIGHT[];
|
||||
|
||||
#endif // _BITMAPS_H_
|
||||
|
||||
@@ -352,18 +352,18 @@ void lcdDrawRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t thickness,
|
||||
}
|
||||
|
||||
#if defined(SIMU)
|
||||
void lcdDrawSolidFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, LcdFlags att)
|
||||
void lcdDrawSolidFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, LcdFlags att)
|
||||
{
|
||||
for (scoord_t i=y; i<y+h; i++) {
|
||||
for (coord_t i=y; i<y+h; i++) {
|
||||
lcdDrawHorizontalLine(x, i, w, SOLID, att);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(BOOT)
|
||||
void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att)
|
||||
void lcdDrawFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att)
|
||||
{
|
||||
for (scoord_t i=y; i<y+h; i++) {
|
||||
for (coord_t i=y; i<y+h; i++) {
|
||||
if ((att & ROUND) && (i==y || i==y+h-1))
|
||||
lcdDrawHorizontalLine(x+1, i, w-2, pat, att);
|
||||
else
|
||||
@@ -774,7 +774,7 @@ void lcdSetContrast()
|
||||
lcdSetRefVolt(g_eeGeneral.contrast);
|
||||
}
|
||||
|
||||
void lcdInvertRect(coord_t x, scoord_t y, coord_t w, coord_t h, LcdFlags att)
|
||||
void lcdInvertRect(coord_t x, coord_t y, coord_t w, coord_t h, LcdFlags att)
|
||||
{
|
||||
display_t color = lcdColorTable[COLOR_IDX(att)];
|
||||
COLOR_SPLIT(color, red, green, blue);
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define LCD_H 272
|
||||
|
||||
#define coord_t int
|
||||
#define scoord_t int
|
||||
#define CENTER
|
||||
#define CENTER_OFS 0
|
||||
#define CONTRAST_MIN 0
|
||||
@@ -235,7 +234,7 @@ inline void lcdDrawPixel(coord_t x, coord_t y, display_t value)
|
||||
void lcdDrawAlphaPixel(display_t * p, uint8_t opacity, uint16_t color);
|
||||
void lcdDrawPoint(coord_t x, coord_t y, LcdFlags att=0);
|
||||
void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlags att=0);
|
||||
void lcdDrawVerticalLine(coord_t x, scoord_t y, scoord_t h, uint8_t pat, LcdFlags att=0);
|
||||
void lcdDrawVerticalLine(coord_t x, coord_t y, coord_t h, uint8_t pat, LcdFlags att=0);
|
||||
void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat=SOLID, LcdFlags att=0);
|
||||
|
||||
inline void lcdDrawAlphaPixel(coord_t x, coord_t y, uint8_t opacity, uint16_t color)
|
||||
@@ -245,12 +244,12 @@ inline void lcdDrawAlphaPixel(coord_t x, coord_t y, uint8_t opacity, uint16_t co
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
inline void lcdDrawSolidFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, LcdFlags flags)
|
||||
inline void lcdDrawSolidFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, LcdFlags flags)
|
||||
{
|
||||
lcdDrawSolidFilledRectDMA(x, y, w, h, lcdColorTable[COLOR_IDX(flags)]);
|
||||
}
|
||||
#else
|
||||
void lcdDrawSolidFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, LcdFlags flags);
|
||||
void lcdDrawSolidFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, LcdFlags flags);
|
||||
#endif
|
||||
|
||||
inline void lcdSetColor(uint16_t color)
|
||||
@@ -263,20 +262,20 @@ inline void lcdClear()
|
||||
lcdDrawSolidFilledRect(0, 0, LCD_W, LCD_H, 0);
|
||||
}
|
||||
|
||||
void lcdInvertRect(coord_t x, scoord_t y, coord_t w, coord_t h, LcdFlags flags);
|
||||
void lcdInvertRect(coord_t x, coord_t y, coord_t w, coord_t h, LcdFlags flags);
|
||||
|
||||
inline void lcdDrawSolidHorizontalLine(coord_t x, scoord_t y, coord_t w, LcdFlags att)
|
||||
inline void lcdDrawSolidHorizontalLine(coord_t x, coord_t y, coord_t w, LcdFlags att)
|
||||
{
|
||||
lcdDrawSolidFilledRect(x, y, w, 1, att);
|
||||
}
|
||||
|
||||
inline void lcdDrawSolidVerticalLine(coord_t x, scoord_t y, coord_t h, LcdFlags att)
|
||||
inline void lcdDrawSolidVerticalLine(coord_t x, coord_t y, coord_t h, LcdFlags att)
|
||||
{
|
||||
if (h<0) { y+=h; h=-h; }
|
||||
lcdDrawSolidFilledRect(x, y, 1, h, att);
|
||||
}
|
||||
|
||||
inline void lcdDrawSolidRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t thickness=1, LcdFlags att=0)
|
||||
inline void lcdDrawSolidRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t thickness=1, LcdFlags att=0)
|
||||
{
|
||||
lcdDrawSolidFilledRect(x, y, thickness, h, att);
|
||||
lcdDrawSolidFilledRect(x+w-thickness, y, thickness, h, att);
|
||||
@@ -284,7 +283,7 @@ inline void lcdDrawSolidRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_
|
||||
lcdDrawSolidFilledRect(x, y+h-thickness, w, thickness, att);
|
||||
}
|
||||
|
||||
void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att=0);
|
||||
void lcdDrawFilledRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att=0);
|
||||
void lcdDrawBlackOverlay();
|
||||
void lcdDrawRect(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t thickness=1, uint8_t pat=SOLID, LcdFlags att=0);
|
||||
void lcdDrawCircle(int x0, int y0, int radius);
|
||||
|
||||
@@ -156,12 +156,19 @@ bool menuWidgetChoice(evt_t event)
|
||||
}
|
||||
|
||||
currentScreen->refresh();
|
||||
lcdDrawBlackOverlay();
|
||||
currentWidget->refresh();
|
||||
|
||||
Zone zone = currentScreen->getZone(currentZone);
|
||||
lcdDrawBitmapPattern(zone.x+2, zone.y+zone.h/2-15, LBM_CARROUSSEL_LEFT, menuHorizontalPosition > 0 ? LINE_COLOR : CURVE_AXIS_COLOR);
|
||||
lcdDrawBitmapPattern(zone.x+zone.w-8, zone.y+zone.h/2-15, LBM_CARROUSSEL_RIGHT, menuHorizontalPosition < countRegisteredWidgets-1 ? LINE_COLOR : CURVE_AXIS_COLOR);
|
||||
lcdDrawFilledRect(0, 0, zone.x-2, LCD_H, SOLID, OVERLAY_COLOR | (8<<24));
|
||||
lcdDrawFilledRect(zone.x+zone.w+2, 0, LCD_W-zone.x-zone.w-2, LCD_H, SOLID, OVERLAY_COLOR | (8<<24));
|
||||
lcdDrawFilledRect(zone.x-2, 0, zone.w+4, zone.y-2, SOLID, OVERLAY_COLOR | (8<<24));
|
||||
lcdDrawFilledRect(zone.x-2, zone.y+zone.h+2, zone.w+4, LCD_H-zone.y-zone.h-2, SOLID, OVERLAY_COLOR | (8<<24));
|
||||
|
||||
currentWidget->refresh();
|
||||
|
||||
lcdDrawBitmapPattern(zone.x-10, zone.y+zone.h/2-10, LBM_SWIPE_CIRCLE, TEXT_INVERTED_BGCOLOR);
|
||||
lcdDrawBitmapPattern(zone.x-10, zone.y+zone.h/2-10, LBM_SWIPE_LEFT, TEXT_INVERTED_COLOR);
|
||||
lcdDrawBitmapPattern(zone.x+zone.w-9, zone.y+zone.h/2-10, LBM_SWIPE_CIRCLE, TEXT_INVERTED_BGCOLOR);
|
||||
lcdDrawBitmapPattern(zone.x+zone.w-9, zone.y+zone.h/2-10, LBM_SWIPE_RIGHT, TEXT_INVERTED_COLOR);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -337,8 +344,6 @@ bool menuScreenSetup(evt_t event)
|
||||
menuPageCount = updateMainviewsMenu();
|
||||
MENU_WITH_OPTIONS(title, LBM_MAINVIEWS_ICONS, menuTabMainviews, menuPageCount, T+1, linesCount, { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW, 0, 0, 0, 0 });
|
||||
|
||||
|
||||
|
||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||
coord_t y = MENU_CONTENT_TOP + i * FH;
|
||||
int k = i + menuVerticalOffset;
|
||||
|
||||
Reference in New Issue
Block a user