Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
OpenDyslexic (#38)
Browse files Browse the repository at this point in the history
* Création d'un thème spécifique
* Utilisation du thème
  • Loading branch information
Arnaud LE CAM committed Feb 20, 2023
1 parent a282cdc commit 2bbd225
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
24 changes: 24 additions & 0 deletions mydevoirs/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,19 @@
"titre_jour": [0.2, 0.4, 0, 1],
"progression": [0.92, 0.008, 0.008, 1],
"spinner_text_color": [0, 0, 0, 1],
"police": str(BASE_DIR / "data" / "fonts" / "Verdana.ttf")
},
"standard-dys": {
"fond": [130 / 255, 134 / 255, 138 / 255, 1],
"card": [98 / 255, 105 / 255, 114 / 236, 1],
"card_entete": [83 / 255, 93 / 255, 105 / 236, 1],
"card_texte_entete": [0, 0, 0, 1],
"card_texte_size": "16sp",
"titre_jour": [0.2, 0.4, 0, 1],
"progression": [0.92, 0.008, 0.008, 1],
"spinner_text_color": [0, 0, 0, 1],
"police": str(BASE_DIR / "data" / "fonts" / "OpenDyslexic-Regular.ttf")
},
"contrast": {
"fond": [130 / 255, 134 / 255, 138 / 255, 1],
"card": [98 / 255, 105 / 255, 114 / 236, 1],
Expand All @@ -50,5 +62,17 @@
"titre_jour": [0.2, 0.4, 0, 1],
"progression": [1, 1, 1, 1],
"spinner_text_color": [0, 0, 0, 1],
"police": str(BASE_DIR / "data" / "fonts" / "Verdana.ttf")
},
"contrast-dys": {
"fond": [130 / 255, 134 / 255, 138 / 255, 1],
"card": [98 / 255, 105 / 255, 114 / 236, 1],
"card_texte_entete": [1, 1, 1, 1],
"card_entete": [0, 0, 0, 1],
"card_texte_size": "18sp",
"titre_jour": [0.2, 0.4, 0, 1],
"progression": [1, 1, 1, 1],
"spinner_text_color": [0, 0, 0, 1],
"police": str(BASE_DIR / "data" / "fonts" / "OpenDyslexic-Regular.ttf")
},
}
Binary file added mydevoirs/data/fonts/OpenDyslexic-Regular.ttf
Binary file not shown.
2 changes: 0 additions & 2 deletions mydevoirs/datas.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
"icon_aide": "qmark.png",
"icon_colorchooser": "colorchooser.png",
"icon_arrowmove": "arrowmove.png",
"font_base": "Verdana.ttf",
}


def get_datas():
res = {}
for k, v in DATAS.items():
Expand Down
5 changes: 3 additions & 2 deletions mydevoirs/itemwidget.kv
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
size_hint_x: 0.4 # pragma: no cover
text_size: (self.width, self.height)
font_size: sp(14)
font_name: datas['font_base']
font_name: app.theme['police']
valign: 'middle' # pragma: no cover
halign: 'center' # pragma: no cover
shorten: True
Expand All @@ -34,7 +34,7 @@
valign: 'top' # pragma: no cover
multiline: True
write_tab: False
font_name: datas['font_base']
font_name: app.theme['police']
font_size: sp(14)
# height: root.height * (len(self._lines)+1)

Expand Down Expand Up @@ -70,6 +70,7 @@
#background_color: root.color
background_normal: '' # pragma: no cover
color: (0,0,0) # pragma: no cover
font_name: app.theme['police']

<MatiereDropdown>:
auto_width: False
Expand Down
6 changes: 3 additions & 3 deletions mydevoirs/mydevoirs.kv
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@
Label:
id: titre_jour
text: root.nice_date
font_name: datas['font_base']
font_name: app.theme['police']
font_size: app.theme['card_texte_size']
color: app.theme['card_texte_entete']

Label:
text: root.progression
font_name: datas['font_base']
font_name: app.theme['police']
font_size: app.theme['card_texte_size']
size_hint_x: 0.3 # pragma: no cover
color: app.theme['fond'] if root.progression[0] == root.progression[2] else app.theme['progression']
Expand Down Expand Up @@ -116,7 +116,7 @@
size_hint_y: None
height: dp(30)
spacing: dp(5)
font_name: datas['font_base']
font_name: app.theme['police']
font_size: sp(16)
canvas.before:
Color:
Expand Down

0 comments on commit 2bbd225

Please sign in to comment.