Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use code to draw button effect instead of pictures #718

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified src/fs/320x240x16/media/spin32.bmp
Binary file not shown.
Binary file modified src/fs/320x240x16/media/spin64.bmp
Binary file not shown.
Binary file modified src/fs/320x240x16/media/spin96.bmp
Binary file not shown.
Binary file removed src/fs/320x240x16/media/spinp32.bmp
Binary file not shown.
Binary file removed src/fs/320x240x16/media/spinp64.bmp
Binary file not shown.
Binary file removed src/fs/320x240x16/media/spinp96.bmp
Binary file not shown.
3 changes: 0 additions & 3 deletions src/gui/320x240x16/_gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ const struct ImageMap image_map[] = {
{"media/spin96" IMG_EXT, 96, 16, 0, 0}, /*FILE_SPIN96 */
{"media/spin64" IMG_EXT, 64, 16, 0, 0}, /*FILE_SPIN64 */
{"media/spin32" IMG_EXT, 32, 16, 0, 0}, /*FILE_SPIN32 */
{"media/spinp96" IMG_EXT, 96, 16, 0, 0}, /*FILE_SPINPRESS96 */
{"media/spinp64" IMG_EXT, 64, 16, 0, 0}, /*FILE_SPINPRESS64 */
{"media/spinp32" IMG_EXT, 32, 16, 0, 0}, /*FILE_SPINPRESS32 */
{"media/arrows16" IMG_EXT, 16, 16, 0, 0}, /*FILE_ARROW_16_UP */
{"media/arrows16" IMG_EXT, 16, 16, 16, 0}, /*FILE_ARROW_16_DOWN */
{"media/arrows16" IMG_EXT, 16, 16, 32, 0}, /*FILE_ARROW_16_RIGHT */
Expand Down
3 changes: 0 additions & 3 deletions src/gui/320x240x16/_gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ enum ImageNames {
FILE_SPIN96,
FILE_SPIN64,
FILE_SPIN32,
FILE_SPINPRESS96,
FILE_SPINPRESS64,
FILE_SPINPRESS32,
FILE_ARROW_16_UP,
FILE_ARROW_16_DOWN,
FILE_ARROW_16_RIGHT,
Expand Down
6 changes: 4 additions & 2 deletions src/gui/320x240x16/_textsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ void _DrawTextSelectHelper(struct guiTextSelect *select, const char *str)
#if HAS_RTC
if (select->type == TEXTSELECT_VERT_64) {
GUI_DrawImageHelper(box->x,
box->y + ARROW_HEIGHT, select->button, DRAW_NORMAL);
box->y + ARROW_HEIGHT, select->button,
select->enable & 0x02 ? DRAW_PRESSED : DRAW_NORMAL);
if (select->enable & 0x01) {
GUI_DrawImageHelper(box->x + (box->width - ARROW_WIDTH) / 2, box->y, ARROW_UP,
select->state & 0x02 ? DRAW_PRESSED : DRAW_NORMAL);
Expand All @@ -36,7 +37,8 @@ void _DrawTextSelectHelper(struct guiTextSelect *select, const char *str)
#endif
{
GUI_DrawImageHelper(box->x + ARROW_WIDTH,
box->y, select->button, DRAW_NORMAL);
box->y, select->button,
select->enable & 0x02 ? DRAW_PRESSED : DRAW_NORMAL);
if (select->enable & 0x01) {
GUI_DrawImageHelper(box->x, box->y, ARROW_LEFT,
select->state & 0x01 ? DRAW_PRESSED : DRAW_NORMAL);
Expand Down
8 changes: 4 additions & 4 deletions src/gui/textsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ void GUI_TextSelectEnablePress(guiTextSelect_t *select, u8 enable)
}
enum ImageNames fileidx;
switch (select->type) {
case TEXTSELECT_224: fileidx = FILE_SPIN192; /* enable ? FILE_SPIN192 : FILE_SPIN192;*/ break;
case TEXTSELECT_128: fileidx = enable ? FILE_SPINPRESS96 : FILE_SPIN96; break;
case TEXTSELECT_96: fileidx = enable ? FILE_SPINPRESS64 : FILE_SPIN64; break;
case TEXTSELECT_64: fileidx = enable ? FILE_SPINPRESS32 : FILE_SPIN32; break;
case TEXTSELECT_224: fileidx = FILE_SPIN192; break;
case TEXTSELECT_128: fileidx = FILE_SPIN96; break;
case TEXTSELECT_96: fileidx = FILE_SPIN64; break;
case TEXTSELECT_64: fileidx = FILE_SPIN32; break;
default: fileidx = FILE_SPIN32; break;
}
if (select->button != &image_map[fileidx]) {
Expand Down