|
@@ -78,7 +78,7 @@ int main(int argc, char** argv)
|
|
|
auto& main_toolbar = toolbar_container.add<GUI::Toolbar>();
|
|
|
|
|
|
auto& widget = root_widget.add<ViewWidget>();
|
|
|
- widget.on_scale_change = [&](int scale, Gfx::IntRect rect) {
|
|
|
+ widget.on_scale_change = [&](int scale) {
|
|
|
if (!widget.bitmap()) {
|
|
|
window->set_title("Image Viewer");
|
|
|
return;
|
|
@@ -86,17 +86,9 @@ int main(int argc, char** argv)
|
|
|
|
|
|
window->set_title(String::formatted("{} {} {}% - Image Viewer", widget.path(), widget.bitmap()->size().to_string(), scale));
|
|
|
|
|
|
- if (window->is_fullscreen())
|
|
|
- return;
|
|
|
-
|
|
|
- if (window->is_maximized())
|
|
|
- return;
|
|
|
-
|
|
|
if (scale == 100 && !widget.scaled_for_first_image()) {
|
|
|
widget.set_scaled_for_first_image(true);
|
|
|
- auto w = min(GUI::Desktop::the().rect().width(), rect.width() + 4);
|
|
|
- auto h = min(GUI::Desktop::the().rect().height(), rect.height() + widget.toolbar_height() + 6);
|
|
|
- window->resize(w, h);
|
|
|
+ widget.resize_window();
|
|
|
}
|
|
|
};
|
|
|
widget.on_drop = [&](auto& event) {
|