diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Applications/3DFileViewer/main.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp index 870381c97d..a3bae3e2d4 100644 --- a/Userland/Applications/3DFileViewer/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -80,6 +80,7 @@ private: } virtual void paint_event(GUI::PaintEvent&) override; + virtual void resize_event(GUI::ResizeEvent&) override; virtual void timer_event(Core::TimerEvent&) override; virtual void mousemove_event(GUI::MouseEvent&) override; virtual void mousewheel_event(GUI::MouseEvent&) override; @@ -118,6 +119,14 @@ void GLContextWidget::paint_event(GUI::PaintEvent& event) painter.draw_scaled_bitmap(frame_inner_rect(), *m_bitmap, m_bitmap->rect()); } +void GLContextWidget::resize_event(GUI::ResizeEvent& event) +{ + GUI::Frame::resize_event(event); + + if (m_stats) + m_stats->set_x(width() - m_stats->width()); +}; + void GLContextWidget::mousemove_event(GUI::MouseEvent& event) { if (event.buttons() == GUI::MouseButton::Left) { @@ -259,7 +268,7 @@ int main(int argc, char** argv) time.set_visible(false); time.set_foreground_role(ColorRole::HoverHighlight); time.set_relative_rect({ 0, 8, 86, 10 }); - time.move_by({ window->width() - time.width(), 0 }); + time.set_x(widget.width() - time.width()); widget.set_stat_label(time); auto& file_menu = window->add_menu("&File"); |