Changeset 50a16d9 in mainline
- Timestamp:
- 2022-09-26T11:58:09Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3fd38b2
- Parents:
- 2139676
- git-author:
- Jiri Svoboda <jiri@…> (2022-09-24 23:57:50)
- git-committer:
- Jiri Svoboda <jiri@…> (2022-09-26 11:58:09)
- Location:
- uspace
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/meson.build
r2139676 r50a16d9 29 29 deps = [ 'ui' ] 30 30 src = files( 31 'clock.c', 31 32 'main.c', 32 33 'taskbar.c', -
uspace/app/taskbar/taskbar.c
r2139676 r50a16d9 42 42 #include <ui/ui.h> 43 43 #include <ui/window.h> 44 #include "clock.h" 44 45 #include "taskbar.h" 45 46 … … 96 97 params.rect.p0.x = 0; 97 98 params.rect.p0.y = 0; 98 params.rect.p1.x = 24; 99 params.rect.p1.y = 5; 99 params.rect.p1.x = 80; 100 params.rect.p1.y = 1; 101 params.style &= ~ui_wds_frame; 100 102 } else { 101 103 params.rect.p0.x = 0; … … 138 140 } 139 141 142 rc = taskbar_clock_create(taskbar->window, &taskbar->clock); 143 if (rc != EOK) 144 goto error; 145 146 rect.p0.x = 1024 - 80; 147 rect.p0.y = 4; 148 rect.p1.x = 1024 - 4; 149 rect.p1.y = 32 - 4; 150 taskbar_clock_set_rect(taskbar->clock, &rect); 151 152 rc = ui_fixed_add(taskbar->fixed, taskbar_clock_ctl(taskbar->clock)); 153 if (rc != EOK) { 154 printf("Error adding control to layout.\n"); 155 taskbar_clock_destroy(taskbar->clock); 156 goto error; 157 } 158 140 159 ui_window_add(taskbar->window, ui_fixed_ctl(taskbar->fixed)); 141 160 … … 149 168 return EOK; 150 169 error: 170 if (taskbar->clock != NULL) 171 taskbar_clock_destroy(taskbar->clock); 151 172 if (taskbar->window != NULL) 152 173 ui_window_destroy(taskbar->window); … … 160 181 void taskbar_destroy(taskbar_t *taskbar) 161 182 { 183 taskbar_clock_destroy(taskbar->clock); 162 184 ui_window_destroy(taskbar->window); 163 185 ui_destroy(taskbar->ui); -
uspace/app/taskbar/types/taskbar.h
r2139676 r50a16d9 41 41 #include <ui/ui.h> 42 42 #include <ui/window.h> 43 #include "clock.h" 43 44 44 45 /** Task bar */ … … 51 52 ui_fixed_t *fixed; 52 53 ui_label_t *label; 54 /** Clock */ 55 taskbar_clock_t *clock; 53 56 } taskbar_t; 54 57 -
uspace/lib/ui/include/ui/resource.h
r2139676 r50a16d9 38 38 39 39 #include <errno.h> 40 #include <gfx/color.h> 40 41 #include <gfx/context.h> 41 42 #include <gfx/font.h> … … 49 50 extern void ui_resource_expose(ui_resource_t *); 50 51 extern gfx_font_t *ui_resource_get_font(ui_resource_t *); 52 extern gfx_color_t *ui_resource_get_wnd_face_color(ui_resource_t *); 53 extern gfx_color_t *ui_resource_get_wnd_text_color(ui_resource_t *); 51 54 52 55 #endif -
uspace/lib/ui/src/resource.c
r2139676 r50a16d9 677 677 } 678 678 679 /** Get the UI window face color. 680 * 681 * @param resource UI resource 682 * @return UI window face color 683 */ 684 gfx_color_t *ui_resource_get_wnd_face_color(ui_resource_t *resource) 685 { 686 return resource->wnd_face_color; 687 } 688 689 /** Get the UI window text color. 690 * 691 * @param resource UI resource 692 * @return UI window text color 693 */ 694 gfx_color_t *ui_resource_get_wnd_text_color(ui_resource_t *resource) 695 { 696 return resource->wnd_text_color; 697 } 698 679 699 /** @} 680 700 */
Note:
See TracChangeset
for help on using the changeset viewer.