mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:18:14 +00:00
Taskbar: Show minimized window titles in [brackets].
Had to plumb the minimization state from WindowServer to Toolbar in order to implement this.
This commit is contained in:
parent
74142d78c1
commit
ef9fbef4c6
9 changed files with 35 additions and 7 deletions
|
@ -66,12 +66,13 @@ void TaskbarWindow::wm_event(GWMEvent& event)
|
|||
}
|
||||
case GEvent::WM_WindowStateChanged: {
|
||||
auto& changed_event = static_cast<GWMWindowStateChangedEvent&>(event);
|
||||
printf("WM_WindowStateChanged: client_id=%d, window_id=%d, title=%s, rect=%s, is_active=%u\n",
|
||||
printf("WM_WindowStateChanged: client_id=%d, window_id=%d, title=%s, rect=%s, is_active=%u, is_minimized=%u\n",
|
||||
changed_event.client_id(),
|
||||
changed_event.window_id(),
|
||||
changed_event.title().characters(),
|
||||
changed_event.rect().to_string().characters(),
|
||||
changed_event.is_active()
|
||||
changed_event.is_active(),
|
||||
changed_event.is_minimized()
|
||||
);
|
||||
if (!should_include_window(changed_event.window_type()))
|
||||
break;
|
||||
|
@ -79,8 +80,16 @@ void TaskbarWindow::wm_event(GWMEvent& event)
|
|||
window.set_title(changed_event.title());
|
||||
window.set_rect(changed_event.rect());
|
||||
window.set_active(changed_event.is_active());
|
||||
window.button()->set_caption(changed_event.title());
|
||||
window.set_minimized(changed_event.is_minimized());
|
||||
if (window.is_minimized()) {
|
||||
window.button()->set_foreground_color(Color::DarkGray);
|
||||
window.button()->set_caption(String::format("[%s]", changed_event.title().characters()));
|
||||
} else {
|
||||
window.button()->set_foreground_color(Color::Black);
|
||||
window.button()->set_caption(changed_event.title());
|
||||
}
|
||||
window.button()->set_checked(changed_event.is_active());
|
||||
window.button()->update();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue