Skip to content

Commit 0290d4c

Browse files
committed
Scale right column to window size
1 parent 6859a5e commit 0290d4c

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

openandroidinstaller/openandroidinstaller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def __init__(self, state: AppState):
7272
super().__init__()
7373
self.state = state
7474
# create the main columns
75-
self.view = Column(expand=True, width=1200)
75+
self.view = Column(expand=True) # , width=1200)
7676

7777
# create default starter views
7878
welcome_view = WelcomeView(
@@ -216,7 +216,7 @@ def log_version_infos(bin_path):
216216
]
217217
try:
218218
logger.info(f"Heimdall version: {hdversion[1].strip()}")
219-
except:
219+
except IndexError:
220220
logger.info(f"Issue with heimdall: {hdversion}")
221221

222222

openandroidinstaller/views/base.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@
1515

1616
from app_state import AppState
1717

18-
from flet import (
19-
Column,
20-
Image,
21-
Row,
22-
UserControl,
23-
VerticalDivider,
24-
)
18+
from flet import Column, Container, Image, Row, UserControl, VerticalDivider, margin
2519

2620

2721
class BaseView(UserControl):
@@ -30,27 +24,35 @@ def __init__(self, state: AppState, image: str = "placeholder.png"):
3024
self.state = state
3125

3226
# configs
33-
self.column_width = 600
27+
# self.column_width = 600
3428
# right part of the display, add content here.
35-
self.right_view_header = Column(width=self.column_width, height=120, spacing=30)
29+
self.right_view_header = Column(
30+
spacing=30
31+
) # , width=self.column_width, height=120)
3632
self.right_view = Column(
37-
alignment="center", width=self.column_width, height=650, scroll="adaptive"
33+
alignment="center",
34+
scroll="adaptive", # , width=self.column_width, height=650
3835
)
3936
# left part of the display: used for displaying the images
4037
self.left_view = Column(
41-
width=self.column_width,
38+
# width=self.column_width,
4239
controls=[Image(src=f"/imgs/{image}", height=600)],
4340
expand=True,
4441
horizontal_alignment="center",
4542
)
4643
# main view row
47-
self.view = Row(
48-
[
49-
self.left_view,
50-
VerticalDivider(),
51-
Column(expand=True, controls=[self.right_view_header, self.right_view]),
52-
],
53-
alignment="spaceEvenly",
44+
self.view = Container(
45+
content=Row(
46+
[
47+
self.left_view,
48+
VerticalDivider(),
49+
Column(
50+
expand=True, controls=[self.right_view_header, self.right_view]
51+
),
52+
],
53+
alignment="spaceEvenly",
54+
),
55+
margin=margin.only(left=10, top=0, right=50, bottom=5),
5456
)
5557

5658
def clear(

0 commit comments

Comments
 (0)