Skip to content

Commit 90db95b

Browse files
SilvrisJames McIntosh
authored andcommitted
Core: Post-KivyMD cleanup 2 and enhancements (ArchipelagoMW#4876)
* Adds a new class allowing TextFields to be resized * Resizes most CommonClient components to be more in-line with pre-KivyMD * Change the color of SelectableLabels and TooltipLabels to white * Fixed ClientTabs not correctly showing the current tab indicator * The server label now features a (i) icon to indicate that it can be hovered over. * Changed the default `primary_palette` to `Lightsteelblue` and the default `dynamic_scheme_name` to `VIBRANT` * Properly set attributes on `KivyJSONToTextParser.TextColors` so that proper typing can be utilized if an individual value is needed * Fixed some buttons being discolored permanently once pressed * Sped up the animations of button ripples and tab switching * Added the ability to insert a new tab to `GameManager.add_client_tab` * Hovering over the "Command" button in CommonClient will now display the contents of `/help` as a popup (note: this popup can be too large on default height for adequately large /help (SC2 Client), but should always fit fine on fullscreen). * Fixed invalid sizing of MessageBox errors, and changed their text color to white
1 parent f48c7e7 commit 90db95b

File tree

4 files changed

+198
-52
lines changed

4 files changed

+198
-52
lines changed

Launcher.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,11 @@ def build(self):
359359

360360
self._refresh_components(self.current_filter)
361361

362+
# Uncomment to re-enable the Kivy console/live editor
363+
# Ctrl-E to enable it, make sure numlock/capslock is disabled
364+
# from kivy.modules.console import create_console
365+
# create_console(Window, self.top_screen)
366+
362367
return self.top_screen
363368

364369
def on_start(self):

data/client.kv

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,30 @@
1616
orange: "FF7700" # Used for command echo
1717
# KivyMD theming parameters
1818
theme_style: "Dark" # Light/Dark
19-
primary_palette: "Green" # Many options
20-
dynamic_scheme_name: "TONAL_SPOT"
19+
primary_palette: "Lightsteelblue" # Many options
20+
dynamic_scheme_name: "VIBRANT"
2121
dynamic_scheme_contrast: 0.0
2222
<MDLabel>:
2323
color: self.theme_cls.primaryColor
24+
<BaseButton>:
25+
ripple_color: app.theme_cls.primaryColor
26+
ripple_duration_in_fast: 0.2
27+
<MDTabsItemBase>:
28+
ripple_color: app.theme_cls.primaryColor
29+
ripple_duration_in_fast: 0.2
2430
<TooltipLabel>:
2531
adaptive_height: True
26-
font_size: dp(20)
32+
theme_font_size: "Custom"
33+
font_size: "20dp"
2734
markup: True
2835
halign: "left"
2936
<SelectableLabel>:
3037
size_hint: 1, None
38+
theme_text_color: "Custom"
39+
text_color: 1, 1, 1, 1
3140
canvas.before:
3241
Color:
33-
rgba: (.0, 0.9, .1, .3) if self.selected else self.theme_cls.surfaceContainerLowColor
42+
rgba: (self.theme_cls.primaryColor[0], self.theme_cls.primaryColor[1], self.theme_cls.primaryColor[2], .3) if self.selected else self.theme_cls.surfaceContainerLowestColor
3443
Rectangle:
3544
size: self.size
3645
pos: self.pos
@@ -154,9 +163,12 @@
154163
<ToolTip>:
155164
size: self.texture_size
156165
size_hint: None, None
166+
theme_font_size: "Custom"
157167
font_size: dp(18)
158168
pos_hint: {'center_y': 0.5, 'center_x': 0.5}
159169
halign: "left"
170+
theme_text_color: "Custom"
171+
text_color: (1, 1, 1, 1)
160172
canvas.before:
161173
Color:
162174
rgba: 0.2, 0.2, 0.2, 1
@@ -175,11 +187,28 @@
175187
rectangle: self.x-2, self.y-2, self.width+4, self.height+4
176188
<ServerToolTip>:
177189
pos_hint: {'center_y': 0.5, 'center_x': 0.5}
178-
<AutocompleteHintInput>
190+
<AutocompleteHintInput>:
179191
size_hint_y: None
180-
height: dp(30)
192+
height: "30dp"
181193
multiline: False
182194
write_tab: False
195+
pos_hint: {"center_x": 0.5, "center_y": 0.5}
196+
<ConnectBarTextInput>:
197+
height: "30dp"
198+
multiline: False
199+
write_tab: False
200+
role: "medium"
201+
size_hint_y: None
202+
pos_hint: {"center_x": 0.5, "center_y": 0.5}
203+
<CommandPromptTextInput>:
204+
size_hint_y: None
205+
height: "30dp"
206+
multiline: False
207+
write_tab: False
208+
pos_hint: {"center_x": 0.5, "center_y": 0.5}
209+
<MessageBoxLabel>:
210+
theme_text_color: "Custom"
211+
text_color: 1, 1, 1, 1
183212
<ScrollBox>:
184213
layout: layout
185214
bar_width: "12dp"

data/launcher.kv

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
size_hint: 1, None
66
height: "75dp"
77
context_button: context
8+
focus_behavior: False
89

910
MDRelativeLayout:
1011
ApAsyncImage:
1112
source: main.image
1213
size: (48, 48)
13-
size_hint_y: None
14+
size_hint: None, None
1415
pos_hint: {"center_x": 0.1, "center_y": 0.5}
1516

1617
MDLabel:
@@ -37,6 +38,7 @@
3738
pos_hint:{"center_x": 0.85, "center_y": 0.8}
3839
theme_text_color: "Custom"
3940
text_color: app.theme_cls.primaryColor
41+
detect_visible: False
4042
on_release: app.set_favorite(self)
4143

4244
MDIconButton:
@@ -46,14 +48,15 @@
4648
pos_hint:{"center_x": 0.95, "center_y": 0.8}
4749
theme_text_color: "Custom"
4850
text_color: app.theme_cls.primaryColor
51+
detect_visible: False
4952

5053
MDButton:
5154
pos_hint:{"center_x": 0.9, "center_y": 0.25}
5255
size_hint_y: None
5356
height: "25dp"
5457
component: main.component
5558
on_release: app.component_action(self)
56-
59+
detect_visible: False
5760
MDButtonText:
5861
text: "Open"
5962

0 commit comments

Comments
 (0)