Skip to content

Commit

Permalink
Merge pull request #50 from proDreams/Ivan
Browse files Browse the repository at this point in the history
Версия 2.0.0 с графическим интерфейсом
  • Loading branch information
proDreams authored May 14, 2023
2 parents 0f6d34a + 3a14fb5 commit e72169b
Show file tree
Hide file tree
Showing 864 changed files with 4,593 additions and 1,486 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/output/
/autopy.json
/TODO.md
86 changes: 86 additions & 0 deletions app/about_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
from flet import (UserControl,
Text,
Column,
Divider,
CrossAxisAlignment,
Row,
TextSpan,
TextDecoration,
TextStyle,
colors)

from app import text_constants


class About(UserControl):
def __init__(self):
super().__init__()
self.label = Text(text_constants.about_text[text_constants.current_lang]["label"],
size=18,
weight="bold")
self.description = Text(text_constants.about_text[text_constants.current_lang]["description"],
size=16)

self.version_label = Text(text_constants.about_text[text_constants.current_lang]["version"],
width=250)
self.version_content = Text(text_constants.version)
self.version_row = Row(
[
self.version_label,
self.version_content,
],
)

self.author_label = Text(text_constants.about_text[text_constants.current_lang]["author"],
width=250)
self.author_content = Text(text_constants.about_text[text_constants.current_lang]["author_name"])
self.author_row = Row(
[
self.author_label,
self.author_content,
],
)

self.github_label = Text(text_constants.about_text[text_constants.current_lang]["github"],
width=250)
self.github_content = Text(
spans=[
TextSpan(
"https://github.com/proDreams/PoETRY",
TextStyle(decoration=TextDecoration.UNDERLINE),
url="https://github.com/proDreams/PoETRY",
on_enter=self.highlight_link,
on_exit=self.unhighlight_link,
),
],
)
self.github_row = Row(
[
self.github_label,
self.github_content,
]
)

def build(self):
self.expand = True
return Column(
[self.label,
self.description,
Divider(),
self.version_row,
self.author_row,
Divider(),
self.github_row
],
horizontal_alignment=CrossAxisAlignment.CENTER,
)

@staticmethod
def highlight_link(e):
e.control.style.color = colors.BLUE
e.control.update()

@staticmethod
def unhighlight_link(e):
e.control.style.color = None
e.control.update()
37 changes: 37 additions & 0 deletions app/catefories_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from flet import (UserControl,
Text,
ElevatedButton,
Row,
Container
)

from app import text_constants, utils


class Categories(UserControl):
def __init__(self):
super().__init__()
self.categories_list = utils.get_categories(text_constants.current_lang)
self.containers = Row(wrap=True)
for number, category in enumerate(self.categories_list, start=1):
temp = ElevatedButton(content=Container(
Row(
[
Text(f"{number}. ", size=18),
Text(category, size=18),
]
),
width=300,
height=80,
),

on_click=self.open_category
)
self.containers.controls.append(temp)

def build(self):
return self.containers

def open_category(self, e):
text_constants.selected_category = e.control.content.content.controls[1].value
self.page.go("/category")
128 changes: 0 additions & 128 deletions app/config.py

This file was deleted.

138 changes: 0 additions & 138 deletions app/controller.py

This file was deleted.

Loading

0 comments on commit e72169b

Please sign in to comment.