| 2843 | } |
| 2844 | |
| 2845 | void ImageViewer::updateLayout() { |
| 2846 | int sidebarWidth = visibleSidebarWidth(); |
| 2847 | int footerHeight = visibleFooterHeight(); |
| 2848 | mImageCanvas->set_fixed_size(m_size - Vector2i{sidebarWidth, footerHeight}); |
| 2849 | mSidebar->set_fixed_height(m_size.y() - footerHeight); |
| 2850 | |
| 2851 | mVerticalScreenSplit->set_fixed_size(m_size); |
| 2852 | mImageScrollContainer->set_fixed_height(m_size.y() - mImageScrollContainer->position().y() - footerHeight); |
| 2853 | |
| 2854 | if (mImageScrollContainer->fixed_height() < 100) { |
| 2855 | // Stop scrolling the image button container and instead scroll the entire sidebar |
| 2856 | mImageScrollContainer->set_fixed_height(0); |
| 2857 | } |
| 2858 | |
| 2859 | mSidebarLayout->parent()->set_height(mSidebarLayout->preferred_size(m_nvg_context).y()); |
| 2860 | perform_layout(); |
| 2861 | |
| 2862 | mSidebarLayout->set_fixed_width(mSidebarLayout->parent()->width()); |
| 2863 | mHelpButton->set_position(Vector2i{mSidebarLayout->fixed_width() - 38, 5}); |
| 2864 | mFilter->set_fixed_width(mSidebarLayout->fixed_width() - 50); |
| 2865 | perform_layout(); |
| 2866 | |
| 2867 | // With a changed layout the relative position of the mouse |
| 2868 | // within children changes and therefore should get updated. |
| 2869 | // nanogui does not handle this for us. |
| 2870 | double x, y; |
| 2871 | glfwGetCursorPos(m_glfw_window, &x, &y); |
| 2872 | cursor_pos_callback_event(x, y); |
| 2873 | } |
| 2874 | |
| 2875 | void ImageViewer::updateTitle() { |
| 2876 | if (!mCurrentImage) { |
nothing calls this directly
no outgoing calls
no test coverage detected