-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from proDreams/Ivan
Версия 2.0.0 с графическим интерфейсом
- Loading branch information
Showing
864 changed files
with
4,593 additions
and
1,486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/output/ | ||
/autopy.json | ||
/TODO.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.