Constant resize

Fixed a bug (with a bandaid) where the cover/logo/travel/weather images were constantly resizing, eating resources.
Apparently the 'check-resize' widget callback doesn't get called only when the window resizes, you still have to actually check that it's been resized... what's the point of the callback?
This commit is contained in:
markjfine 2021-05-06 21:31:09 -04:00 committed by GitHub
parent 21807f4f99
commit 54c8d7afc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,6 +81,8 @@ class NRSC5_DUI(object):
self.copyright = "Copyright © 2017-2019 Cody Nybo & Clayton Smith, 2019 zefie, 2021 Mark J. Fine"
musicbrainzngs.set_useragent(self.app_name,self.version,self.web_addr)
self.width = 0 # window width
self.height = 0 # window height
self.mapFile = os.path.join(resDir, "map.png")
self.defaultSize = [490,250] # default width,height of main app
self.nrsc5 = None # nrsc5 process
@ -295,7 +297,11 @@ class NRSC5_DUI(object):
def on_cover_resize(self, container):
global mapDir
if self.coverImage != "":
width, height = self.mainWindow.get_size()
if (self.width != width) or (self.height != height):
self.width = width
self.height = height
if (self.coverImage != "") and (self.coverImage[-5:] != "/aas/"):
self.showArtwork(self.coverImage)
img_size = min(self.alignmentMap.get_allocated_height(), self.alignmentMap.get_allocated_width()) - 12
@ -491,6 +497,8 @@ class NRSC5_DUI(object):
print("general error in the musicbrainz routine")
# now display it by simulating a window resize
self.height = 0
self.width = 0
self.on_cover_resize(self.mainWindow)
def showArtwork(self, art):