no sp in theme

This commit is contained in:
Sander Land committed 2020-12-11 21:00:56 +01:00
1 parent 0586d73cd9
commit 50a3965abe
4 files changed
+28 -31

No files matched your search

+1 -1
View File
@@ -208,7 +208,7 @@ In addition to shortcuts mentioned above and those shown in the main menu:
* If still encountering problems, please start KataGo by itself to check for any errors it gives. * If still encountering problems, please start KataGo by itself to check for any errors it gives.
* Note that if you don't have a GPU, or your GPU does not support OpenCL, you should use the 'eigen' binaries which run on CPU only. * Note that if you don't have a GPU, or your GPU does not support OpenCL, you should use the 'eigen' binaries which run on CPU only.
* The font size is too small * The font size is too small
* On some ultra-high resolution monitors, font scale is not set correctly. Please see [these](https://github.com/sanderland/katrain/issues/250) instructions to adjust them. * On some ultra-high resolution monitors, font scale is not set correctly. Please see [these](https://github.com/sanderland/katrain/issues/250) instructions to adjust Theme.
## <a name="support"></a> Support / Contribute ## <a name="support"></a> Support / Contribute
+2 -2
View File
@@ -460,7 +460,7 @@
lang_change_tracking: i18n._('') lang_change_tracking: i18n._('')
markup: root.markup markup: root.markup
padding: 5, 5 padding: 5, 5
font_size: Theme.NOTES_FONT_SIZE font_size: sp(Theme.NOTES_FONT_SIZE)
line_height: root.line_height line_height: root.line_height
color: Theme.TEXT_COLOR color: Theme.TEXT_COLOR
size_hint_y: None size_hint_y: None
@@ -613,7 +613,7 @@
size_hint: 1,0 size_hint: 1,0
LabelledTextInput: LabelledTextInput:
id: note id: note
font_size: Theme.NOTES_FONT_SIZE font_size: sp(Theme.NOTES_FONT_SIZE)
multiline: True multiline: True
on_text: root.katrain.set_note(self.text) on_text: root.katrain.set_note(self.text)
hint_text: i18n._('SGF Notes Hint') hint_text: i18n._('SGF Notes Hint')
+3 -6
View File
@@ -1,6 +1,3 @@
from kivy.metrics import sp
def to_hexcol(kivycol): def to_hexcol(kivycol):
return "#" + "".join(f"{round(c * 255):02x}" for c in kivycol[:3]) return "#" + "".join(f"{round(c * 255):02x}" for c in kivycol[:3])
@@ -22,9 +19,9 @@ BLUE = [0.3, 0.7, 0.9, 1]
class Theme: class Theme:
# font # font
DEFAULT_FONT = "fonts/NotoSansCJKsc-Regular.otf" DEFAULT_FONT = "fonts/NotoSansCJKsc-Regular.otf"
INPUT_FONT_SIZE = sp(25) INPUT_FONT_SIZE = 25 # sp
DESC_FONT_SIZE = sp(20) DESC_FONT_SIZE = 20 # sp
NOTES_FONT_SIZE = sp(18) NOTES_FONT_SIZE = 18 # sp
# gui colors # gui colors
BACKGROUND_COLOR = [36 / 255, 48 / 255, 62 / 255, 1] BACKGROUND_COLOR = [36 / 255, 48 / 255, 62 / 255, 1]
+22 -22
View File
@@ -18,10 +18,10 @@
# hint_text: "Helper text on focus" # hint_text: "Helper text on focus"
# helper_text: "This will disappear when you click off" # helper_text: "This will disappear when you click off"
# helper_text_mode: "on_focus" # helper_text_mode: "on_focus"
# font_size: Theme.INPUT_FONT_SIZE # font_size: sp(Theme.INPUT_FONT_SIZE)
<LabelledTextInput>: <LabelledTextInput>:
font_size: Theme.INPUT_FONT_SIZE font_size: sp(Theme.INPUT_FONT_SIZE)
helper_text_mode: "none" helper_text_mode: "none"
hint_text: "" hint_text: ""
helper_text: "" helper_text: ""
@@ -35,27 +35,27 @@
helper_text: i18n._("file not found") helper_text: i18n._("file not found")
<LabelledIntInput>: <LabelledIntInput>:
font_size: Theme.INPUT_FONT_SIZE font_size: sp(Theme.INPUT_FONT_SIZE)
size_hint: 0.5, None size_hint: 0.5, None
<LabelledFloatInput>: <LabelledFloatInput>:
font_size: Theme.INPUT_FONT_SIZE font_size: sp(Theme.INPUT_FONT_SIZE)
size_hint: 0.5, None size_hint: 0.5, None
<LabelledCheckBox>: <LabelledCheckBox>:
size: Theme.DESC_FONT_SIZE*2,Theme.DESC_FONT_SIZE*2 size: sp(Theme.DESC_FONT_SIZE)*2,sp(Theme.DESC_FONT_SIZE)*2
size_hint: None,None size_hint: None,None
<QuickInputButton@SizedRectangleButton> <QuickInputButton@SizedRectangleButton>
on_left_press: if self.target: self.target.text = self.text on_left_press: if self.target: self.target.text = self.text
size: Theme.DESC_FONT_SIZE * 2, Theme.DESC_FONT_SIZE * 2 size: sp(Theme.DESC_FONT_SIZE) * 2, sp(Theme.DESC_FONT_SIZE) * 2
font_size: Theme.DESC_FONT_SIZE font_size: sp(Theme.DESC_FONT_SIZE)
<I18NPopup>: <I18NPopup>:
background_color: Theme.BACKGROUND_COLOR background_color: Theme.BACKGROUND_COLOR
background: self.background if kivy_version < '2.0' else '' background: self.background if kivy_version < '2.0' else ''
title: i18n._(self.title_key) title: i18n._(self.title_key)
title_size: Theme.DESC_FONT_SIZE title_size: sp(Theme.DESC_FONT_SIZE)
title_font: self.font_name title_font: self.font_name
size_hint: None, None size_hint: None, None
@@ -65,14 +65,14 @@
padding: 4*CP_PADDING,CP_PADDING, 4*CP_PADDING, CP_PADDING padding: 4*CP_PADDING,CP_PADDING, 4*CP_PADDING, CP_PADDING
<DescriptionLabel>: <DescriptionLabel>:
font_size: Theme.DESC_FONT_SIZE font_size: sp(Theme.DESC_FONT_SIZE)
multiline: True multiline: True
text_size: self.width, None text_size: self.width, None
halign: 'center' halign: 'center'
valign: 'center' valign: 'center'
<SmallDescriptionLabel@DescriptionLabel> <SmallDescriptionLabel@DescriptionLabel>
font_size: Theme.DESC_FONT_SIZE * 0.66 font_size: sp(Theme.DESC_FONT_SIZE) * 0.66
<ConfigPopup>: <ConfigPopup>:
configfile: configfile configfile: configfile
@@ -84,7 +84,7 @@
katago_download_progress_box: katago_download_progress_box katago_download_progress_box: katago_download_progress_box
DescriptionLabel: DescriptionLabel:
text: i18n._('katago settings') text: i18n._('katago settings')
font_size: Theme.DESC_FONT_SIZE * 1.5 font_size: sp(Theme.DESC_FONT_SIZE) * 1.5
GridLayout: GridLayout:
cols: 2 cols: 2
rows: 6 rows: 6
@@ -167,9 +167,9 @@
orientation: 'horizontal' orientation: 'horizontal'
DescriptionLabel: DescriptionLabel:
text: i18n._('general settings') text: i18n._('general settings')
font_size: Theme.DESC_FONT_SIZE * 1.5 font_size: sp(Theme.DESC_FONT_SIZE) * 1.5
DescriptionLabel: DescriptionLabel:
font_size: Theme.DESC_FONT_SIZE * 1.5 font_size: sp(Theme.DESC_FONT_SIZE) * 1.5
text: i18n._('engine settings') text: i18n._('engine settings')
BoxLayout: BoxLayout:
size_hint: 1,5 size_hint: 1,5
@@ -277,7 +277,7 @@
padding: 4 padding: 4
size_hint: 0.95, 1 size_hint: 0.95, 1
DescriptionLabel: DescriptionLabel:
font_size: Theme.DESC_FONT_SIZE * 0.8 font_size: sp(Theme.DESC_FONT_SIZE) * 0.8
text: i18n._("theme") text: i18n._("theme")
AnchorLayout: AnchorLayout:
LabelledSpinner: LabelledSpinner:
@@ -285,7 +285,7 @@
input_property: 'trainer/theme' input_property: 'trainer/theme'
id: themes_spinner id: themes_spinner
DescriptionLabel: DescriptionLabel:
font_size: Theme.DESC_FONT_SIZE * 0.8 font_size: sp(Theme.DESC_FONT_SIZE) * 0.8
text: i18n._("stats on top move") text: i18n._("stats on top move")
AnchorLayout: AnchorLayout:
BoxLayout: BoxLayout:
@@ -303,19 +303,19 @@
value_refs: TOP_MOVE_OPTIONS value_refs: TOP_MOVE_OPTIONS
input_property: "trainer/top_moves_show_secondary" input_property: "trainer/top_moves_show_secondary"
DescriptionLabel: DescriptionLabel:
font_size: Theme.DESC_FONT_SIZE * 0.8 font_size: sp(Theme.DESC_FONT_SIZE) * 0.8
text: i18n._("show stats if") text: i18n._("show stats if")
AnchorLayout: AnchorLayout:
LabelledIntInput: LabelledIntInput:
input_property: "trainer/low_visits" input_property: "trainer/low_visits"
DescriptionLabel: DescriptionLabel:
font_size: Theme.DESC_FONT_SIZE * 0.8 font_size: sp(Theme.DESC_FONT_SIZE) * 0.8
text: i18n._("show ai dots") text: i18n._("show ai dots")
AnchorLayout: AnchorLayout:
LabelledCheckBox: LabelledCheckBox:
input_property: "trainer/eval_show_ai" input_property: "trainer/eval_show_ai"
DescriptionLabel: DescriptionLabel:
font_size: Theme.DESC_FONT_SIZE * 0.8 font_size: sp(Theme.DESC_FONT_SIZE) * 0.8
text: i18n._("cache analysis to sgf") text: i18n._("cache analysis to sgf")
AnchorLayout: AnchorLayout:
LabelledCheckBox: LabelledCheckBox:
@@ -468,7 +468,7 @@
LabelledSpinner: LabelledSpinner:
size_hint: 0.8,0.8 size_hint: 0.8,0.8
input_property: 'game/rules' input_property: 'game/rules'
font_size: Theme.DESC_FONT_SIZE font_size: sp(Theme.DESC_FONT_SIZE)
id: rules_spinner id: rules_spinner
Label: Label:
DescriptionLabel: DescriptionLabel:
@@ -518,7 +518,7 @@
BoxLayout: BoxLayout:
size_hint: 1,1 size_hint: 1,1
DescriptionLabel: DescriptionLabel:
font_size: Theme.DESC_FONT_SIZE font_size: sp(Theme.DESC_FONT_SIZE)
text: i18n._('Select AI') text: i18n._('Select AI')
AnchorLayout: AnchorLayout:
I18NSpinner: I18NSpinner:
@@ -527,12 +527,12 @@
BoxLayout: BoxLayout:
size_hint: 1,1 size_hint: 1,1
DescriptionLabel: DescriptionLabel:
font_size: Theme.DESC_FONT_SIZE font_size: sp(Theme.DESC_FONT_SIZE)
size_hint: 1, 1 size_hint: 1, 1
text: i18n._('estimated strength') text: i18n._('estimated strength')
DescriptionLabel: DescriptionLabel:
size_hint: 0.8, 1 size_hint: 0.8, 1
font_size: Theme.DESC_FONT_SIZE font_size: sp(Theme.DESC_FONT_SIZE)
id: estimated_rank_label id: estimated_rank_label
text: '?' + i18n._('strength:kyu') text: '?' + i18n._('strength:kyu')
SmallDescriptionLabel: SmallDescriptionLabel: