summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/line.c3
-rw-r--r--apps/gui/line.h24
2 files changed, 24 insertions, 3 deletions
diff --git a/apps/gui/line.c b/apps/gui/line.c
index 9374279b60..3d563d171c 100644
--- a/apps/gui/line.c
+++ b/apps/gui/line.c
@@ -264,7 +264,6 @@ static void style_line(struct screen *display,
264 int style = line->style; 264 int style = line->style;
265 int width = display->getwidth(); 265 int width = display->getwidth();
266 int height = line->height == -1 ? display->getcharheight() : line->height; 266 int height = line->height == -1 ? display->getcharheight() : line->height;
267 unsigned mask = STYLE_MODE_MASK & ~STYLE_COLORED;
268 267
269 /* mask out gradient and colorbar styles for non-color displays */ 268 /* mask out gradient and colorbar styles for non-color displays */
270 if (display->depth < 16) 269 if (display->depth < 16)
@@ -277,7 +276,7 @@ static void style_line(struct screen *display,
277 style &= ~STYLE_COLORED; 276 style &= ~STYLE_COLORED;
278 } 277 }
279 278
280 switch (style & mask) 279 switch (style & _STYLE_DECO_MASK)
281 { 280 {
282#if (LCD_DEPTH > 1 || (defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1)) 281#if (LCD_DEPTH > 1 || (defined(LCD_REMOTE_DEPTH) && LCD_REMOTE_DEPTH > 1))
283 case STYLE_GRADIENT: 282 case STYLE_GRADIENT:
diff --git a/apps/gui/line.h b/apps/gui/line.h
index d5350eb410..fa1522003c 100644
--- a/apps/gui/line.h
+++ b/apps/gui/line.h
@@ -29,6 +29,28 @@
29#include "lcd.h" 29#include "lcd.h"
30#include "screens.h" 30#include "screens.h"
31 31
32/* Possible line decoration styles. Specify one of
33 * STYLE_NONE, _DEFAULT, _INVERT, _COLORBAR or _GRADIENT, and optionally
34 * or with STYLE_COLORED specifying line_desc.text_color */
35enum line_styles {
36 /* Just print the text. Do not clear or draw line decorations */
37 STYLE_NONE = 0x00,
38 /* Line background filled with the bg color (or backdrop if present) */
39 STYLE_DEFAULT = 0x01,
40 /* Like STYLE_DFEAULT except that text and background color will be swapped */
41 STYLE_INVERT = 0x02,
42 /* Line background filled with line color line_desc.line_color */
43 STYLE_COLORBAR = 0x04,
44 /* Line background filled with gradient, colors taken from
45 * line_desc.line_color and line_desc.line_end_color */
46 STYLE_GRADIENT = 0x08,
47 /* Modifier for the text color, which will be taken from line_desc.text_color */
48 STYLE_COLORED = 0x10,
49 /* These are used internally */
50 _STYLE_DECO_MASK = 0x0f,
51 _STYLE_MODE_MASK = 0x7F,
52};
53
32struct line_desc { 54struct line_desc {
33 /* height of the line (in pixels). -1 to inherit the height 55 /* height of the line (in pixels). -1 to inherit the height
34 * from the font. The text will be centered if the height is larger, 56 * from the font. The text will be centered if the height is larger,
@@ -49,7 +71,7 @@ struct line_desc {
49 * lcd format (convert with LCD_RGBPACK() if necessary) */ 71 * lcd format (convert with LCD_RGBPACK() if necessary) */
50 fb_data line_color, line_end_color; 72 fb_data line_color, line_end_color;
51 /* line decorations, see STYLE_DEFAULT etc. */ 73 /* line decorations, see STYLE_DEFAULT etc. */
52 int style; 74 enum line_styles style;
53 /* whether the line can scroll */ 75 /* whether the line can scroll */
54 bool scroll; 76 bool scroll;
55}; 77};