247 lines
6.7 KiB
Plaintext
247 lines
6.7 KiB
Plaintext
#:kivy 1.11.0
|
|
#:import i18n katrain.core.utils.i18n
|
|
|
|
|
|
#:set CP_SPACING 6
|
|
#:set CP_SMALL_SPACING 3
|
|
#:set CP_PADDING 6
|
|
|
|
#:set INPUT_FONT_SIZE dp(25)
|
|
#:set DESC_FONT_SIZE dp(20)
|
|
|
|
#:import BACKGROUND_COLOR katrain.gui.style.BACKGROUND_COLOR
|
|
#:import BOX_BACKGROUND_COLOR katrain.gui.style.BOX_BACKGROUND_COLOR
|
|
#:import TEXT_COLOR katrain.gui.style.TEXT_COLOR
|
|
|
|
|
|
#MDTextField:
|
|
# hint_text: "Helper text on focus"
|
|
# helper_text: "This will disappear when you click off"
|
|
# helper_text_mode: "on_focus"
|
|
# font_size: INPUT_FONT_SIZE
|
|
|
|
<LabelledTextInput>:
|
|
font_size: INPUT_FONT_SIZE
|
|
helper_text_mode: "on_focus"
|
|
hint_text: ""
|
|
helper_text: ""
|
|
|
|
<LabelledIntInput>:
|
|
font_size: INPUT_FONT_SIZE
|
|
|
|
<LabelledFloatInput>:
|
|
font_size: INPUT_FONT_SIZE
|
|
on_text: print(self.size,self.font_size)
|
|
|
|
<LabelledCheckBox>:
|
|
color: WHITE
|
|
size: DESC_FONT_SIZE*2,DESC_FONT_SIZE*2
|
|
size_hint: None,None
|
|
|
|
<QuickInputButton@SizedRectangleButton>
|
|
on_left_press: if self.target: self.target.text = self.text
|
|
size: DESC_FONT_SIZE * 2, DESC_FONT_SIZE * 2
|
|
font_size: DESC_FONT_SIZE
|
|
|
|
<I18NPopup>:
|
|
background_color: [*[c*255/66 for c in BACKGROUND_COLOR[:3]], 1]
|
|
title: i18n._(self.title_key)
|
|
title_size: DESC_FONT_SIZE
|
|
title_font: self.font_name
|
|
size_hint: None, None
|
|
|
|
|
|
<QuickConfigGui>:
|
|
orientation: 'vertical'
|
|
spacing: CP_SPACING
|
|
padding: 4*CP_PADDING,CP_PADDING, 4*CP_PADDING, CP_PADDING
|
|
|
|
<DescriptionLabel@Label>:
|
|
font_size: DESC_FONT_SIZE
|
|
multiline: True
|
|
text_size: self.size
|
|
halign: 'center'
|
|
valign: 'center'
|
|
|
|
<SmallDescriptionLabel@DescriptionLabel>
|
|
font_size: DESC_FONT_SIZE * 0.66
|
|
|
|
|
|
<ConfigTimerPopup>:
|
|
MDGridLayout:
|
|
cols: 2
|
|
rows: 3
|
|
spacing: CP_SPACING
|
|
size_hint: 1,2
|
|
DescriptionLabel:
|
|
text: i18n._('byoyomi length')
|
|
AnchorLayout:
|
|
LabelledIntInput:
|
|
text: "30"
|
|
input_property: "timer/byo_length"
|
|
DescriptionLabel:
|
|
text: i18n._('byoyomi periods')
|
|
AnchorLayout:
|
|
LabelledIntInput:
|
|
text: "5"
|
|
input_property: "timer/byo_periods"
|
|
DescriptionLabel:
|
|
text: 'test'
|
|
AnchorLayout:
|
|
LabelledTextInput:
|
|
value: i18n._('byoyomi periods')
|
|
hint_text: i18n._('byoyomi periods')
|
|
helper_text: i18n._('byoyomi length')
|
|
AnchorLayout:
|
|
size_hint: 1,1
|
|
AutoSizedRoundedRectangleButton:
|
|
padding_x: 15
|
|
size_hint: None,0.5
|
|
text: i18n._("update timer")
|
|
on_press: root.update_config(True)
|
|
|
|
|
|
<NewGamePopup>:
|
|
restart: restart
|
|
rules_spinner: rules_spinner
|
|
GridLayout:
|
|
rows: 6
|
|
cols: 3
|
|
size_hint: 1, 3
|
|
spacing: CP_SPACING
|
|
padding: CP_PADDING
|
|
DescriptionLabel:
|
|
text: i18n._("board size")
|
|
AnchorLayout:
|
|
LabelledTextInput:
|
|
text: '19'
|
|
id: boardsize
|
|
input_property: 'game/size'
|
|
AnchorLayout:
|
|
MDBoxLayout:
|
|
adaptive_size: True
|
|
spacing: CP_SPACING
|
|
QuickInputButton:
|
|
text: '9'
|
|
target: boardsize
|
|
QuickInputButton:
|
|
text: '13'
|
|
target: boardsize
|
|
QuickInputButton:
|
|
text: '19'
|
|
target: boardsize
|
|
DescriptionLabel:
|
|
text: i18n._("handicap")
|
|
AnchorLayout:
|
|
LabelledIntInput:
|
|
text: '0'
|
|
input_property: 'game/handicap'
|
|
id: handicap
|
|
AnchorLayout:
|
|
MDBoxLayout:
|
|
adaptive_size: True
|
|
spacing: CP_SPACING
|
|
QuickInputButton:
|
|
text: '0'
|
|
on_left_press: km.text='6.5'
|
|
target: handicap
|
|
QuickInputButton:
|
|
text: '2'
|
|
on_left_press: km.text='0.5'
|
|
target: handicap
|
|
QuickInputButton:
|
|
text: '9'
|
|
on_left_press: km.text='0.5'
|
|
target: handicap
|
|
DescriptionLabel:
|
|
text: i18n._("komi")
|
|
AnchorLayout:
|
|
LabelledFloatInput:
|
|
text: '6.5'
|
|
id: km
|
|
input_property: 'game/komi'
|
|
AnchorLayout:
|
|
MDBoxLayout:
|
|
adaptive_size: True
|
|
spacing: CP_SPACING
|
|
QuickInputButton:
|
|
text: '0.5'
|
|
QuickInputButton:
|
|
text: '6.5'
|
|
QuickInputButton:
|
|
text: '7.5'
|
|
DescriptionLabel:
|
|
text: i18n._("ruleset")
|
|
AnchorLayout:
|
|
LabelledSpinner:
|
|
size_hint: 0.8,0.8
|
|
input_property: 'game/rules'
|
|
font_size: DESC_FONT_SIZE
|
|
id: rules_spinner
|
|
Label:
|
|
DescriptionLabel:
|
|
text: i18n._('clear cache')
|
|
AnchorLayout:
|
|
LabelledCheckBox:
|
|
id: restart
|
|
input_property: 'game/clear_cache'
|
|
SmallDescriptionLabel:
|
|
text: i18n._('avoids replaying')
|
|
SmallDescriptionLabel:
|
|
text: i18n._("non square board hint")
|
|
SmallDescriptionLabel:
|
|
text: i18n._("handicap hint")
|
|
AnchorLayout:
|
|
size_hint: 1,1
|
|
AutoSizedRoundedRectangleButton:
|
|
padding_x: 15
|
|
size_hint: None,0.5
|
|
text: i18n._("new game")
|
|
on_press: root.update_config(True)
|
|
|
|
|
|
# old
|
|
|
|
<LoadSGFPopup>:
|
|
fast: fast
|
|
rewind: rewind
|
|
filesel: filesel
|
|
orientation: 'vertical'
|
|
Label:
|
|
text: root.filesel.path
|
|
size_hint: 1,0.05
|
|
halign: 'left'
|
|
FileChooserListView:
|
|
id: filesel
|
|
multiselect: False
|
|
filters: ["*.sgf"]
|
|
path: "."
|
|
size_hint: 1,0.88
|
|
BoxLayout:
|
|
orientation: 'horizontal'
|
|
size_hint: 1,0.07
|
|
canvas.before:
|
|
Color:
|
|
rgb: 0.4, 0.4, 0.4
|
|
Rectangle:
|
|
pos: self.pos
|
|
size: self.size
|
|
Label:
|
|
text: "Analyze Extra Fast"
|
|
size_hint: 0.45,1
|
|
halign: 'right'
|
|
CheckBox:
|
|
id: fast
|
|
color: (0.95, 0.95, 0.95)
|
|
size_hint: 0.05,1
|
|
Label:
|
|
text: "Rewind to Start"
|
|
halign: 'right'
|
|
size_hint: 0.45,1
|
|
CheckBox:
|
|
id: rewind
|
|
active: True
|
|
color: (0.95, 0.95, 0.95)
|
|
size_hint: 0.05,1
|
|
|