Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Commit e733760

Browse files
committed
Image dimensions based on window size
1 parent f01d44e commit e733760

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/front.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,20 @@ class Front(widget.PrimaryFrame):
2424

2525
def __next(self):
2626
data: dict = self.cache.next()
27-
image = process_image(data.pop('image'), 400, 280)
27+
image = process_image(
28+
data.pop('image'),
29+
self.window.winfo_width(),
30+
self.window.winfo_height()
31+
)
2832
name = data.pop('name')
2933
self.__load(name, image, data)
3034

3135
def __load(self, name, image, data):
3236
self.title.config(text=name)
33-
self.bio.data.load(data)
3437
self._last = self.image
3538
self.image = View(image, 'image')
39+
self.bio = View(Bio(self.window), 'widget')
40+
self.bio.data.load(data)
3641
self.update()
3742

3843
def __change_image(self, direction: Direction):
@@ -44,7 +49,7 @@ def init(self):
4449
self.window = Window(self)
4550
self.commandbar = widget.SecondaryFrame(self)
4651

47-
self.bio = View(Bio(self.window), 'widget')
52+
self.bio = None
4853
self.image = None
4954

5055
self.btn_dislike = widget.PrimaryButton(

0 commit comments

Comments
 (0)