From 97ef3fa9169faefeab95658303bb25cab5f4b1fe Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 16 Feb 2016 22:59:47 +0100 Subject: [PATCH] [Horus] Widget selection new design by Martin --- radio/src/bitmaps/horus/mask_swipe_circle.png | Bin 0 -> 304 bytes radio/src/bitmaps/horus/mask_swipe_left.png | Bin 0 -> 345 bytes radio/src/bitmaps/horus/mask_swipe_right.png | Bin 0 -> 315 bytes radio/src/gui/horus/bitmaps.cpp | 12 ++++++++++++ radio/src/gui/horus/bitmaps.h | 4 ++++ radio/src/gui/horus/lcd.cpp | 10 +++++----- radio/src/gui/horus/lcd.h | 17 ++++++++--------- radio/src/gui/horus/screens_setup.cpp | 17 +++++++++++------ 8 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 radio/src/bitmaps/horus/mask_swipe_circle.png create mode 100644 radio/src/bitmaps/horus/mask_swipe_left.png create mode 100644 radio/src/bitmaps/horus/mask_swipe_right.png diff --git a/radio/src/bitmaps/horus/mask_swipe_circle.png b/radio/src/bitmaps/horus/mask_swipe_circle.png new file mode 100644 index 0000000000000000000000000000000000000000..79d65cc27e6dc8827228e0aad0d795838df8b3a3 GIT binary patch literal 304 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VOR^eP*AeOHKHUqKdq!Zu_%?Hyu4g5GcUV1Ik6yBFTW^#_B$IXprW;&E{-7< zy;r9i@-Zv&uzdG8pB)qUd4tW7`;A@x7w+?Gn29ducH#`IIl6YsQul4C(|T151J6k= zopP8#L8;xDW3y31bJp4(L!kri$0Z`OWl#TP3kj`yzyHv#z28HwS_XtpcU*iv;EQ4X z%baVO^71Ov%eHL_p5)^7GC!i+t8?A_mR2uK19rQp?DMtveH+%AS_ohA^m93rpj5=X s;BR95r!Qv?Kb-Vq6W5L2Eq|Hf4k{g$eOr{Y8t8BaPgg&ebxsLQ08aODE&u=k literal 0 HcmV?d00001 diff --git a/radio/src/bitmaps/horus/mask_swipe_left.png b/radio/src/bitmaps/horus/mask_swipe_left.png new file mode 100644 index 0000000000000000000000000000000000000000..9c2aa607ba86ef8511a2a0dd45e9c232dc428cb0 GIT binary patch literal 345 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VOR^eP*AeOHKHUqKdq!Zu_%?Hyu4g5GcUV1Ik6yBFTW^#_B$IXprUJ@E{-7< zy=SlJ_O&<&v_0Hz{@UsxLyNY;hX|kcFS0ur=Wui$5#SNx;W{YF!LG1n>2oIQKPgr- z|9+XS9;)gUk*&-3`LWP%`2~i@cq?SsT>~$eoUOcg@5H|MVcEHi(V6(a5(|nBuY29`_=n&(F`d&wOGR#PvpsaLY5o&`gVRR0wjKR! zW3J#ZNrmUIg8)mOLxTa2K)c^nh literal 0 HcmV?d00001 diff --git a/radio/src/bitmaps/horus/mask_swipe_right.png b/radio/src/bitmaps/horus/mask_swipe_right.png new file mode 100644 index 0000000000000000000000000000000000000000..b470b61ff04132d66fb420f84f336efc7f37bf8a GIT binary patch literal 315 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VTavfC3&Vd9T(EcfWS|IVfk$L9 zP{(x;W^~e+T>%tiFY)wsWq-gVAZli{bjzGZpwJ0V7sn8b(|4yBaIt(zP4M5jv0TiTH$DLFGW^`U4JyTIjL_Z+?@Z}@Tfee+yNHvz$ei|szFDQ`Sy zx&Oev_kp3J=RQ9Xe(C0WS%BeE)a62%BZ8-$lX*Vb9N(7v&na>mYv!z^*zkJI=|D8Q0&Tg)}khTSc&B~e1)_{U=Y$tnkJ&Tls`3&`%x zoF&lqaI+kjV!$-jUF({sO#0fnzopr E09;{sj{pDw literal 0 HcmV?d00001 diff --git a/radio/src/gui/horus/bitmaps.cpp b/radio/src/gui/horus/bitmaps.cpp index d352fc915..08c72d601 100644 --- a/radio/src/gui/horus/bitmaps.cpp +++ b/radio/src/gui/horus/bitmaps.cpp @@ -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" +}; + diff --git a/radio/src/gui/horus/bitmaps.h b/radio/src/gui/horus/bitmaps.h index f1869b51c..c48f6506e 100644 --- a/radio/src/gui/horus/bitmaps.h +++ b/radio/src/gui/horus/bitmaps.h @@ -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_ diff --git a/radio/src/gui/horus/lcd.cpp b/radio/src/gui/horus/lcd.cpp index f4fc2be33..69c39b261 100644 --- a/radio/src/gui/horus/lcd.cpp +++ b/radio/src/gui/horus/lcd.cpp @@ -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; irefresh(); - 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