invert icons, menu etc

This commit is contained in:
Sander Land committed 2020-05-22 22:05:22 +02:00
1 parent 8725497cde
commit a70ae84822
11 files changed
+103 -19

No files matched your search

+84 -10
View File
@@ -330,7 +330,7 @@
size_hint: None, 1
width: self.height
pos_hint: {'x': 0}
on_press: root.nav_drawer.set_state("open")
on_press: app.gui.nav_drawer.set_state("open")
StyledButton:
text: i18n._('pass-button-text')
tooltip_text: i18n._('pass-button-tooltip')
@@ -831,9 +831,54 @@
<MainMenuItem>
size_hint_y: None
height: button.height
spacing: 4
padding: 4,0,0,0
Image:
id:image
source: root.icon
mipmap: True
size_hint: None,None
height: root.height * 0.8
width: self.height
pos_hint: {'center_y': 0.5}
MDFlatButton:
id: button
text: root.text
on_release:
app.gui.nav_drawer.set_state("close")
if not self.last_touch or self.last_touch.button=="left": root.dispatch('on_release',*args)
on_press: print(self.size, root.size, image.size, root.parent.parent, root.parent)
halign: 'left'
color: WHITE
Label:
text: root.shortcut
halign: 'left'
valign: 'middle'
size_hint_x: 0.5
color: GREY
<ContentNavigationDrawer@MDBoxLayout+BackgroundColor>:
orientation: 'vertical'
katrain: app.gui
background_color: BOX_BACKGROUND_COLOR
orientation: 'vertical'
canvas.after:
Color:
rgba: YELLOW
Line:
rectangle: (*self.pos,*self.size)
width: 1
MDBoxLayout:
adaptive_height: True
size_hint_x: 1
canvas.before:
Color:
rgba: RED
Line:
rectangle: (*self.pos,*self.size)
width: 1
MDFlatButton:
text: i18n._('Dutch')
on_press: app.language = 'nl'
@@ -841,11 +886,39 @@
text: i18n._('English')
on_press: app.language = 'en'
MDFlatButton:
text: 'size'
on_press: print(self.size,self.parent.size,self.parent.parent.size,self.parent.parent.parent.size,self.parent.parent.parent.parent.size)
MDFlatButton:
text: 'pos'
on_press: print(self.pos,self.parent.pos,self.parent.parent.pos,self.parent.parent.parent.pos,self.parent.parent.parent.parent.pos,self.parent.parent.parent.parent)
text: i18n._('Ko')
on_press: app.language = 'ko'
Label:
MDBoxLayout:
canvas.before:
Color:
rgba: RED
Line:
rectangle: (*self.pos,*self.size)
width: 1
orientation: 'vertical'
adaptive_height: True
size_hint_x: 1
MainMenuItem:
text: 'General Settings'
icon: 'img/flaticon/settings.png'
on_release: root.katrain('config-popup')
MainMenuItem:
text: 'Save Game'
icon: 'img/flaticon/savegame.png'
shortcut: 'Ctrl-S'
on_release: root.katrain("analyze-sgf-popup")
MainMenuItem:
text: 'Load Game'
icon: 'img/flaticon/loadgame.png'
shortcut: 'Ctrl-L'
on_release: root.katrain("analyze-sgf-popup")
MainMenuItem:
text: 'New Game'
icon: 'img/flaticon/newgame.png'
size_hint_x: 1
shortcut: 'Ctrl-N'
on_release: root.katrain("new-game-popup")
<KaTrainGui>:
@@ -854,6 +927,7 @@
board_controls: board_controls
button_controls: button_controls
analysis_controls: button_controls
nav_drawer: nav_drawer
zen: False
NavigationLayout:
ScreenManager:
@@ -868,7 +942,6 @@
id: board_gui
BadukPanControls:
id: board_controls
nav_drawer: nav_drawer
size_hint_y: None
height: min(100,self.width / 13.5)
ControlsPanel:
@@ -881,11 +954,12 @@
MyNavigationDrawer:
id: nav_drawer
state: "close"
width: self.height / 3
y: board_gui.pos[1]+CP_SPACING
size_hint_y: None
width: self.height * 0.4
height: root.height - self.y
swipe_edge_width: 0
ContentNavigationDrawer:
nav_drawer: nav_drawer
+10 -9
View File
@@ -62,30 +62,31 @@ class ControlsPanel(BoxLayout):
info = ""
if current_node:
hints = katrain.analysis_controls.hints.active
move = current_node.move
both_players_are_robots = self.player_mode(current_node.player) == PLAYER_AI and self.player_mode(current_node.next_player) == PLAYER_AI
next_player_is_human_or_both_robots = current_node.player and (self.player_mode(current_node.player) == PLAYER_AI or both_players_are_robots)
current_player_is_ai_playing_human = (
last_player_was_human_or_both_robots = current_node.player and (self.player_mode(current_node.player) != PLAYER_AI or both_players_are_robots)
last_player_was_ai_playing_human = (
current_node.player and self.player_mode(current_node.player) == PLAYER_AI and self.player_mode(current_node.next_player) != PLAYER_AI
)
if next_player_is_human_or_both_robots and not current_node.is_root and move:
info += current_node.comment(teach=self.player_mode(current_node.player) == PLAYER_HUMAN_TEACHING, hints=self.hints.active)
if last_player_was_human_or_both_robots and not current_node.is_root and move:
info += current_node.comment(teach=self.player_mode(current_node.player) == PLAYER_HUMAN_TEACHING, hints=hints)
self.active_comment_node = current_node
elif current_player_is_ai_playing_human and current_node.parent:
info += current_node.parent.comment(teach=self.player_mode(current_node.next_player) == PLAYER_HUMAN_TEACHING, hints=self.hints.active)
elif last_player_was_ai_playing_human and current_node.parent:
info += current_node.parent.comment(teach=self.player_mode(current_node.next_player) == PLAYER_HUMAN_TEACHING, hints=hints)
self.active_comment_node = current_node.parent
if current_node.analysis_ready:
self.stats.score.text = current_node.format_score()
self.stats.win_rate.text = current_node.format_win_rate()
if move and next_player_is_human_or_both_robots: # don't immediately hide this when an ai moves comes in
if move and last_player_was_human_or_both_robots: # don't immediately hide this when an ai moves comes in
points_lost = current_node.points_lost
self.stats.score_change.label = f"Points lost" if points_lost and points_lost > 0 else f"Points gained"
self.stats.score_change.text = f"{move.player}: {abs(points_lost):.1f}" if points_lost else "-"
elif not current_player_is_ai_playing_human:
elif not last_player_was_ai_playing_human:
self.stats.score_change.label = f"Points lost"
self.stats.score_change.text = "-"
elif current_player_is_ai_playing_human and current_node.parent and current_node.parent.move:
elif last_player_was_ai_playing_human and current_node.parent and current_node.parent.move:
points_lost = current_node.parent.points_lost
self.stats.score_change.label = f"Points lost" if points_lost and points_lost > 0 else f"Points gained"
self.stats.score_change.text = f"{current_node.parent.move.player}: {abs(points_lost):.1f}" if points_lost else "-"
+9
View File
@@ -180,6 +180,15 @@ class CircleWithText(MDFloatLayout):
class ScaledLightLabel(LightLabel, ToolTipBehavior):
num_lines = NumericProperty(1)
class MainMenuItem(MDBoxLayout):
icon = StringProperty('')
text = StringProperty('')
shortcut = StringProperty('')
__events__ = ["on_release"]
def on_release(self, ref):
pass
# --- not checked
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB