Skip to content

Commit

Permalink
very done
Browse files Browse the repository at this point in the history
  • Loading branch information
ositoMalvado committed Oct 16, 2024
1 parent a04c191 commit d10671b
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 22 deletions.
10 changes: 0 additions & 10 deletions chat_history.json

This file was deleted.

20 changes: 10 additions & 10 deletions components/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ def hide_keyboard(self,e ):

def update_premio(self, e):
# Aplicar el descuento del 15%
if not self.keyboard and e.control == self.text_field_premio :
self.keyboard = True
self.page.floating_action_button = ft.FloatingActionButton(
icon=ft.icons.KEYBOARD_HIDE,
on_click=self.hide_keyboard
)
self.page.update()
self.sonido.play()
# if not self.keyboard and e.control == self.text_field_premio :
# self.keyboard = True
# self.page.floating_action_button = ft.FloatingActionButton(
# icon=ft.icons.KEYBOARD_HIDE,
# on_click=self.hide_keyboard
# )
# self.page.update()

if self.text_field_premio.value == '' or int(self.text_field_premio.value) <= 0:
self.valor_final.value = "Ingresa un premio"
self.premio_display.value = "$0"
Expand All @@ -149,7 +149,7 @@ def update_premio(self, e):
self.cuotas_display.update()
if self.text_field_premio.value == '':
return

self.sonido.play()
discounted_value = int(float(self.text_field_premio.value) * (1 - self.descuento / 100))

intervalo = int(self.intervalo_slider.value)
Expand Down Expand Up @@ -321,7 +321,7 @@ def __init__(self):
self.border_radius=10
self.border=ft.border.all(1, ft.colors.BLACK12)
self.bgcolor=ft.colors.PRIMARY_CONTAINER
self.width=500
self.width=400
self.padding=10


Expand Down
18 changes: 17 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
def main(page: ft.Page):
page.spacing = 0
page.padding = 0
page.title = "Utilidades"
page.theme_mode = ft.ThemeMode.DARK
page.locale_configuration = ft.LocaleConfiguration(
[ft.Locale('es', 'ES')],
current_locale=ft.Locale('es', 'ES'),
)
page.bgcolor = ft.colors.BACKGROUND
last_width, last_height = calcular_alto(414)
resizing = False
Expand Down Expand Up @@ -39,7 +45,17 @@ def on_resize(e):
text="RUS",
content=ft.Container(
expand=True,
content=CalculadoraPremio()
content=ft.Tabs(
[
ft.Tab(
text="Premio",
content=CalculadoraPremio()
)
],
tab_alignment=ft.TabAlignment.CENTER,
expand=True
),

)
),
ft.Tab(
Expand Down
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[project]
name = "Oficina"
version = "1.0.0"
description = "Utilidades para la Oficina"
authors = [
{name = "Julián Perez", email = "[email protected]"}
]
dependencies = [
"flet==0.25.0.dev3526"
]

[tool.flet]
org = "pj.code"
product = "Oficina"
company = "PAS Toval"
copyright = "Copyright (C) 2024 by Julian Perez"
build_number = 1

[tool.flet.splash]
color = "#2f2f2f"
dark_color = "#2f2f2f"
web = true
ios = true
android = true
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
flet==0.25.0.dev3519
flet==0.25.0.dev3526

0 comments on commit d10671b

Please sign in to comment.