This commit is contained in:
Sander Land committed 2020-05-25 17:12:58 +02:00
1 parent a646c32939
commit 40ae451bef
12 files changed
+283 -326

No files matched your search

+27 -32
View File
@@ -30,9 +30,6 @@
<I18NLabel>:
font_name: i18n._('Roboto')
<I18NCoreLabel>:
font_name: i18n._('Roboto')
<I18NTextInput>:
font_name: i18n._('Roboto')
@@ -100,11 +97,11 @@
<AutoSizedMDFlatRectangleButton>: # only wants height
width: self.label.texture_size[0] + self.hor_padding * 2
font_size: 0.75 * self.height / len(self.label.text.split('\n'))
font_size: 0.8 * self.height / len(self.label.text.split('\n'))
<AutoSizedMDFlatRectangleToggleButton>: # only wants height
width: self.label.texture_size[0] + self.hor_padding * 2
font_size: 0.75 * self.height / len(self.label.text.split('\n'))
font_size: 0.8 * self.height / len(self.label.text.split('\n'))
<BGMDBoxLayout@MDBoxLayout+BackgroundColor>:
background_color: BOX_BACKGROUND_COLOR
@@ -253,19 +250,19 @@
<CircleWithText>:
min_size: min(self.height,self.width)
Image:
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
id: image
pos: (root.pos[0] + (root.width - root.min_size)/2,root.pos[1] + (root.height - root.min_size)/2)
size: (root.min_size,root.min_size)
source: 'img/white.png' if root.player=='White' else 'img/black.png'
mipmap: True
I18NLabel:
Label:
id: lbl
text: root.text
bold: True
color: BLACK if root.player=='White' else WHITE
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
size: (root.min_size,root.min_size)
halign: 'center'
valign: 'middle'
font_size: root.min_size * 1.2 / (1 + 1 * len(self.text)) # TODO: easier?
pos: (image.x, image.y+2)
size: image.size
font_size: root.min_size * 1.2 / (1 + 1 * len(self.text))
# UI components
@@ -387,8 +384,6 @@
# ---------- components of right pane -------
<PlayerInfo@MDBoxLayout>:
captures: 0
name: 'Player'
@@ -548,26 +543,24 @@
opacity: int(root.show_winrate)
<StatsBox@BoxLayout+BackgroundColor>
<StatsBox>
orientation: 'vertical'
background_color: BOX_BACKGROUND_COLOR
score: score
winrate: winrate
score_change: score_change
labels: {'score':score_label,'winrate':winrate_label,'points':pointloss_label}
CensorableLabel:
id: winrate
id: winrate_label
label: 'Win rate'
text: ''
text: root.winrate
color: WINRATE_COLOR
CensorableLabel:
id: score
id: score_label
label: 'Score'
text: ''
text: root.score
color: SCORE_COLOR
CensorableLabel:
id: score_change
label: 'Points Lost'
text: ''
id: pointloss_label
label: 'Points Lost' if root.points_lost is None or root.points_lost > 0 else 'Points gained'
text: '{}: {:.1f}'.format(root.player,abs(root.points_lost)) if root.points_lost is not None else '...'
color: POINTLOSS_COLOR
<ScrollableLabel>:
@@ -678,7 +671,7 @@
on_ref_press: root.katrain.board_gui.show_pv_from_comments(args[1])
size_hint: 1, None
height: self.parent.height - status.height - note.height - 1
TextInput:
I18NTextInput:
id: note
size_hint: 1, None
on_text: root.katrain.set_note(self.text)
@@ -765,6 +758,11 @@
font_size: root.font_size
color: GREY
<LangButton@SizedMDFlatRectangleButton>
size_hint: 1,1
font_size: 0.4 * self.height
<ContentNavigationDrawer@MDBoxLayout+BackgroundColor>:
katrain: app.gui
background_color: BOX_BACKGROUND_COLOR
@@ -783,18 +781,15 @@
Line:
rectangle: (*self.pos,*self.size)
width: 1
SizedMDFlatButton:
LangButton:
text: i18n._('English')
on_press: app.language = 'en'
size_hint: 1/3,1
SizedMDFlatButton:
LangButton:
text: i18n._('Dutch')
on_press: app.language = 'nl'
size_hint: 1/3,1
SizedMDFlatButton:
LangButton:
text: i18n._('Korean')
on_press: app.language = 'ko'
size_hint: 1/3,1
Label:
MDBoxLayout:
canvas.before: