Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
a591b26d
Commit
a591b26d
authored
Aug 31, 2014
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
menu & status_bar: Added a few defines for dimensions.
parent
2e5d111a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
menu.c
sw/freertos/src/apps/menu.c
+8
-6
status_bar.c
sw/freertos/src/apps/widgets/status_bar.c
+1
-1
status_bar.h
sw/freertos/src/apps/widgets/status_bar.h
+3
-0
No files found.
sw/freertos/src/apps/menu.c
View file @
a591b26d
...
...
@@ -32,10 +32,11 @@ static int selected_item = 0;
static
int
offset
=
0
;
static
int
menu_size
=
0
;
#define LINE_HEIGHT 17
#define LEFT_MARGIN 17
#define MENU_SCREEN_HEIGHT 107
#define MAX_ENTRIES (MENU_SCREEN_HEIGHT / LINE_HEIGHT)
#define LINE_HEIGHT 17
#define LEFT_MARGIN 17
#define MENU_SCREEN_HEIGHT 107
#define MENU_SCREEN_WIDTH 127
#define MAX_ENTRIES (MENU_SCREEN_HEIGHT / LINE_HEIGHT)
// store menu states to navigate between menus
static
menu_list
*
menu_stack
[
8
]
=
{
&
main_menu
,
NULL
,
};
...
...
@@ -54,7 +55,7 @@ static void menu_screen_redraw(struct ui_widget *w)
// draw a white background for the selected entry
if
(
pos
==
selected_item
)
{
gfx_box
(
&
w
->
dc
,
LEFT_MARGIN
,
i
*
LINE_HEIGHT
,
127
,
(
i
+
1
)
*
LINE_HEIGHT
,
1
);
MENU_SCREEN_WIDTH
,
(
i
+
1
)
*
LINE_HEIGHT
,
1
);
}
menu_entry
*
ent
=
&
(
*
current_menu
)
->
entries
[
pos
];
...
...
@@ -107,7 +108,8 @@ static void menu_screen_event(struct ui_widget *w, const struct event *evt)
struct
ui_widget
menu_screen
=
{
menu_screen_redraw
,
menu_screen_event
,
{
0
,
20
,
127
,
20
+
MENU_SCREEN_HEIGHT
},
{
0
,
STATUS_BAR_HEIGHT
,
MENU_SCREEN_WIDTH
,
STATUS_BAR_HEIGHT
+
MENU_SCREEN_HEIGHT
},
0
,
WF_ACTIVE
|
WF_VISIBLE
};
...
...
sw/freertos/src/apps/widgets/status_bar.c
View file @
a591b26d
...
...
@@ -34,7 +34,7 @@ static void status_bar_event(struct ui_widget *w, const struct event *evt)
static
void
status_bar_redraw
(
struct
ui_widget
*
w
)
{
gfx_round_box
(
&
w
->
dc
,
30
,
-
10
,
127
-
30
,
10
,
9
,
COLOR_BLACK
);
gfx_round_box
(
&
w
->
dc
,
30
,
-
10
,
127
-
30
,
10
,
9
,
COLOR_BLACK
);
gfx_centered_text
(
&
w
->
dc
,
&
font_helv11
,
0
,
"Home"
,
1
);
}
...
...
sw/freertos/src/apps/widgets/status_bar.h
View file @
a591b26d
...
...
@@ -27,5 +27,8 @@
#include <gfx/ui.h>
///> Height of the status bar
#define STATUS_BAR_HEIGHT 20
struct
ui_widget
status_bar
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment