diff options
Diffstat (limited to 'apps/gui/buttonbar.c')
-rw-r--r-- | apps/gui/buttonbar.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/apps/gui/buttonbar.c b/apps/gui/buttonbar.c index 45dc056232..1f6d35700c 100644 --- a/apps/gui/buttonbar.c +++ b/apps/gui/buttonbar.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) Linus Nielsen Feltzing (2002), Kevin FERRARE (2005) | 10 | * Copyright (C) Linus Nielsen Feltzing (2002) |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
@@ -16,7 +16,13 @@ | |||
16 | * KIND, either express or implied. | 16 | * KIND, either express or implied. |
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | 19 | /* | |
20 | 2005 Kevin Ferrare : | ||
21 | - Multi screen support | ||
22 | - Rewrote a lot of code to avoid global vars and make it accept eventually | ||
23 | more that 3 buttons on the bar (just the prototype of gui_buttonbar_set | ||
24 | and the constant BUTTONBAR_MAX_BUTTONS to modify) | ||
25 | */ | ||
20 | #include "config.h" | 26 | #include "config.h" |
21 | #include "buttonbar.h" | 27 | #include "buttonbar.h" |
22 | 28 | ||
@@ -43,8 +49,7 @@ void gui_buttonbar_draw_button(struct gui_buttonbar * buttonbar, int num) | |||
43 | int xpos, ypos, button_width, text_width; | 49 | int xpos, ypos, button_width, text_width; |
44 | int fw, fh; | 50 | int fw, fh; |
45 | struct screen * display = buttonbar->display; | 51 | struct screen * display = buttonbar->display; |
46 | 52 | ||
47 | display->setfont(FONT_SYSFIXED); | ||
48 | display->getstringsize("M", &fw, &fh); | 53 | display->getstringsize("M", &fw, &fh); |
49 | 54 | ||
50 | button_width = display->width/BUTTONBAR_MAX_BUTTONS; | 55 | button_width = display->width/BUTTONBAR_MAX_BUTTONS; |
@@ -62,7 +67,6 @@ void gui_buttonbar_draw_button(struct gui_buttonbar * buttonbar, int num) | |||
62 | display->set_drawmode(DRMODE_COMPLEMENT); | 67 | display->set_drawmode(DRMODE_COMPLEMENT); |
63 | display->fillrect(xpos, ypos, button_width - 1, fh); | 68 | display->fillrect(xpos, ypos, button_width - 1, fh); |
64 | display->set_drawmode(DRMODE_SOLID); | 69 | display->set_drawmode(DRMODE_SOLID); |
65 | display->setfont(FONT_UI); | ||
66 | } | 70 | } |
67 | 71 | ||
68 | void gui_buttonbar_set(struct gui_buttonbar * buttonbar, | 72 | void gui_buttonbar_set(struct gui_buttonbar * buttonbar, |
@@ -99,7 +103,8 @@ void gui_buttonbar_draw(struct gui_buttonbar * buttonbar) | |||
99 | { | 103 | { |
100 | struct screen * display = buttonbar->display; | 104 | struct screen * display = buttonbar->display; |
101 | int i; | 105 | int i; |
102 | 106 | display->setfont(FONT_SYSFIXED); | |
107 | |||
103 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 108 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
104 | display->fillrect(0, display->height - BUTTONBAR_HEIGHT, | 109 | display->fillrect(0, display->height - BUTTONBAR_HEIGHT, |
105 | display->width, BUTTONBAR_HEIGHT); | 110 | display->width, BUTTONBAR_HEIGHT); |
@@ -109,6 +114,7 @@ void gui_buttonbar_draw(struct gui_buttonbar * buttonbar) | |||
109 | gui_buttonbar_draw_button(buttonbar, i); | 114 | gui_buttonbar_draw_button(buttonbar, i); |
110 | display->update_rect(0, display->height - BUTTONBAR_HEIGHT, | 115 | display->update_rect(0, display->height - BUTTONBAR_HEIGHT, |
111 | display->width, BUTTONBAR_HEIGHT); | 116 | display->width, BUTTONBAR_HEIGHT); |
117 | display->setfont(FONT_UI); | ||
112 | } | 118 | } |
113 | 119 | ||
114 | bool gui_buttonbar_isset(struct gui_buttonbar * buttonbar) | 120 | bool gui_buttonbar_isset(struct gui_buttonbar * buttonbar) |