| 70 | } |
| 71 | |
| 72 | wf::Rect FramelessPage::TitlebarButtonsRegion() |
| 73 | { |
| 74 | const bool closable = IsClosable(); |
| 75 | if (!ExpandIntoTitlebar() || (closable == false && m_TitlebarContent.Size() == 0)) |
| 76 | { |
| 77 | return { 0.0f, 0.0f, 0.0f, 0.0f }; |
| 78 | } |
| 79 | else |
| 80 | { |
| 81 | double height = 0.0f; |
| 82 | double width = 0.0f; |
| 83 | if (closable) |
| 84 | { |
| 85 | const auto closeButton = CloseButton(); |
| 86 | |
| 87 | width += closeButton.ActualWidth(); |
| 88 | height = std::max(height, closeButton.ActualHeight()); |
| 89 | } |
| 90 | |
| 91 | for (const auto button : m_TitlebarContent) |
| 92 | { |
| 93 | width += button.ActualWidth(); |
| 94 | height = std::max(height, button.ActualHeight()); |
| 95 | } |
| 96 | |
| 97 | return { |
| 98 | FlowDirection() == wux::FlowDirection::LeftToRight ? static_cast<float>(ActualWidth() - width) : 0.0f, |
| 99 | 0.0f, |
| 100 | static_cast<float>(width), |
| 101 | static_cast<float>(height) |
| 102 | }; |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | bool FramelessPage::RequestClose() |
| 107 | { |