start build test
This commit is contained in:
62
app/designer.py
Normal file
62
app/designer.py
Normal file
@@ -0,0 +1,62 @@
|
||||
import flet as ft
|
||||
from flet.core.types import OptionalControlEventCallable
|
||||
|
||||
colors=[
|
||||
"#E1B07E",#0
|
||||
"#E5BE9E",#1
|
||||
"#CBC0AD",#2
|
||||
"#86A397",#3
|
||||
"#361D2E"#4
|
||||
]
|
||||
|
||||
class Conteiner(ft.Container):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
|
||||
)
|
||||
|
||||
|
||||
class TextField(ft.TextField):
|
||||
def __init__(self, expand: bool = False, width:int=50, height:int = 50, read_only:bool=False):
|
||||
if expand == False:
|
||||
super().__init__(
|
||||
expand=False,
|
||||
width=width,
|
||||
height=height,
|
||||
read_only=read_only,
|
||||
#bgcolor=colors[1],
|
||||
cursor_color=colors[4],
|
||||
#focus_color=colors[2],
|
||||
focused_border_color=colors[2],
|
||||
border_color=colors[4],
|
||||
text_style=ft.TextStyle(
|
||||
color=colors[0]
|
||||
)
|
||||
)
|
||||
else:
|
||||
super().__init__(
|
||||
expand=True,
|
||||
height=height,
|
||||
read_only=read_only,
|
||||
#bgcolor=colors[1],
|
||||
cursor_color=colors[4],
|
||||
#focus_color=colors[2],
|
||||
focused_border_color=colors[2],
|
||||
border_color=colors[4],
|
||||
text_style=ft.TextStyle(
|
||||
color=colors[0]
|
||||
)
|
||||
)
|
||||
|
||||
class Button(ft.CupertinoFilledButton):
|
||||
def __init__(self, on_click:OptionalControlEventCallable=None, text:str="load", height:int=50, width:int=100, alignment:ft.alignment=ft.alignment.center):
|
||||
|
||||
|
||||
super().__init__(
|
||||
on_click=on_click,
|
||||
text=text,
|
||||
focus_color=colors[4],
|
||||
icon_color=colors[1],
|
||||
alignment=alignment,
|
||||
)
|
||||
pass
|
||||
Reference in New Issue
Block a user