Changeset 3c54869 in mainline for uspace/app/taskbar/wndlist.c


Ignore:
Timestamp:
2023-01-04T20:24:44Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5d86797
Parents:
cdd6fc9
Message:

Highlight active window in task bar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/taskbar/wndlist.c

    rcdd6fc9 r3c54869  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    157157                if ((winfo->flags & (wndf_popup | wndf_system)) == 0) {
    158158                        rc = wndlist_append(wndlist, wlist->windows[i],
    159                             winfo->caption, false);
     159                            winfo->caption, winfo->nfocus != 0, false);
    160160                        if (rc != EOK) {
    161161                                wndmgt_free_window_info(winfo);
     
    202202 * @param wnd_id Window ID
    203203 * @param caption Entry caption
     204 * @param active @c true iff window is active
    204205 * @param paint @c true to paint immediately
    205206 * @return @c EOK on success or an error code
    206207 */
    207208errno_t wndlist_append(wndlist_t *wndlist, sysarg_t wnd_id,
    208     const char *caption, bool paint)
     209    const char *caption, bool active, bool paint)
    209210{
    210211        wndlist_entry_t *entry = NULL;
     
    230231
    231232        entry->visible = false;
     233
     234        ui_pbutton_set_light(entry->button, active);
    232235
    233236        /* Set button callbacks */
     
    382385 * @param wndlist Window list
    383386 * @param entry Window list entry
     387 * @param active @c true iff the window is active
    384388 * @return @c EOK on success or an error code
    385389 */
    386390errno_t wndlist_update(wndlist_t *wndlist, wndlist_entry_t *entry,
    387     const char *caption)
     391    const char *caption, bool active)
    388392{
    389393        errno_t rc;
     
    393397        if (rc != EOK)
    394398                return rc;
     399
     400        ui_pbutton_set_light(entry->button, active);
    395401
    396402        rc = ui_pbutton_paint(entry->button);
     
    507513
    508514        if ((winfo->flags & (wndf_popup | wndf_system)) == 0) {
    509                 rc = wndlist_append(wndlist, wnd_id, winfo->caption, true);
     515                rc = wndlist_append(wndlist, wnd_id, winfo->caption,
     516                    winfo->nfocus != 0, true);
    510517                if (rc != EOK) {
    511518                        wndmgt_free_window_info(winfo);
     
    558565                return;
    559566
    560         (void) wndlist_update(wndlist, entry, winfo->caption);
     567        (void) wndlist_update(wndlist, entry, winfo->caption,
     568            winfo->nfocus != 0);
    561569        wndmgt_free_window_info(winfo);
    562570}
Note: See TracChangeset for help on using the changeset viewer.