From: Nils Faerber Date: Sat, 6 Jul 2013 21:21:35 +0000 (+0200) Subject: Some minor improvements. X-Git-Url: https://git.karo-electronics.de/?p=oswald.git;a=commitdiff_plain;h=5cb2f89d7c30198f08f6b11b558e84e884adbfc7 Some minor improvements. --- diff --git a/ui/oswald-ui.c b/ui/oswald-ui.c index 9d7e575..74d5676 100644 --- a/ui/oswald-ui.c +++ b/ui/oswald-ui.c @@ -23,13 +23,14 @@ static oswald_ui *ui_g; -void hal_lcd_set_pixel(gint x, gint y, gboolean state) +void hal_lcd_set_pixel(gint x, gint y, uint8_t state) { gint ix, iy; ix = x*2; iy = y*2; + // we double all pixel to get a bigger picture gdk_draw_point(GDK_DRAWABLE(ui_g->pixmap), state ? ui_g->darea->style->black_gc : ui_g->darea->style->white_gc, ix, iy); gdk_draw_point(GDK_DRAWABLE(ui_g->pixmap), state ? ui_g->darea->style->black_gc : ui_g->darea->style->white_gc, ix+1, iy); gdk_draw_point(GDK_DRAWABLE(ui_g->pixmap), state ? ui_g->darea->style->black_gc : ui_g->darea->style->white_gc, ix, iy+1); diff --git a/ui/oswald_graphics.c b/ui/oswald_graphics.c index 651d8e8..78e3659 100644 --- a/ui/oswald_graphics.c +++ b/ui/oswald_graphics.c @@ -94,7 +94,7 @@ void oswald_draw_line(const uint8_t xstart, const uint8_t ystart, const uint8_t void oswald_draw_line_ww(const uint8_t xstart, const uint8_t ystart, const uint8_t xend, const uint8_t yend, const uint8_t thickness) { - int i, x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err; + int16_t i, x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err; dx = xend - xstart; dy = yend - ystart; @@ -110,17 +110,17 @@ void oswald_draw_line_ww(const uint8_t xstart, const uint8_t ystart, const uint8 if (dx>dy) { pdx = incx; pdy = 0; - ddx=incx; - ddy=incy; - es =dy; - el =dx; + ddx = incx; + ddy = incy; + es = dy; + el = dx; } else { - pdx=0; - pdy=incy; - ddx=incx; - ddy=incy; - es =dx; - el =dy; + pdx = 0; + pdy = incy; + ddx = incx; + ddy = incy; + es = dx; + el = dy; } x = xstart; diff --git a/ui/oswald_graphics.h b/ui/oswald_graphics.h index d23ebcb..216665e 100644 --- a/ui/oswald_graphics.h +++ b/ui/oswald_graphics.h @@ -9,7 +9,7 @@ #define COLOR_WHITE 0 -//#define COLOR_BLACK 1 +#define COLOR_BLACK 1 #define COLOR_XOR 2 #define COLOR_INV 3 diff --git a/ui/oswald_screens.c b/ui/oswald_screens.c index ab71408..680b5ba 100644 --- a/ui/oswald_screens.c +++ b/ui/oswald_screens.c @@ -190,8 +190,8 @@ static main_menu_data_t main_menu_screen = { // GRID_Y is +1 since there is one empty row for title icon #define MAIN_MENU_GRID_Y 3 #define MAIN_MENU_GRID_SPACING 0 -#define MAIN_MENU_OFFSET_X 3 -#define MAIN_MENU_OFFSET_Y 10 +#define MAIN_MENU_OFFSET_X 6 +#define MAIN_MENU_OFFSET_Y 8 void draw_main_menu_screen(main_menu_data_t *sdata) { @@ -237,6 +237,20 @@ void draw_main_menu_screen(main_menu_data_t *sdata) hal_lcd_set_pixel(MAIN_MENU_OFFSET_X+23+((pf%MAIN_MENU_GRID_X) * (MAIN_MENU_GRID_PIXEL / MAIN_MENU_GRID_X)) % (MAIN_MENU_GRID_X*(MAIN_MENU_GRID_PIXEL / MAIN_MENU_GRID_X)), MAIN_MENU_OFFSET_Y+23+((pf/MAIN_MENU_GRID_X) * (MAIN_MENU_GRID_PIXEL / MAIN_MENU_GRID_Y)) % (MAIN_MENU_GRID_Y*(MAIN_MENU_GRID_PIXEL / MAIN_MENU_GRID_Y)), FALSE); + + // finally a nice border + oswald_draw_line(3, 0, 95, 0); + oswald_draw_line(2, 1, 95, 1); + oswald_draw_line(1, 2, 95, 2); + + oswald_draw_line(0, 3, 0, 92); + oswald_draw_line(1, 3, 1, 93); + oswald_draw_line(2, 3, 2, 94); + + oswald_draw_line(1, 93, 95, 93); + oswald_draw_line(2, 94, 95, 94); + oswald_draw_line(3, 95, 95, 95); + hal_lcd_update_display(); } diff --git a/ui/oswald_watch_faces.c b/ui/oswald_watch_faces.c index 284323a..b955c74 100644 --- a/ui/oswald_watch_faces.c +++ b/ui/oswald_watch_faces.c @@ -271,13 +271,22 @@ void DrawLcdDigitalClock(boolean show_seconds) gRow = 0; gColumn = 45; for (i=0; i 90) { gRow = 0; gColumn += 9; } + // OK, screen ends, leave the loop, no matter what if (gColumn > 86) i = 255; }