Changes in uspace/lib/gui/window.c [3e6a98c5:6d5e378] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gui/window.c
r3e6a98c5 r6d5e378 34 34 */ 35 35 36 #include < stdbool.h>36 #include <bool.h> 37 37 #include <errno.h> 38 38 #include <stdio.h> … … 66 66 67 67 static pixel_t border_color = PIXEL(255, 0, 0, 0); 68 static pixel_t header_bg_focus_color = PIXEL(255, 25, 25, 112); 69 static pixel_t header_fg_focus_color = PIXEL(255, 255, 255, 255); 70 static pixel_t header_bg_unfocus_color = PIXEL(255, 70, 130, 180); 71 static pixel_t header_fg_unfocus_color = PIXEL(255, 255, 255, 255); 68 static pixel_t header_bgcolor = PIXEL(255, 25, 25, 112); 69 static pixel_t header_fgcolor = PIXEL(255, 255, 255, 255); 72 70 73 71 static void paint_internal(widget_t *w) … … 96 94 w->vpos + w->height - border_thickness, w->width, border_thickness); 97 95 98 source_set_color(&source, 99 w->window->is_focused ? header_bg_focus_color : header_bg_unfocus_color); 96 source_set_color(&source, header_bgcolor); 100 97 drawctx_transfer(&drawctx, 101 98 w->hpos + border_thickness, w->vpos + border_thickness, … … 109 106 char cls_pict[] = "x"; 110 107 font_get_box(&font, cls_pict, &cls_width, &cls_height); 111 source_set_color(&source, 112 w->window->is_focused ? header_fg_focus_color : header_fg_unfocus_color); 108 source_set_color(&source, header_fgcolor); 113 109 sysarg_t cls_x = ((close_width - cls_width) / 2) + w->hpos + w->width - 114 110 border_thickness - close_width; … … 451 447 break; 452 448 case ET_POSITION_EVENT: 453 if (!win->is_focused) {454 win->is_focused = true;455 handle_refresh(win);456 }457 449 deliver_position_event(win, event->data.pos); 458 450 break; … … 462 454 case ET_WINDOW_RESIZE: 463 455 handle_resize(win, event->data.rsz.width, event->data.rsz.height); 464 break;465 case ET_WINDOW_FOCUS:466 if (!win->is_focused) {467 win->is_focused = true;468 handle_refresh(win);469 }470 break;471 case ET_WINDOW_UNFOCUS:472 if (win->is_focused) {473 win->is_focused = false;474 handle_refresh(win);475 }476 456 break; 477 457 case ET_WINDOW_REFRESH: … … 534 514 } 535 515 536 window_t *window_open(char *winreg, bool is_main, bool is_decorated, 537 const char *caption, sysarg_t x_offset, sysarg_t y_offset) 516 window_t *window_open(char *winreg, bool is_main, bool is_decorated, const char *caption) 538 517 { 539 518 int rc; … … 546 525 win->is_main = is_main; 547 526 win->is_decorated = is_decorated; 548 win->is_focused = true;549 527 prodcons_initialize(&win->events); 550 528 fibril_mutex_initialize(&win->guard); … … 579 557 service_id_t out_dsid; 580 558 581 rc = win_register(reg_sess, &in_dsid, &out_dsid , x_offset, y_offset);559 rc = win_register(reg_sess, &in_dsid, &out_dsid); 582 560 async_hangup(reg_sess); 583 561 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.