mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +00:00
WindowServer: Add a window minimization button.
The window is simply ignored in the painting and hit testing traversal when in minimized state, same as we do for invisible windows. The WM_SetActiveWindow message (sent by Taskbar) brings it back into the non-minimized state. :^)
This commit is contained in:
parent
0fc3ccaa52
commit
f6ca94605c
6 changed files with 49 additions and 3 deletions
|
@ -26,15 +26,39 @@ static CharacterBitmap* s_close_button_bitmap;
|
|||
static const int s_close_button_bitmap_width = 8;
|
||||
static const int s_close_button_bitmap_height = 9;
|
||||
|
||||
static const char* s_minimize_button_bitmap_data = {
|
||||
" "
|
||||
" "
|
||||
"## ##"
|
||||
"### ###"
|
||||
" ###### "
|
||||
" #### "
|
||||
" ## "
|
||||
" "
|
||||
" "
|
||||
};
|
||||
|
||||
static CharacterBitmap* s_minimize_button_bitmap;
|
||||
static const int s_minimize_button_bitmap_width = 8;
|
||||
static const int s_minimize_button_bitmap_height = 9;
|
||||
|
||||
|
||||
WSWindowFrame::WSWindowFrame(WSWindow& window)
|
||||
: m_window(window)
|
||||
{
|
||||
if (!s_close_button_bitmap)
|
||||
s_close_button_bitmap = &CharacterBitmap::create_from_ascii(s_close_button_bitmap_data, s_close_button_bitmap_width, s_close_button_bitmap_height).leak_ref();
|
||||
|
||||
if (!s_minimize_button_bitmap)
|
||||
s_minimize_button_bitmap = &CharacterBitmap::create_from_ascii(s_minimize_button_bitmap_data, s_minimize_button_bitmap_width, s_minimize_button_bitmap_height).leak_ref();
|
||||
|
||||
m_buttons.append(make<WSButton>(*this, *s_close_button_bitmap, [this] {
|
||||
m_window.on_message(WSMessage(WSMessage::WindowCloseRequest));
|
||||
}));
|
||||
|
||||
m_buttons.append(make<WSButton>(*this, *s_minimize_button_bitmap, [this] {
|
||||
m_window.set_minimized(true);
|
||||
}));
|
||||
}
|
||||
|
||||
WSWindowFrame::~WSWindowFrame()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue