* Set the shaded state of the window to \a make_shaded. * @param make_shaded If \c true, shade the window (roll up until just the title bar is visible), else unshade/unroll the window to its original size. * @note The method uses #Window::ReInit(), thus after the call, the whole window should be considered changed. */
| 1021 | * @note The method uses #Window::ReInit(), thus after the call, the whole window should be considered changed. |
| 1022 | */ |
| 1023 | void Window::SetShaded(bool make_shaded) |
| 1024 | { |
| 1025 | if (this->shade_select == nullptr) return; |
| 1026 | |
| 1027 | int desired = make_shaded ? SZSP_HORIZONTAL : 0; |
| 1028 | if (this->shade_select->shown_plane != desired) { |
| 1029 | if (make_shaded) { |
| 1030 | if (this->nested_focus != nullptr) this->UnfocusFocusedWidget(); |
| 1031 | this->unshaded_size.width = this->width; |
| 1032 | this->unshaded_size.height = this->height; |
| 1033 | this->shade_select->SetDisplayedPlane(desired); |
| 1034 | this->ReInit(0, -this->height); |
| 1035 | } else { |
| 1036 | this->shade_select->SetDisplayedPlane(desired); |
| 1037 | int dx = ((int)this->unshaded_size.width > this->width) ? (int)this->unshaded_size.width - this->width : 0; |
| 1038 | int dy = ((int)this->unshaded_size.height > this->height) ? (int)this->unshaded_size.height - this->height : 0; |
| 1039 | this->ReInit(dx, dy); |
| 1040 | } |
| 1041 | } |
| 1042 | } |
| 1043 | |
| 1044 | /** |
| 1045 | * Find the Window whose parent pointer points to this window |
no test coverage detected