mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Core: post-KivyMD cleanup (#4815)
* Removed now unused imports from Launcher * Moved ImageIcon and ImageButton to use ApAsyncImage for compatibility with apworlds * Adjusted image size in the Launcher from 40x40 to 48x48. This is already larger than the size in previous versions, and a docs update is soon to follow. * Expose `dynamic_scheme_contrast` to user.kv, allowing users to set high contrast. * ScrollBox's default scroll_type was set to only content, so the scrollbar in Launcher was nonfunctional. * Adjusted the spacing of the title of a component when a description is present to be closer to the center. * Launcher now scrolls to the top automatically when changing between filters
This commit is contained in:
13
Launcher.py
13
Launcher.py
@@ -8,9 +8,7 @@ Archipelago Launcher
|
||||
Scroll down to components= to add components to the launcher as well as setup.py
|
||||
"""
|
||||
|
||||
import os
|
||||
import argparse
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import shlex
|
||||
@@ -132,7 +130,7 @@ def handle_uri(path: str, launch_args: Tuple[str, ...]) -> None:
|
||||
from kivymd.uix.dialog import MDDialog, MDDialogHeadlineText, MDDialogContentContainer, MDDialogSupportingText
|
||||
from kivymd.uix.divider import MDDivider
|
||||
|
||||
if client_component is None:
|
||||
if not client_component:
|
||||
run_component(text_client_component, *launch_args)
|
||||
return
|
||||
else:
|
||||
@@ -228,14 +226,13 @@ refresh_components: Optional[Callable[[], None]] = None
|
||||
|
||||
|
||||
def run_gui(path: str, args: Any) -> None:
|
||||
from kvui import (ThemedApp, MDFloatLayout, MDGridLayout, MDButton, MDLabel, MDButtonText, ScrollBox, ApAsyncImage)
|
||||
from kvui import (ThemedApp, MDFloatLayout, MDGridLayout, ScrollBox)
|
||||
from kivy.properties import ObjectProperty
|
||||
from kivy.core.window import Window
|
||||
from kivy.metrics import dp
|
||||
from kivymd.uix.button import MDIconButton
|
||||
from kivymd.uix.card import MDCard
|
||||
from kivymd.uix.menu import MDDropdownMenu
|
||||
from kivymd.uix.relativelayout import MDRelativeLayout
|
||||
from kivymd.uix.snackbar import MDSnackbar, MDSnackbarText
|
||||
|
||||
from kivy.lang.builder import Builder
|
||||
@@ -250,7 +247,6 @@ def run_gui(path: str, args: Any) -> None:
|
||||
self.image = image_path
|
||||
super().__init__(args, kwargs)
|
||||
|
||||
|
||||
class Launcher(ThemedApp):
|
||||
base_title: str = "Archipelago Launcher"
|
||||
top_screen: MDFloatLayout = ObjectProperty(None)
|
||||
@@ -337,6 +333,11 @@ def run_gui(path: str, args: Any) -> None:
|
||||
for card in cards:
|
||||
self.button_layout.layout.add_widget(card)
|
||||
|
||||
top = self.button_layout.children[0].y + self.button_layout.children[0].height \
|
||||
- self.button_layout.height
|
||||
scroll_percent = self.button_layout.convert_distance_to_scroll(0, top)
|
||||
self.button_layout.scroll_y = max(0, min(1, scroll_percent[1]))
|
||||
|
||||
def filter_clients(self, caller):
|
||||
self._refresh_components(caller.type)
|
||||
|
||||
|
Reference in New Issue
Block a user