Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: KivyMD and Launcher overhaul #3934

Open
wants to merge 57 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
4f3fbeb
kivymd testing
Silvris Feb 27, 2024
aa1ddb5
update kivymd to 2.0.1dev
Silvris Feb 28, 2024
db95e9a
attempt launcher changes, port scroll to main soon
Silvris Mar 2, 2024
5ab41c3
icons are actually showing now
Silvris Mar 2, 2024
2b51c6b
Merge remote-tracking branch 'upstream/main' into kivymd
Silvris Jun 2, 2024
3672fd1
slight launcher cleanup, still work to do there
Silvris Jun 2, 2024
9a979ba
load theme through kv, finally get images in icons
Silvris Jun 4, 2024
da20175
Merge remote-tracking branch 'upstream/main' into kivymd
Silvris Jul 5, 2024
6cb0cbe
test
Silvris Jul 5, 2024
367a6e8
test 2
Silvris Jul 5, 2024
7db16f0
found the problem
Silvris Jul 5, 2024
84e5ca6
fix launcher from merge
Silvris Jul 5, 2024
3a7e576
Merge remote-tracking branch 'upstream/main' into kivymd
Silvris Aug 25, 2024
b5e7d13
tooltips
Silvris Aug 25, 2024
224fa63
cleanup
Silvris Aug 25, 2024
35e580a
fix launcher background, remove unnecessary
Silvris Aug 26, 2024
de25172
Merge remote-tracking branch 'upstream/main' into kivymd
Silvris Sep 5, 2024
fb52ffa
launcher overhaul
Silvris Sep 6, 2024
dc29685
Merge remote-tracking branch 'upstream/main' into kivymd
Silvris Sep 9, 2024
7a0b346
Update Launcher.py
Silvris Sep 9, 2024
018df15
frozen build works, launcher shortcuts
Silvris Sep 12, 2024
2b11d57
lazy import to mask log message
Silvris Sep 12, 2024
49e426e
ladx client
Silvris Sep 12, 2024
83abe78
hopefully Wargroove
Silvris Sep 12, 2024
2643f9e
fix button issue
Silvris Sep 12, 2024
1c793ae
reimplement almost all of toggle button
Silvris Sep 12, 2024
398eb5c
huh kivy did the work for me
Silvris Sep 12, 2024
ded7c38
Update kvui.py
Silvris Sep 13, 2024
51cacde
revert WG changes other than tabs
Silvris Sep 13, 2024
3778ee7
sc2
Silvris Sep 13, 2024
ef10d91
common client cleanup
Silvris Sep 13, 2024
a7fe259
actually make launcher reflect color
Silvris Sep 13, 2024
238be83
lmao
Silvris Sep 13, 2024
fd022fb
unused bits, align EL
Silvris Sep 13, 2024
77f12e3
Merge remote-tracking branch 'upstream/main' into kivymd
Silvris Sep 13, 2024
3e47542
trim docstring
Silvris Sep 14, 2024
7437924
text and message coloring
Silvris Sep 14, 2024
4869573
add remove tab helper function
Silvris Sep 19, 2024
896a0bb
update size on add_widget for clienttabs
Silvris Sep 19, 2024
6b5f2c0
remove add_widget override
Silvris Sep 19, 2024
3bddf39
Merge remote-tracking branch 'upstream/main' into kivymd
Silvris Sep 27, 2024
9c285a0
Update kvui.py
Silvris Sep 28, 2024
05aead3
pin kivymd
Silvris Nov 28, 2024
5d362b0
Merge remote-tracking branch 'upstream/main' into kivymd
Silvris Nov 28, 2024
795d55c
init work for popup
Silvris Nov 28, 2024
70a5035
Update Launcher.py
Silvris Nov 28, 2024
137559c
cleanup
Silvris Nov 28, 2024
d8da0ee
Update Launcher.py
Silvris Nov 28, 2024
ca16184
remove fix_heights for good
Silvris Nov 28, 2024
5b04955
re-enable content scroll
Silvris Nov 28, 2024
c9c6128
Merge remote-tracking branch 'upstream/main' into kivymd
Silvris Nov 28, 2024
48d7d70
Merge remote-tracking branch 'upstream/main' into kivymd
Silvris Dec 5, 2024
d8b49fc
Update kvui.py
Silvris Dec 5, 2024
9e6e194
revert fix_heights removal for now
Silvris Dec 5, 2024
039af0f
broken lol
Silvris Dec 5, 2024
4d11f13
proper fix_heights fix
Silvris Dec 5, 2024
7faab2e
Merge branch 'main' into kivymd
Silvris Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 177 additions & 60 deletions Launcher.py

