File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -373,17 +373,10 @@ def set_window_title(self, title):
373
373
def resize (self , width , height ):
374
374
"""Set the canvas size in pixels."""
375
375
if self .toolbar :
376
- toolbar_size = self .toolbar .size_request ()
377
- height += toolbar_size .height
376
+ min_size , nat_size = self .toolbar .get_preferred_size ()
377
+ height += nat_size .height
378
378
canvas_size = self .canvas .get_allocation ()
379
- if canvas_size .width == canvas_size .height == 1 :
380
- # A canvas size of (1, 1) cannot exist in most cases, because
381
- # window decorations would prevent such a small window. This call
382
- # must be before the window has been mapped and widgets have been
383
- # sized, so just change the window's starting size.
384
- self .window .set_default_size (width , height )
385
- else :
386
- self .window .resize (width , height )
379
+ self .window .set_default_size (width , height )
387
380
388
381
389
382
class NavigationToolbar2GTK4 (_NavigationToolbar2GTK , Gtk .Box ):
You can’t perform that action at this time.
0 commit comments