Skip to content

Commit

Permalink
Scale right column to window size
Browse files Browse the repository at this point in the history
  • Loading branch information
tsterbak committed Dec 26, 2023
1 parent 6859a5e commit 0290d4c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions openandroidinstaller/openandroidinstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(self, state: AppState):
super().__init__()
self.state = state
# create the main columns
self.view = Column(expand=True, width=1200)
self.view = Column(expand=True) # , width=1200)

# create default starter views
welcome_view = WelcomeView(
Expand Down Expand Up @@ -216,7 +216,7 @@ def log_version_infos(bin_path):
]
try:
logger.info(f"Heimdall version: {hdversion[1].strip()}")
except:
except IndexError:
logger.info(f"Issue with heimdall: {hdversion}")


Expand Down
38 changes: 20 additions & 18 deletions openandroidinstaller/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@

from app_state import AppState

from flet import (
Column,
Image,
Row,
UserControl,
VerticalDivider,
)
from flet import Column, Container, Image, Row, UserControl, VerticalDivider, margin


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

# configs
self.column_width = 600
# self.column_width = 600
# right part of the display, add content here.
self.right_view_header = Column(width=self.column_width, height=120, spacing=30)
self.right_view_header = Column(
spacing=30
) # , width=self.column_width, height=120)
self.right_view = Column(
alignment="center", width=self.column_width, height=650, scroll="adaptive"
alignment="center",
scroll="adaptive", # , width=self.column_width, height=650
)
# left part of the display: used for displaying the images
self.left_view = Column(
width=self.column_width,
# width=self.column_width,
controls=[Image(src=f"/imgs/{image}", height=600)],
expand=True,
horizontal_alignment="center",
)
# main view row
self.view = Row(
[
self.left_view,
VerticalDivider(),
Column(expand=True, controls=[self.right_view_header, self.right_view]),
],
alignment="spaceEvenly",
self.view = Container(
content=Row(
[
self.left_view,
VerticalDivider(),
Column(
expand=True, controls=[self.right_view_header, self.right_view]
),
],
alignment="spaceEvenly",
),
margin=margin.only(left=10, top=0, right=50, bottom=5),
)

def clear(
Expand Down

0 comments on commit 0290d4c

Please sign in to comment.