summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/pluginlib_touchscreen.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib/pluginlib_touchscreen.c')
-rw-r--r--apps/plugins/lib/pluginlib_touchscreen.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/plugins/lib/pluginlib_touchscreen.c b/apps/plugins/lib/pluginlib_touchscreen.c
index 1e1bf8d3c2..3920b8ec18 100644
--- a/apps/plugins/lib/pluginlib_touchscreen.c
+++ b/apps/plugins/lib/pluginlib_touchscreen.c
@@ -88,7 +88,8 @@ void touchbutton_draw(struct touchbutton *data, int num_buttons) {
88 int i; 88 int i;
89 /* These store the width and height of the title offset */ 89 /* These store the width and height of the title offset */
90 int title_width, title_height; 90 int title_width, title_height;
91 91 struct screen *lcd = rb->screens[SCREEN_MAIN];
92
92 /* Loop over all the elements in data */ 93 /* Loop over all the elements in data */
93 for(i=0; i<num_buttons; i++) { 94 for(i=0; i<num_buttons; i++) {
94 /* Is this a visible button? */ 95 /* Is this a visible button? */
@@ -96,10 +97,10 @@ void touchbutton_draw(struct touchbutton *data, int num_buttons) {
96 /* Set the current viewport to the button so that all drawing 97 /* Set the current viewport to the button so that all drawing
97 * operations are within the button location. 98 * operations are within the button location.
98 */ 99 */
99 rb->screens[SCREEN_MAIN]->set_viewport(&data[i].vp); 100 lcd->set_viewport(&data[i].vp);
100 101
101 /* Get the string size so that the title can be centered. */ 102 /* Get the string size so that the title can be centered. */
102 rb->lcd_getstringsize(data[i].title, &title_width, &title_height); 103 lcd->getstringsize(data[i].title, &title_width, &title_height);
103 104
104 /* Center the title vertically */ 105 /* Center the title vertically */
105 title_height=(data[i].vp.height-title_height)/2; 106 title_height=(data[i].vp.height-title_height)/2;
@@ -121,16 +122,17 @@ void touchbutton_draw(struct touchbutton *data, int num_buttons) {
121 * print the title. 122 * print the title.
122 */ 123 */
123 if(title_width==0) { 124 if(title_width==0) {
124 rb->lcd_puts_scroll(0, 0, data[i].title); 125 lcd->puts_scroll_style_xyoffset(0, 0, data[i].title,
126 STYLE_DEFAULT, 0, title_height);
125 } else { 127 } else {
126 rb->lcd_putsxy(title_width, title_height, data[i].title); 128 lcd->putsxy(title_width, title_height, data[i].title);
127 } 129 }
128 130
129 /* Draw bounding box around the button location. */ 131 /* Draw bounding box around the button location. */
130 rb->lcd_drawrect( 0, 0, data[i].vp.width, data[i].vp.height); 132 lcd->draw_viewport(NULL);
131 } 133 }
132 } 134 }
133 rb->screens[SCREEN_MAIN]->set_viewport(NULL); /* Go back to the default viewport */ 135 lcd->set_viewport(NULL); /* Go back to the default viewport */
134} 136}
135 137
136/******************************************************************************* 138/*******************************************************************************