Large diffs are not rendered by default.

16 changes: 4 additions & 12 deletions LinksAwakeningClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,7 @@ def __init__(self, server_address: typing.Optional[str], password: typing.Option

def run_gui(self) -> None:
import webbrowser
import kvui
from kvui import Button, GameManager
from kivy.uix.image import Image
from kvui import GameManager, ImageButton

class LADXManager(GameManager):
logging_pairs = [
Expand All @@ -489,16 +487,10 @@ def build(self):
b = super().build()

if self.ctx.magpie_enabled:
button = Button(text="", size=(30, 30), size_hint_x=None,
on_press=lambda _: webbrowser.open('https://magpietracker.us/?enable_autotracker=1'))
image = Image(size=(16, 16), texture=magpie_logo())
button.add_widget(image)

def set_center(_, center):
image.center = center
button.bind(center=set_center)

button = ImageButton(texture=magpie_logo(), fit_mode="cover", image_size=(32, 32), size_hint_x=None,
on_press=lambda _: webbrowser.open('https://magpietracker.us/?enable_autotracker=1'))
self.connect_layout.add_widget(button)

return b

self.ui = LADXManager(self)
Expand Down
11 changes: 3 additions & 8 deletions WargrooveClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,11 @@ def on_package(self, cmd: str, args: dict):
def run_gui(self):
"""Import kivy UI system and start running it as self.ui_task."""
from kvui import GameManager, HoverBehavior, ServerToolTip
from kivy.uix.tabbedpanel import TabbedPanelItem
from kivymd.uix.tab import MDTabsItem, MDTabsItemText
from kivy.lang import Builder
from kivy.uix.button import Button
from kivy.uix.togglebutton import ToggleButton
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.image import AsyncImage, Image
from kivy.uix.stacklayout import StackLayout
from kivy.uix.label import Label
from kivy.properties import ColorProperty
from kivy.uix.image import Image
import pkgutil

class TrackerLayout(BoxLayout):
Expand Down Expand Up @@ -267,9 +261,10 @@ class WargrooveManager(GameManager):

def build(self):
container = super().build()
panel = TabbedPanelItem(text="Wargroove")
panel = MDTabsItem(MDTabsItemText(text="Wargroove"))
panel.content = self.build_tracker()
self.tabs.add_widget(panel)
self.tabs.carousel.add_widget(panel.content)
return container

def build_tracker(self) -> TrackerLayout:
Expand Down
19 changes: 10 additions & 9 deletions data/client.kv
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@
salmon: "FA8072" # typically trap item
white: "FFFFFF" # not used, if you want to change the generic text color change color in Label
orange: "FF7700" # Used for command echo
<Label>:
color: "FFFFFF"
<TabbedPanel>:
tab_width: root.width / app.tab_count
# KivyMD theming parameters
theme_style: "Dark" # Light/Dark
primary_palette: "Green" # Many options
<MDLabel>:
color: self.theme_cls.primaryColor
<TooltipLabel>:
text_size: self.width, None
size_hint_y: None
height: self.texture_size[1]
adaptive_height: True
font_size: dp(20)
markup: True
halign: "left"
<SelectableLabel>:
size_hint: 1, None
canvas.before:
Color:
rgba: (.0, 0.9, .1, .3) if self.selected else (0.2, 0.2, 0.2, 1)
rgba: (.0, 0.9, .1, .3) if self.selected else self.theme_cls.surfaceContainerLowColor
Rectangle:
size: self.size
pos: self.pos
Expand All @@ -49,7 +50,7 @@
<HintLabel>:
canvas.before:
Color:
rgba: (.0, 0.9, .1, .3) if self.selected else (0.2, 0.2, 0.2, 1) if self.striped else (0.18, 0.18, 0.18, 1)
rgba: (.0, 0.9, .1, .3) if self.selected else self.theme_cls.surfaceContainerHighColor if self.striped else self.theme_cls.surfaceContainerLowColor
Rectangle:
size: self.size
pos: self.pos
Expand Down
Loading
Loading