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:
parent
21807f4f99
commit
54c8d7afc4
10
nrsc5-dui.py
10
nrsc5-dui.py
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user