Changeset e0e612b in mainline for uspace/app/taskbar
- Timestamp:
- 2022-10-07T08:38:50Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0761448
- Parents:
- c77cfd8
- git-author:
- Jiri Svoboda <jiri@…> (2022-10-06 18:38:37)
- git-committer:
- Jiri Svoboda <jiri@…> (2022-10-07 08:38:50)
- Location:
- uspace/app/taskbar
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/meson.build
rc77cfd8 re0e612b 32 32 'main.c', 33 33 'taskbar.c', 34 'wndlist.c', 34 35 ) 35 36 … … 37 38 'clock.c', 38 39 'taskbar.c', 40 'wndlist.c', 39 41 'test/clock.c', 40 42 'test/main.c', 41 43 'test/taskbar.c', 44 'test/wndlist.c', 42 45 ) -
uspace/app/taskbar/taskbar.c
rc77cfd8 re0e612b 44 44 #include "clock.h" 45 45 #include "taskbar.h" 46 #include "wndlist.h" 46 47 47 48 static void wnd_close(ui_window_t *, void *); … … 135 136 } 136 137 137 rc = ui_label_create(ui_res, " Task bar!", &taskbar->label);138 rc = ui_label_create(ui_res, "HelenOS", &taskbar->label); 138 139 if (rc != EOK) { 139 140 printf("Error creating label.\n"); … … 142 143 143 144 ui_window_get_app_rect(taskbar->window, &rect); 145 if (ui_is_textmode(taskbar->ui)) { 146 rect.p0.x += 1; 147 } else { 148 rect.p0.x += 10; 149 } 144 150 ui_label_set_rect(taskbar->label, &rect); 145 ui_label_set_halign(taskbar->label, gfx_halign_ center);151 ui_label_set_halign(taskbar->label, gfx_halign_left); 146 152 ui_label_set_valign(taskbar->label, gfx_valign_center); 147 153 … … 150 156 printf("Error adding control to layout.\n"); 151 157 ui_label_destroy(taskbar->label); 158 goto error; 159 } 160 161 rc = wndlist_create(ui_res, taskbar->fixed, &taskbar->wndlist); 162 if (rc != EOK) { 163 printf("Error creating window list.\n"); 164 goto error; 165 } 166 167 rc = wndlist_append(taskbar->wndlist, "Text Editor"); 168 if (rc != EOK) { 169 printf("Error adding window list entry.\n"); 152 170 goto error; 153 171 } … … 191 209 if (taskbar->clock != NULL) 192 210 taskbar_clock_destroy(taskbar->clock); 211 if (taskbar->wndlist != NULL) 212 wndlist_destroy(taskbar->wndlist); 193 213 if (taskbar->window != NULL) 194 214 ui_window_destroy(taskbar->window); -
uspace/app/taskbar/taskbar.h
rc77cfd8 re0e612b 1 1 /* 2 * Copyright (c) 202 0Jiri Svoboda2 * Copyright (c) 2022 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 40 40 #include "types/taskbar.h" 41 41 42 e rrno_t taskbar_create(const char *display_spec, taskbar_t **);43 void taskbar_destroy(taskbar_t *);42 extern errno_t taskbar_create(const char *display_spec, taskbar_t **); 43 extern void taskbar_destroy(taskbar_t *); 44 44 45 45 #endif -
uspace/app/taskbar/test/main.c
rc77cfd8 re0e612b 33 33 PCUT_IMPORT(clock); 34 34 PCUT_IMPORT(taskbar); 35 PCUT_IMPORT(wndlist); 35 36 36 37 PCUT_MAIN(); -
uspace/app/taskbar/types/taskbar.h
rc77cfd8 re0e612b 42 42 #include <ui/window.h> 43 43 #include "clock.h" 44 #include "wndlist.h" 44 45 45 46 /** Task bar */ 46 typedef struct {47 typedef struct taskbar { 47 48 /** User interface */ 48 49 ui_t *ui; … … 52 53 ui_fixed_t *fixed; 53 54 ui_label_t *label; 55 /** Window list */ 56 wndlist_t *wndlist; 54 57 /** Clock */ 55 58 taskbar_clock_t *clock;
Note:
See TracChangeset
for help on using the changeset viewer.