Add customize qss support for theme.

Fix an issue that causes all feature flags will not be added to the launch command regardless of it is enabled.

Add some default themes.
This commit is contained in:
wei committed 2026-10-18 23:58:43 +08:00
1 parent 1754b01230
commit b7af7e3469
53 files changed
+1318 -129

No files matched your search

+110 -8
View File
@@ -1,12 +1,10 @@
# TestLauncher (TapLauncher) # TapLauncher
# Still thinking about its name...
# There's no stable branch because this project is still under development. # There's no stable branch because this project is still under development.
## How to use?
## How to use ? #### Below are the project dependencies. Install them before use the launcher.
#### Below are this project dependencies. Install them before use the launcher.
* `git` : [Website](https://git-scm.com/) * `git` : [Website](https://git-scm.com/)
* `uv` : [Install Guide](https://docs.astral.sh/uv/getting-started/installation/) * `uv` : [Install Guide](https://docs.astral.sh/uv/getting-started/installation/)
@@ -26,14 +24,118 @@ uv sync
``` ```
3. Run the launcher 3. Run the launcher
> The launcher provide `--work-dir` argument to change working directory. (If not provided, launcher will use application directory) > The launcher provide `--work-dir` argument to change the working directory. (If not provided, the launcher will use the application directory)
```bash ```bash
uv run python main.py uv run python main.py
uv run python main.py --work-dir path_to_work_dir # With custom working directory uv run python main.py --work-dir path_to_work_dir # With custom working directory
``` ```
### Themes
You can customize the appearance of the launcher by adding a new theme to the `data/themes` under working directory.
Its `palette.toml` defines colors, and `styles/*.qss` customizes individual pages.
To create a variant, create a folder to `<work-dir>/data/themes/<your-theme-id>` and edit its `theme.toml`, palette,
and QSS files. Restart the launcher to discover the new theme. You can copy the built-in theme folder as the reference.
Missing QSS files use the default styles. See the [custom theme guide](resources/themes/README.md) for details.
## Troubleshooting ## Troubleshooting
#### Unable to log in Microsoft account. Launcher throw error "Signing in to Minecraft services failed (HTTP 403). This account is not allowed to complete this step. Check Xbox privacy settings and account restrictions. Or check the client id has authorized to use Minecraft API." #### Unable to log in Microsoft account. Launcher throw error "Signing in to Minecraft services failed (HTTP 403). This account is not allowed to complete this step. Check Xbox privacy settings and account restrictions. Or check the client id has authorized to use Minecraft API."
Now this launcher have registered to Minecraft API. If you use custom client ID. Please make sure Now this launcher has registered to Minecraft API. If you use custom client ID. Please make sure
its valid and registered to API system (If not, see [this](https://forms.cloud.microsoft/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR-ajEQ1td1ROpz00KtS8Gd5UNVpPTkVLNFVROVQxNkdRMEtXVjNQQjdXVC4u)) it is valid and registered to the API system (If not, see [this](https://forms.cloud.microsoft/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR-ajEQ1td1ROpz00KtS8Gd5UNVpPTkVLNFVROVQxNkdRMEtXVjNQQjdXVC4u))
### Missing Python packages (`ModuleNotFoundError`)
Run `uv sync` from the project directory, then start the launcher with `uv run python main.py`.
This uses the project's environment instead of a separate system Python installation.
If the same module is still missing, include its name and the full traceback when reporting the issue.
### Invalid working directory or permission errors
If you see `Specified work directory "..." does not exist or is not a directory`, create the directory first.
Use a directory that your account can write to, and quote paths containing spaces:
```bash
uv run python main.py --work-dir "path to an existing directory"
```
For `PermissionError`, `Unable to save version manifest`, or `Unable to save profile`, check the permissions
and available disk space for the working directory and any custom game directory.
### Login session expired (`HTTP 401`)
For `Authentication failed. Session may expire.` or a message saying the login session is invalid or expired,
sign in again from the account page and retry. If signing in still fails, check the accompanying server message.
For `HTTP 429`, wait before retrying; repeated login attempts can keep hitting the service's request limit.
### Xbox account errors (`XErr`)
The launcher displays an Xbox error code when the account needs additional setup:
| Error code | Suggested action |
| --- | --- |
| `2148916233` | Sign in to Xbox and create an Xbox profile, then retry. |
| `2148916235` | Check whether Xbox Live is available for the account's country or region. |
| `2148916236` / `2148916237` | Complete the adult or age verification requested on the Xbox website. |
| `2148916238` | Ask an adult to add the child account to a Microsoft family and allow Xbox access. |
### Connection, manifest, or download failures
For `Unable to fetch version manifest`, `Unable to fetch asset manifest`, `Some files failed to download`,
or authentication connection/time-out errors:
1. Check your internet connection and whether your proxy or firewall permits the launcher to connect.
2. Retry later if the remote service is temporarily unavailable.
3. If downloads or saves still fail, check available disk space and write permissions.
4. For a file hash mismatch, retry the download. If it repeats, include the affected file path and error details
when reporting the issue.
### Java runtime missing or no longer available
For `No compatible Java runtime found (required major version: ...)` or
`No Java executable found for major version ...`, install or register a Java runtime matching the major version
shown in the error using the launcher's Java settings. A different major version may not satisfy the requirement.
If you see `Some runtimes are no longer available after last check`, check whether Java was moved or removed,
then refresh the runtime list or register its new executable path.
Links for available Java runtimes provider:
[Oracle](https://www.java.com/download/)
[Eclipse Temurin](https://adoptium.net/)
[Azul Zulu](https://www.azul.com/downloads/)
[Microsoft Build of OpenJDK](https://www.microsoft.com/openjdk)
### No profile selected or profile data cannot be loaded
For `There is no profile is selected. Please create one first.`, create a profile and select it before launching.
For `Unable to load profile` or a missing profile-key error, back up the profile data before attempting repairs.
Try creating a separate profile for the same game version to check whether the problem is limited to the original profile.
### Game closes immediately after launch
Check the Minecraft Log window for the error preceding the exit message. An exit code alone does not identify the cause.
If you changed the profile's Java arguments, try restoring those arguments to their previous values.
For a modded profile, try a separate vanilla profile for the same Minecraft version to help isolate the failure.
### Collecting debug information
Run the launcher from a terminal with debug logging enabled:
```bash
uv run python main.py --debug --work-dir "path to an existing directory"
```
Use the same working directory as the failing session so that the launcher loads the same data.
When reporting a problem, include the launcher version, operating system, Minecraft version, steps to reproduce,
and the relevant terminal output or Minecraft Log messages. Remove any sensitive information such as access tokens,
refresh tokens, and sign-in codes before sharing logs.
## Misc
### TODO
- [ ] Add support for installing Forge/Neoforge mod loader.
- [ ] Design the home page.
- [ ] Add more custom settings.
- [ ] Add a usage guide.
- [ ] Add download mod from third party website support.
- [ ] Add a simple plugin system, allows customizing launcher behavior such as adding a new page or button.
+32 -4
View File
@@ -12,7 +12,7 @@ except ModuleNotFoundError: # Python 3.10
from PySide6.QtCore import QSize from PySide6.QtCore import QSize
from PySide6.QtGui import QIcon, QPixmap, QPalette, QColor from PySide6.QtGui import QIcon, QPixmap, QPalette, QColor
from PySide6.QtWidgets import QApplication, QStyle, QToolButton from PySide6.QtWidgets import QApplication, QStyle, QToolButton, QWidget
from constant import LAUNCHER_VERSION from constant import LAUNCHER_VERSION
from core_lib.qt.hack import move_window_to_center, is_light_theme, \ from core_lib.qt.hack import move_window_to_center, is_light_theme, \
@@ -241,6 +241,21 @@ class Launcher(QApplication, LauncherObject):
def styles_path(self): def styles_path(self):
return self.resources_dir / "styles" return self.resources_dir / "styles"
def locate_styles_path(self, relative_path: Path | str) -> Path:
appearance = self.settings_manager.get("appearance", AppearanceSettings)
theme = getattr(self, "_active_theme", appearance.theme)
theme_directory = self._theme_packages().get(theme)
if not theme_directory:
return self.styles_path / relative_path
full_path = theme_directory / "styles" / relative_path
if not full_path.is_file():
return self.styles_path / relative_path
return full_path
@property @property
def built_in_themes_dir(self) -> Path: def built_in_themes_dir(self) -> Path:
return self.resources_dir / "themes" return self.resources_dir / "themes"
@@ -250,7 +265,8 @@ class Launcher(QApplication, LauncherObject):
return self.data_dir / "themes" return self.data_dir / "themes"
def apply_qss(self, qss_relative_path: Path, apply_qss_callback: Callable[[str], None]) -> str: def apply_qss(self, qss_relative_path: Path, apply_qss_callback: Callable[[str], None]) -> str:
full_path = self.styles_path / qss_relative_path full_path = self.locate_styles_path(qss_relative_path)
if not full_path.exists(): if not full_path.exists():
messagebox.error( messagebox.error(
None, None,
@@ -260,11 +276,14 @@ class Launcher(QApplication, LauncherObject):
return "" return ""
try: try:
data = full_path.read_text() data = full_path.read_text(encoding="utf-8")
apply_qss_callback(data) apply_qss_callback(data)
target = getattr(apply_qss_callback, "__self__", None)
if isinstance(target, QWidget):
target.setProperty("qssRelativePath", str(qss_relative_path))
except Exception as e: except Exception as e:
messagebox.error( messagebox.error(
self.main_window, None,
self.tr_text("Resource Error"), self.tr_text("Resource Error"),
self.tr_text( self.tr_text(
"Unable to apply QSS stylesheet {path}: {error}", "Unable to apply QSS stylesheet {path}: {error}",
@@ -297,6 +316,7 @@ class Launcher(QApplication, LauncherObject):
appearance = self.settings_manager.get("appearance", AppearanceSettings) appearance = self.settings_manager.get("appearance", AppearanceSettings)
theme = appearance.theme theme = appearance.theme
active_theme = theme
if theme == "system": if theme == "system":
# Apply system palette # Apply system palette
palette = QPalette(self._system_palette) palette = QPalette(self._system_palette)
@@ -309,6 +329,7 @@ class Launcher(QApplication, LauncherObject):
theme, theme,
) )
palette = QPalette(self._system_palette) palette = QPalette(self._system_palette)
active_theme = "system"
else: else:
try: try:
self._read_theme_manifest(directory / "theme.toml") self._read_theme_manifest(directory / "theme.toml")
@@ -321,10 +342,17 @@ class Launcher(QApplication, LauncherObject):
error, error,
) )
palette = QPalette(self._system_palette) palette = QPalette(self._system_palette)
active_theme = "system"
self._active_theme = active_theme
self.setPalette(palette) self.setPalette(palette)
# Application-wide styles also reach parentless dialogs and message boxes.
self.apply_qss(Path("main.qss"), self.setStyleSheet)
for widget in self.allWidgets(): for widget in self.allWidgets():
qss_path = widget.property("qssRelativePath")
if qss_path:
self.apply_qss(Path(qss_path), widget.setStyleSheet)
widget.style().unpolish(widget) widget.style().unpolish(widget)
widget.style().polish(widget) widget.style().polish(widget)
widget.update() widget.update()
+3 -1
View File
@@ -101,7 +101,7 @@ class FileObject:
return self.sha512 == expected_hash if expected_hash else self.expected_sha512 == self.sha512 return self.sha512 == expected_hash if expected_hash else self.expected_sha512 == self.sha512
def verify_md5(self, expected_hash=None): def verify_md5(self, expected_hash=None):
return self.sha1 == expected_hash if expected_hash else self.expected_sha1 == self.sha1 return self.md5 == expected_hash if expected_hash else self.expected_sha1 == self.md5
def verify(self, algorithm, expected_hash=None): def verify(self, algorithm, expected_hash=None):
if algorithm == "sha1": if algorithm == "sha1":
@@ -219,6 +219,8 @@ def download_file(file: FileObject, overwrite=True, progress_callback: Callable[
raise HashMismatchException("sha1", file.sha1, file.expected_sha1, file.posix_path) raise HashMismatchException("sha1", file.sha1, file.expected_sha1, file.posix_path)
elif file.expected_md5 and not file.verify_md5(): elif file.expected_md5 and not file.verify_md5():
raise HashMismatchException("md5", file.md5, file.expected_md5, file.posix_path) raise HashMismatchException("md5", file.md5, file.expected_md5, file.posix_path)
elif file.expected_sha512 and not file.verify_sha512():
raise HashMismatchException("sha512", file.sha512, file.expected_sha512, file.posix_path)
if any([file.expected_sha1, file.expected_md5, file.expected_sha256]): if any([file.expected_sha1, file.expected_md5, file.expected_sha256]):
logger.debug("File hash is match as the expected hash.") logger.debug("File hash is match as the expected hash.")
+6
View File
@@ -139,3 +139,9 @@ class ConfigValidationError(SettingsError):
f"[{section}]\n{error}" for section, error in self.errors.items() f"[{section}]\n{error}" for section, error in self.errors.items()
) )
super().__init__(f"Invalid settings configuration:\n{details}") super().__init__(f"Invalid settings configuration:\n{details}")
class ArgumentError(LauncherException):
user_message = "An error occurred while parsing arguments."
class ArgumentValueError(ArgumentError):
user_message = "An invalid argument value was provided."
+3
View File
@@ -48,6 +48,7 @@ class Account:
avatar: str = "" avatar: str = ""
type: str = "msa" type: str = "msa"
user_properties: list = field(default_factory=list) user_properties: list = field(default_factory=list)
xuid: str | None = None
def _datetime_string(value: str | datetime.datetime, field_name: str) -> str: def _datetime_string(value: str | datetime.datetime, field_name: str) -> str:
@@ -83,6 +84,7 @@ def create_account_data_from_object(account: Account) -> dict:
"type": account.type, "type": account.type,
"userProperties": deepcopy(account.user_properties), "userProperties": deepcopy(account.user_properties),
"username": account.username, "username": account.username,
"xuid": account.xuid,
} }
SUPPORT_DATA_URL_IMAGE_TYPE = [ SUPPORT_DATA_URL_IMAGE_TYPE = [
@@ -427,6 +429,7 @@ def convert_account_data_to_object(accounts: dict, account_id: str) -> Account:
avatar=data.get("avatar", ""), avatar=data.get("avatar", ""),
type=data.get("type", "msa"), type=data.get("type", "msa"),
user_properties=deepcopy(data.get("userProperties", [])), user_properties=deepcopy(data.get("userProperties", [])),
xuid=data.get("xuid"),
) )
+143 -20
View File
@@ -2,13 +2,54 @@ import json
import logging import logging
import re import re
import shlex import shlex
from dataclasses import dataclass
from typing import Callable
from core_lib.common.common import get_platform_info from core_lib.common.common import get_platform_info
from core_lib.common.exception import LauncherException from core_lib.common.exception import LauncherException, ArgumentValueError
from core_lib.game.library import get_natives_platform_info from core_lib.game.library import get_natives_platform_info
logger = logging.getLogger("Launcher.CoreLib") logger = logging.getLogger("Launcher.CoreLib")
# =============== Features ===============
@dataclass(frozen=True)
class FeatureSpec:
required_placeholders: tuple[str, ...] = ()
validate: Callable[[dict], None] | None = None
def validate_resolution(values: dict) -> None:
for key in ("resolution_width", "resolution_height"):
value = values[key]
if type(value) is not int or value <= 0:
raise ArgumentValueError(
f"{key} must be a positive integer."
)
FEATURE_SPECS = {
"has_custom_resolution": FeatureSpec(
required_placeholders=(
"resolution_width",
"resolution_height",
),
validate=validate_resolution,
),
"is_demo_user": FeatureSpec(),
"has_quick_plays_support": FeatureSpec(
required_placeholders=("quickPlayPath",),
),
"is_quick_play_singleplayer": FeatureSpec(
required_placeholders=("quickPlaySingleplayer",),
),
"is_quick_play_multiplayer": FeatureSpec(
required_placeholders=("quickPlayMultiplayer",),
),
"is_quick_play_realms": FeatureSpec(
required_placeholders=("quickPlayRealms",),
),
}
# =============== Features end ===============
def compare_versions(left: str, right: str) -> int: def compare_versions(left: str, right: str) -> int:
left_parts = tuple(map(int, left.split("."))) left_parts = tuple(map(int, left.split(".")))
right_parts = tuple(map(int, right.split("."))) right_parts = tuple(map(int, right.split(".")))
@@ -104,12 +145,24 @@ def is_argument_allowed(argument: dict | str, allow_features: dict | None = None
return allowed return allowed
def replace_placeholders(argument, placeholders: dict) -> str: PLACEHOLDER_PATTERN = re.compile(r"\$\{([^{}]+)\}")
if argument:
for key, value in placeholders.items():
argument = argument.replace("${" + key + "}", "" if value is None else str(value))
return argument def replace_placeholders(argument, placeholders: dict, *, strict: bool = False,) -> str:
def replace(match: re.Match) -> str:
key = match.group(1)
if key not in placeholders or placeholders[key] is None:
if not strict:
return match.group(0)
reason = "unknown" if key not in placeholders else "has no value"
raise ArgumentValueError(
f"Argument placeholder {reason}: {key}"
)
return str(placeholders[key])
return PLACEHOLDER_PATTERN.sub(replace, argument)
class ArgumentMappings: class ArgumentMappings:
@@ -217,7 +270,9 @@ def find_game_and_jvm_args(arguments: dict | str) -> tuple[list, list]:
return game_args, jvm_args return game_args, jvm_args
def parse_and_generate_arguments(arguments: list | str, mappings: ArgumentMappings, features: dict | None = None) -> \ def parse_and_generate_arguments(arguments: list | str, mappings: ArgumentMappings,
features: dict | None = None, *, extra_placeholders: dict | None = None,
strict_placeholders: bool = False) -> \
list[str]: list[str]:
if features is None: if features is None:
features = {} features = {}
@@ -230,6 +285,9 @@ def parse_and_generate_arguments(arguments: list | str, mappings: ArgumentMappin
placeholders = mappings.generate_placeholders() placeholders = mappings.generate_placeholders()
if extra_placeholders:
placeholders.update(extra_placeholders)
for argument in arguments: for argument in arguments:
# Check rules # Check rules
if not is_argument_allowed(argument, allow_features=features): if not is_argument_allowed(argument, allow_features=features):
@@ -237,7 +295,7 @@ def parse_and_generate_arguments(arguments: list | str, mappings: ArgumentMappin
# Each argument (section) may contain multiple items, convert it to list before replace placeholder # Each argument (section) may contain multiple items, convert it to list before replace placeholder
for item in convert_argument_to_multiple_string(argument): for item in convert_argument_to_multiple_string(argument):
parsed = replace_placeholders(item, placeholders) parsed = replace_placeholders(item, placeholders, strict=strict_placeholders)
parsed_arguments.append(parsed) parsed_arguments.append(parsed)
return parsed_arguments return parsed_arguments
@@ -265,19 +323,80 @@ def append_missing_necessary_jvm_arguments(arguments: list, arg_maps: ArgumentMa
return result return result
def add_feature_arguments(arguments: dict, arg_maps: ArgumentMappings, features: dict | None = None) -> list[str]: def find_match_feature_argument(arguments: list | str, feature) -> dict | None:
result = [] if isinstance(arguments, str):
arguments = shlex.split(arguments)
if features is None: for argument in arguments:
return result # Check rules
if not is_argument_allowed(argument, allow_features=feature):
continue
if features.get("has_custom_resolution"): # Only dict argument has feature rule
result.append(f"-Dminecraft.overrideResolution={features['resolution']}") if not isinstance(argument, dict):
continue
return argument
return None
def generate_enabled_feature_arguments(arguments: list | str, arg_maps: ArgumentMappings,
features: dict | None = None, feature_placeholders: dict | None=None,
strict_placeholders=False) -> list[str]:
enabled_features = dict(features or {})
extra_values = dict(feature_placeholders or {})
values = arg_maps.generate_placeholders()
values.update(extra_values)
for name, enabled in enabled_features.items():
if type(enabled) is not bool:
raise ArgumentValueError(
f"Feature {name} must be a boolean."
)
if not enabled:
continue
spec = FEATURE_SPECS.get(name)
# Ignore unknown feature flag, hand it to parse_and_generate_arguments
if spec is None:
continue
for key in spec.required_placeholders:
if key not in values or values[key] is None or values[key] == "":
raise ArgumentValueError(
f"Feature {name} requires placeholder {key}."
)
if spec.validate:
spec.validate(values)
return parse_and_generate_arguments(
arguments,
arg_maps,
features=enabled_features,
extra_placeholders=extra_values,
strict_placeholders=strict_placeholders,
)
def generate_feature_placeholders(maps: ArgumentMappings):
if not isinstance(maps.resolution, tuple):
width, height = None, None
else:
width = maps.resolution[0]
height = maps.resolution[1] or None
return {
"resolution_width": width,
"resolution_height": height,
}
return result
def generate_launch_command(arg_maps: ArgumentMappings, main_class: str, java_path: str, full_args: dict | str def generate_launch_command(arg_maps: ArgumentMappings, main_class: str, java_path: str, full_args: dict | str
, features: dict | None = None, user_jvm_args: list[str] | None | str = None) -> list[str]: , features: dict | None = None, user_jvm_args: list[str] | None | str = None,
strict_placeholders=False) -> list[str]:
cmd = [java_path] cmd = [java_path]
game_args, jvm_args = find_game_and_jvm_args(full_args) game_args, jvm_args = find_game_and_jvm_args(full_args)
@@ -296,6 +415,7 @@ def generate_launch_command(arg_maps: ArgumentMappings, main_class: str, java_pa
default_args, default_args,
arg_maps, arg_maps,
features=features, features=features,
strict_placeholders=strict_placeholders,
) )
else: else:
# Use jvm arguments that provided by user # Use jvm arguments that provided by user
@@ -305,13 +425,17 @@ def generate_launch_command(arg_maps: ArgumentMappings, main_class: str, java_pa
jvm_args, jvm_args,
arg_maps, arg_maps,
features=features, features=features,
strict_placeholders=strict_placeholders,
) )
parsed_game_args = parse_and_generate_arguments( feature_placeholders = generate_feature_placeholders(arg_maps)
parsed_game_args = generate_enabled_feature_arguments(
game_args, game_args,
arg_maps, arg_maps,
features=features, features=features,
) feature_placeholders=feature_placeholders,
strict_placeholders=strict_placeholders,
) # Generate arguments that enabled by features and necessary arguments that from manifest
# Legacy Minecraft don't have jvm arguments exist in the version library. We need to generate by ourselves # Legacy Minecraft don't have jvm arguments exist in the version library. We need to generate by ourselves
parsed_jvm_args = append_missing_necessary_jvm_arguments( parsed_jvm_args = append_missing_necessary_jvm_arguments(
@@ -322,7 +446,6 @@ def generate_launch_command(arg_maps: ArgumentMappings, main_class: str, java_pa
cmd.extend(parsed_jvm_args) cmd.extend(parsed_jvm_args)
cmd.append(main_class) cmd.append(main_class)
cmd.extend(parsed_game_args) cmd.extend(parsed_game_args)
return cmd return cmd
+36 -4
View File
@@ -10,7 +10,7 @@ from typing import Callable
import requests import requests
from core_lib.common.exception import AuthenticationSessionException, AuthenticationConnectException, \ from core_lib.common.exception import LauncherException, AuthenticationSessionException, AuthenticationConnectException, \
AuthenticationException, LauncherHTTPException AuthenticationException, LauncherHTTPException
MICROSOFT_DEVICE_CODE_URL = "https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode" MICROSOFT_DEVICE_CODE_URL = "https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode"
@@ -259,7 +259,8 @@ def get_xbox_token_and_user_hash(access_token: str) -> tuple[str, str, dict]:
data = auth_exception_handler(_request_handler, stage="Signing in to Xbox Live") data = auth_exception_handler(_request_handler, stage="Signing in to Xbox Live")
return verify_data(data) return verify_data(data)
def get_xsts_token(xbox_token: str) -> tuple[str, dict]: def get_xsts_token(xbox_token: str, *,
relying_party: str = "rp://api.minecraftservices.com/") -> tuple[str, dict]:
""" """
Get xsts token Get xsts token
:param xbox_token: :param xbox_token:
@@ -270,9 +271,9 @@ def get_xsts_token(xbox_token: str) -> tuple[str, dict]:
def _request_handler(): def _request_handler():
r = requests.post(XSTS_AUTH_URL, json={ r = requests.post(XSTS_AUTH_URL, json={
"Properties": {"SandboxId": "RETAIL", "UserTokens": [xbox_token]}, "Properties": {"SandboxId": "RETAIL", "UserTokens": [xbox_token]},
"RelyingParty": "rp://api.minecraftservices.com/", "RelyingParty": relying_party,
"TokenType": "JWT", "TokenType": "JWT",
}, headers={"Accept": "application/json"}) }, headers={"Accept": "application/json"}, timeout=30)
r.raise_for_status() r.raise_for_status()
return r.json() return r.json()
@@ -295,6 +296,37 @@ def get_xsts_token(xbox_token: str) -> tuple[str, dict]:
return verify_data(data) return verify_data(data)
def extract_xuid(data: dict, user_hash: str) -> str | None:
"""Read the numeric Xbox ID for the same user as the authentication chain."""
if not isinstance(data, dict):
return None
claims = data.get("DisplayClaims")
users = claims.get("xui") if isinstance(claims, dict) else None
if not isinstance(users, list):
return None
for user in users:
if not isinstance(user, dict) or user.get("uhs") != user_hash:
continue
xuid = user.get("xid")
if isinstance(xuid, str) and len(xuid) <= 20 and xuid.isascii() and xuid.isdecimal():
if 0 < int(xuid) < 2 ** 64:
return xuid
return None
def get_xbox_xuid(xbox_token: str, user_hash: str, xsts_data: dict) -> str | None:
"""Best-effort XUID lookup without changing the Minecraft token's relying party."""
xuid = extract_xuid(xsts_data, user_hash)
if xuid is not None:
return xuid
try:
_, xbox_data = get_xsts_token(xbox_token, relying_party="https://xboxlive.com")
except (LauncherException, requests.RequestException):
logger.warning("Unable to retrieve optional Xbox user ID; continuing without it.")
return None
return extract_xuid(xbox_data, user_hash)
def get_minecraft_access_token(user_hash: str, xsts_token: str) -> tuple[str, dict]: def get_minecraft_access_token(user_hash: str, xsts_token: str) -> tuple[str, dict]:
""" """
Get minecraft access token Get minecraft access token
+1
View File
@@ -6,6 +6,7 @@ def create_messagebox(parent: QWidget | None, title: str, message: str,
icon: QMessageBox.Icon = QMessageBox.Icon.Information, icon: QMessageBox.Icon = QMessageBox.Icon.Information,
button: QMessageBox.StandardButton = QMessageBox.StandardButton.Ok) -> QMessageBox: button: QMessageBox.StandardButton = QMessageBox.StandardButton.Ok) -> QMessageBox:
msg = QMessageBox(parent) msg = QMessageBox(parent)
msg.setOption(QMessageBox.Option.DontUseNativeDialog, True)
msg.setWindowTitle(title) msg.setWindowTitle(title)
msg.setText(message) msg.setText(message)
msg.setIcon(icon) msg.setIcon(icon)
+4 -3
View File
@@ -155,9 +155,10 @@ class ProgressDialog(QDialog):
row = self.rows[task_id] row = self.rows[task_id]
row.status_label.setText(f"Failed: {error}") row.status_label.setText(f"Failed: {error}")
row.progress_bar.setStyleSheet( row.progress_bar.setProperty("failed", True)
"QProgressBar::chunk { background-color: #c62828; }" row.progress_bar.style().unpolish(row.progress_bar)
) row.progress_bar.style().polish(row.progress_bar)
row.progress_bar.update()
# Move to top # Move to top
self.download_layout.removeWidget(row) self.download_layout.removeWidget(row)
self.download_layout.insertWidget(0, row) self.download_layout.insertWidget(0, row)
+18 -3
View File
@@ -38,7 +38,7 @@ from core_lib.game.account import (
) )
from core_lib.game.authentication import get_xbox_token_and_user_hash, get_microsoft_token, get_xsts_token, \ from core_lib.game.authentication import get_xbox_token_and_user_hash, get_microsoft_token, get_xsts_token, \
get_minecraft_access_token, get_account_entitlements, get_minecraft_profile, has_minecraft_license, \ get_minecraft_access_token, get_account_entitlements, get_minecraft_profile, has_minecraft_license, \
get_device_code, refresh_microsoft_token, is_access_token_valid get_device_code, refresh_microsoft_token, is_access_token_valid, get_xbox_xuid
from core_lib.game.third_party import get_minecraft_head from core_lib.game.third_party import get_minecraft_head
from core_lib.qt.hack import data_url_to_qt_image from core_lib.qt.hack import data_url_to_qt_image
from manager.settings_models import AccountSettings from manager.settings_models import AccountSettings
@@ -65,6 +65,7 @@ class AccountDetail(AccountSummary):
access_token_expires_at: str | datetime.datetime access_token_expires_at: str | datetime.datetime
refresh_token_expires_at: str | datetime.datetime refresh_token_expires_at: str | datetime.datetime
user_properties: list user_properties: list
xuid: str | None = None
@dataclass(frozen=True) @dataclass(frozen=True)
@@ -80,6 +81,7 @@ class CreateAccountRequest:
avatar: str = "" avatar: str = ""
account_type: str = "msa" account_type: str = "msa"
user_properties: list = field(default_factory=list) user_properties: list = field(default_factory=list)
xuid: str | None = None
class _AccountUnsetType: class _AccountUnsetType:
@@ -106,6 +108,7 @@ class UpdateAccountRequest:
avatar: str | None = None avatar: str | None = None
account_type: str | None = None account_type: str | None = None
user_properties: list | _AccountUnsetType = _UNSET user_properties: list | _AccountUnsetType = _UNSET
xuid: str | None = None
@dataclass(frozen=True) @dataclass(frozen=True)
@@ -116,6 +119,7 @@ class LaunchAccount:
access_token: str = field(repr=False) access_token: str = field(repr=False)
user_type: str = "msa" user_type: str = "msa"
user_properties: list = field(default_factory=list) user_properties: list = field(default_factory=list)
xuid: str | None = None
@dataclass(frozen=True) @dataclass(frozen=True)
@@ -409,6 +413,7 @@ class AccountManager(QObject):
access_token_expires_at=account.access_token_expires_at, access_token_expires_at=account.access_token_expires_at,
refresh_token_expires_at=account.refresh_token_expires_at, refresh_token_expires_at=account.refresh_token_expires_at,
user_properties=copy.deepcopy(account.user_properties), user_properties=copy.deepcopy(account.user_properties),
xuid=account.xuid,
) )
def contains(self, account_id: str, show_error: bool = False) -> bool: def contains(self, account_id: str, show_error: bool = False) -> bool:
@@ -474,6 +479,7 @@ class AccountManager(QObject):
avatar=request.avatar, avatar=request.avatar,
type=request.account_type, type=request.account_type,
user_properties=copy.deepcopy(request.user_properties), user_properties=copy.deepcopy(request.user_properties),
xuid=request.xuid,
) )
# Check before actually update # Check before actually update
@@ -525,6 +531,7 @@ class AccountManager(QObject):
"refresh_token_expires_at": "refreshTokenExpiresAt", "refresh_token_expires_at": "refreshTokenExpiresAt",
"avatar": "avatar", "avatar": "avatar",
"account_type": "type", "account_type": "type",
"xuid": "xuid",
} }
# Replace value inside the account raw data to new value (from UpdateAccountRequest) # Replace value inside the account raw data to new value (from UpdateAccountRequest)
@@ -699,6 +706,7 @@ class AccountManager(QObject):
access_token=access_token, access_token=access_token,
user_type=account.account_type, user_type=account.account_type,
user_properties=copy.deepcopy(account.user_properties), user_properties=copy.deepcopy(account.user_properties),
xuid=account.xuid,
) )
# Validation # Validation
@@ -1165,6 +1173,7 @@ class AccountManager(QObject):
refresh_token=result["refresh_token"], refresh_token=result["refresh_token"],
access_token_expires_at=result["access_token_expires_at"], access_token_expires_at=result["access_token_expires_at"],
refresh_token_expires_at=result["refresh_token_expires_at"], refresh_token_expires_at=result["refresh_token_expires_at"],
xuid=result.get("xuid"),
), ),
) )
if updated and self.save(): if updated and self.save():
@@ -1259,6 +1268,7 @@ class AccountManager(QObject):
minecraft_uuid=account_id, # account_id's value is provided account's uuid minecraft_uuid=account_id, # account_id's value is provided account's uuid
minecraft_name=account.get("name", ""), minecraft_name=account.get("name", ""),
account_type="msa", account_type="msa",
xuid=account.get("xuid"),
) )
if self.contains(account_id): if self.contains(account_id):
@@ -1273,6 +1283,7 @@ class AccountManager(QObject):
minecraft_uuid=request.minecraft_uuid, minecraft_uuid=request.minecraft_uuid,
minecraft_name=request.minecraft_name, minecraft_name=request.minecraft_name,
account_type=request.account_type, account_type=request.account_type,
xuid=request.xuid,
), ),
) )
if not updated: if not updated:
@@ -1550,7 +1561,8 @@ class LoginWorker(QObject):
xbox_token, user_hash, _ = get_xbox_token_and_user_hash(microsoft_access_token) xbox_token, user_hash, _ = get_xbox_token_and_user_hash(microsoft_access_token)
self.progress_changed.emit(65, "Getting XSTS token...", False) self.progress_changed.emit(65, "Getting XSTS token...", False)
xsts_token, _ = get_xsts_token(xbox_token) xsts_token, xsts_data = get_xsts_token(xbox_token)
xuid = get_xbox_xuid(xbox_token, user_hash, xsts_data)
self.progress_changed.emit(75, "Getting minecraft access token...", False) self.progress_changed.emit(75, "Getting minecraft access token...", False)
minecraft_access_token, minecraft = get_minecraft_access_token(user_hash, xsts_token) minecraft_access_token, minecraft = get_minecraft_access_token(user_hash, xsts_token)
@@ -1579,6 +1591,7 @@ class LoginWorker(QObject):
# Microsoft does not provide a refresh-token expiry timestamp. # Microsoft does not provide a refresh-token expiry timestamp.
"refresh_token_expires_at": now + datetime.timedelta(days=90), "refresh_token_expires_at": now + datetime.timedelta(days=90),
"has_license": has_minecraft_license(entitlements), "has_license": has_minecraft_license(entitlements),
"xuid": xuid,
}) })
self.progress_changed.emit(100, "Finished!", True) self.progress_changed.emit(100, "Finished!", True)
except InterruptedError: except InterruptedError:
@@ -1616,7 +1629,8 @@ class TokenRefreshWorker(QObject):
self.client_id, self.refresh_token self.client_id, self.refresh_token
) )
xbox_token, user_hash, _ = get_xbox_token_and_user_hash(microsoft_token) xbox_token, user_hash, _ = get_xbox_token_and_user_hash(microsoft_token)
xsts_token, _ = get_xsts_token(xbox_token) xsts_token, xsts_data = get_xsts_token(xbox_token)
xuid = get_xbox_xuid(xbox_token, user_hash, xsts_data)
minecraft_token, minecraft = get_minecraft_access_token(user_hash, xsts_token) minecraft_token, minecraft = get_minecraft_access_token(user_hash, xsts_token)
now = datetime.datetime.now(datetime.timezone.utc) now = datetime.datetime.now(datetime.timezone.utc)
@@ -1630,6 +1644,7 @@ class TokenRefreshWorker(QObject):
refresh_expires_in = 90 * 86400 refresh_expires_in = 90 * 86400
self.succeeded.emit(self.account_id, { self.succeeded.emit(self.account_id, {
"xuid": xuid,
"access_token": minecraft_token, "access_token": minecraft_token,
"refresh_token": refresh_token, "refresh_token": refresh_token,
"access_token_expires_at": now + datetime.timedelta(seconds=expires_in), "access_token_expires_at": now + datetime.timedelta(seconds=expires_in),
+4 -2
View File
@@ -1170,6 +1170,7 @@ class LaunchManager:
auth_uuid=launch_account.minecraft_uuid, auth_uuid=launch_account.minecraft_uuid,
auth_access_token=launch_account.access_token, auth_access_token=launch_account.access_token,
clientid=CLIENT_ID, clientid=CLIENT_ID,
auth_xuid=launch_account.xuid,
user_type=launch_account.user_type, user_type=launch_account.user_type,
version_type=profile.version_type, version_type=profile.version_type,
natives_directory=natives_dir.as_posix(), natives_directory=natives_dir.as_posix(),
@@ -1178,7 +1179,7 @@ class LaunchManager:
classpath=classpath, classpath=classpath,
classpath_separator=os.pathsep, classpath_separator=os.pathsep,
library_directory=libraries_dir.as_posix(), library_directory=libraries_dir.as_posix(),
resolution=profile.resolution, resolution=profile.resolution
) )
target_args = arguments if arguments else old_args target_args = arguments if arguments else old_args
@@ -1271,7 +1272,8 @@ class LaunchManager:
java_path=java_path, java_path=java_path,
full_args=target_args, full_args=target_args,
features=features, features=features,
user_jvm_args=profile.java_args user_jvm_args=profile.java_args,
strict_placeholders=False,
) )
safe_cmd = ["<access token>" if value == launch_account.access_token else value for value in cmd] safe_cmd = ["<access token>" if value == launch_account.access_token else value for value in cmd]
+3 -3
View File
@@ -10,6 +10,7 @@ from core_lib.game.version_info import LATEST_VERSION_ALIASES
from manager.profile import ProfileSummary, LaunchProfile, ProfileManager from manager.profile import ProfileSummary, LaunchProfile, ProfileManager
from manager.widgets import AskForRequest, WidgetManager from manager.widgets import AskForRequest, WidgetManager
from pages.process_log import ProcessLogWindow from pages.process_log import ProcessLogWindow
from core_lib.qt.item_button import ItemButton
class ProfileButton(QFrame): class ProfileButton(QFrame):
@@ -46,7 +47,6 @@ class ProfileButton(QFrame):
self.version_label.setObjectName("profileVersion") self.version_label.setObjectName("profileVersion")
self.arrow_label = QLabel("▾") self.arrow_label = QLabel("▾")
self.arrow_label.setObjectName("profileArrow") self.arrow_label.setObjectName("profileArrow")
self.arrow_label.setStyleSheet("border-style:solid; background-color: transparent; ")
self.arrow_label.setAlignment(Qt.AlignmentFlag.AlignCenter) self.arrow_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.arrow_label.setFixedWidth(24) self.arrow_label.setFixedWidth(24)
@@ -87,7 +87,7 @@ class ProfileButton(QFrame):
self.clicked.emit() self.clicked.emit()
super().mousePressEvent(event) super().mousePressEvent(event)
class ProfileListItem(QPushButton): class ProfileListItem(ItemButton):
selected = Signal(object) selected = Signal(object)
def __init__(self, profile: ProfileSummary, parent: QWidget | None = None) -> None: def __init__(self, profile: ProfileSummary, parent: QWidget | None = None) -> None:
@@ -209,7 +209,7 @@ class LaunchProfilePage(QWidget):
# Widgets # Widgets
self.status_label = QLabel(self.app.tr_text("Select a profile to launch")) self.status_label = QLabel(self.app.tr_text("Select a profile to launch"))
self.status_label.setStyleSheet("font-size: 12px; font-weight: 600;") self.status_label.setObjectName("launchStatus")
self.status_label.setAlignment(Qt.AlignmentFlag.AlignCenter) self.status_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
# Profile button (just like the official launcher look like) # Profile button (just like the official launcher look like)
+2 -1
View File
@@ -12,9 +12,10 @@ from PySide6.QtWidgets import (
from manager.profile import ProfileDetail, ProfileManager, ProfileSummary, UpdateProfileRequest from manager.profile import ProfileDetail, ProfileManager, ProfileSummary, UpdateProfileRequest
from manager.game import AvailableVersion from manager.game import AvailableVersion
from pages.add_modded_version import AddModdedVersionDialog from pages.add_modded_version import AddModdedVersionDialog
from core_lib.qt.item_button import ItemButton
class ManageProfileItem(QPushButton): class ManageProfileItem(ItemButton):
selected = Signal(object) selected = Signal(object)
def __init__(self, app, profile: ProfileSummary, def __init__(self, app, profile: ProfileSummary,
+2 -69
View File
@@ -3,6 +3,7 @@ import threading
from collections import deque from collections import deque
from collections.abc import Callable from collections.abc import Callable
from datetime import datetime from datetime import datetime
from pathlib import Path
from PySide6.QtCore import QObject, Signal from PySide6.QtCore import QObject, Signal
from PySide6.QtGui import QCloseEvent from PySide6.QtGui import QCloseEvent
@@ -79,75 +80,7 @@ class ProcessLogWindow(QMainWindow):
layout.addWidget(self.log_output) layout.addWidget(self.log_output)
self.setCentralWidget(container) self.setCentralWidget(container)
self.setStyleSheet( self.app.apply_qss(Path("process_log.qss"), self.setStyleSheet)
"""
QMainWindow {
spacing: 0;
}
QPlainTextEdit {
background-color: #0f0f10;
color: "#e5e5e5";
font-family: Consolas;
font-size: 10pt;
}
QScrollBar:vertical {
background-color: #0f0f10;
width: 5px;
margin: 0;
}
QScrollBar::handle:vertical {
background-color: #3a3a3a;
min-height: 24px;
border-radius: 5px;
}
QScrollBar::handle:vertical:hover {
background-color: #4a4a4a;
}
QScrollBar::add-line:vertical,
QScrollBar::sub-line:vertical {
height: 0;
}
QScrollBar::add-page:vertical,
QScrollBar::sub-page:vertical {
background: none;
}
/* Horizontal scrollbar */
QScrollBar:horizontal {
background-color: #0f0f10;
height: 5px;
margin: 0;
}
QScrollBar::handle:horizontal {
background-color: #3a3a3a;
min-width: 24px;
border-radius: 5px;
}
QScrollBar::handle:horizontal:hover {
background-color: #4a4a4a;
}
QScrollBar::add-line:horizontal,
QScrollBar::sub-line:horizontal {
width: 0;
}
QScrollBar::add-page:horizontal,
QScrollBar::sub-page:horizontal {
background: none;
}
"""
)
self._signals.output.connect(self._append_output) self._signals.output.connect(self._append_output)
self._signals.finished.connect(self._process_finished) self._signals.finished.connect(self._process_finished)
+8 -1
View File
@@ -16,6 +16,7 @@ from PySide6.QtWidgets import (
) )
from constant import LAUNCHER_DESCRIPTION, LAUNCHER_NAME, LAUNCHER_VERSION from constant import LAUNCHER_DESCRIPTION, LAUNCHER_NAME, LAUNCHER_VERSION
from core_lib.qt import messagebox
from manager.settings_models import AccountSettings, AppearanceSettings, GeneralSettings from manager.settings_models import AccountSettings, AppearanceSettings, GeneralSettings
LANGUAGE_LABELS = { LANGUAGE_LABELS = {
@@ -403,6 +404,7 @@ class SettingsPage(QWidget):
self.client_id_edit.selectAll() self.client_id_edit.selectAll()
return False return False
old_theme = self.settings.get("appearance", AppearanceSettings).theme
data = { data = {
"general": {"language": self.language_combo.currentData()}, "general": {"language": self.language_combo.currentData()},
"appearance": {"theme": self.theme_combo.currentData()}, "appearance": {"theme": self.theme_combo.currentData()},
@@ -410,7 +412,7 @@ class SettingsPage(QWidget):
"credentials_save_method": selected_credentials_method, "credentials_save_method": selected_credentials_method,
"token_refresh_interval": "token_refresh_interval":
current_token_refresh_interval current_token_refresh_interval
}, }
} }
try: try:
self.settings.validate(data) self.settings.validate(data)
@@ -456,6 +458,11 @@ class SettingsPage(QWidget):
QMessageBox.critical(self, self.app.tr_text("Settings error"), str(error)) QMessageBox.critical(self, self.app.tr_text("Settings error"), str(error))
return False return False
if old_theme !=self.settings.get("appearance", AppearanceSettings).theme:
messagebox.info(None, "Launcher",
self.app.tr_text("To make all page apply new theme."
" Is recommend to restart the launcher after change it."))
self._settings_dirty = False self._settings_dirty = False
selected_language = data["general"]["language"] selected_language = data["general"]["language"]
self.app.apply_language(selected_language) self.app.apply_language(selected_language)
+8 -9
View File
@@ -1,7 +1,6 @@
import json import json
import subprocess import subprocess
import sys import sys
import textwrap
import threading import threading
import traceback import traceback
from pathlib import Path from pathlib import Path
@@ -10,6 +9,7 @@ from PySide6.QtCore import Qt, QObject, Signal, Slot
from PySide6.QtWidgets import QPushButton, QVBoxLayout, QPlainTextEdit, \ from PySide6.QtWidgets import QPushButton, QVBoxLayout, QPlainTextEdit, \
QHBoxLayout, QComboBox, QWidget QHBoxLayout, QComboBox, QWidget
from constant import CLIENT_ID
from core_lib.common.common import FileObject, download_multiple_files from core_lib.common.common import FileObject, download_multiple_files
from core_lib.common.exception import VersionNotSelectedException, UnsupportedPlatformException, \ from core_lib.common.exception import VersionNotSelectedException, UnsupportedPlatformException, \
NativeResolveException, DownloadException, DependencyException, AssetManifestFetchException, \ NativeResolveException, DownloadException, DependencyException, AssetManifestFetchException, \
@@ -106,12 +106,7 @@ class TestPage(QWidget):
self.setLayout(self.layout) self.setLayout(self.layout)
self.setStyleSheet( self.app.apply_qss(Path("test.qss"), self.setStyleSheet)
textwrap.dedent("""
QPushButton#ActionButton {
padding: 6px 12px;
}
"""))
self.signals = self.PageSignals(self) self.signals = self.PageSignals(self)
@@ -663,11 +658,13 @@ class TestPage(QWidget):
game_args, jvm_args = find_game_and_jvm_args(target_args) game_args, jvm_args = find_game_and_jvm_args(target_args)
parsed_jvm_args = parse_and_generate_arguments( parsed_jvm_args = parse_and_generate_arguments(
jvm_args, jvm_args,
arg_maps arg_maps,
strict_placeholders=False,
) )
parsed_game_args = parse_and_generate_arguments( parsed_game_args = parse_and_generate_arguments(
game_args, game_args,
arg_maps arg_maps,
strict_placeholders=False,
) )
self.widget_mgr.download_signal.log.emit(f"Parsed jvm arguments: \n{parsed_jvm_args}\n{" ".join(parsed_jvm_args)}") self.widget_mgr.download_signal.log.emit(f"Parsed jvm arguments: \n{parsed_jvm_args}\n{" ".join(parsed_jvm_args)}")
self.widget_mgr.download_signal.log.emit(f"Parsed game arguments: \n{parsed_game_args}\n{" ".join(parsed_game_args)}") self.widget_mgr.download_signal.log.emit(f"Parsed game arguments: \n{parsed_game_args}\n{" ".join(parsed_game_args)}")
@@ -772,6 +769,7 @@ class TestPage(QWidget):
classpath=classpath, classpath=classpath,
classpath_separator=";", classpath_separator=";",
library_directory=libraries_dir.as_posix(), library_directory=libraries_dir.as_posix(),
clientid=CLIENT_ID,
) )
target_args = arguments if arguments else old_args target_args = arguments if arguments else old_args
@@ -818,6 +816,7 @@ class TestPage(QWidget):
main_class=main_class, main_class=main_class,
java_path=java_path, java_path=java_path,
full_args=target_args, full_args=target_args,
strict_placeholders=False,
) )
self.widget_mgr.download_signal.log.emit(f"Launch command: {cmd}") self.widget_mgr.download_signal.log.emit(f"Launch command: {cmd}")
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

+5
View File
@@ -29,6 +29,11 @@ QPushButton#manageProfileItem:checked {
color: palette(highlighted-text); color: palette(highlighted-text);
} }
QPushButton#manageProfileItem QLabel[itemChecked="true"] {
color: palette(highlighted-text);
background: transparent;
}
QLabel#itemName { font-size: 15px; font-weight: 600; } QLabel#itemName { font-size: 15px; font-weight: 600; }
QFrame#profileEditor { background: transparent; } QFrame#profileEditor { background: transparent; }
+65
View File
@@ -0,0 +1,65 @@
QMainWindow {
spacing: 0;
}
QPlainTextEdit {
background-color: #0f0f10;
color: "#e5e5e5";
font-family: Consolas;
font-size: 10pt;
}
QScrollBar:vertical {
background-color: #0f0f10;
width: 5px;
margin: 0;
}
QScrollBar::handle:vertical {
background-color: #3a3a3a;
min-height: 24px;
border-radius: 5px;
}
QScrollBar::handle:vertical:hover {
background-color: #4a4a4a;
}
QScrollBar::add-line:vertical,
QScrollBar::sub-line:vertical {
height: 0;
}
QScrollBar::add-page:vertical,
QScrollBar::sub-page:vertical {
background: none;
}
/* Horizontal scrollbar */
QScrollBar:horizontal {
background-color: #0f0f10;
height: 5px;
margin: 0;
}
QScrollBar::handle:horizontal {
background-color: #3a3a3a;
min-width: 24px;
border-radius: 5px;
}
QScrollBar::handle:horizontal:hover {
background-color: #4a4a4a;
}
QScrollBar::add-line:horizontal,
QScrollBar::sub-line:horizontal {
width: 0;
}
QScrollBar::add-page:horizontal,
QScrollBar::sub-page:horizontal {
background: none;
}
+12
View File
@@ -21,6 +21,13 @@ QLabel#profileVersion, QLabel#itemVersion {
QLabel#profileArrow { QLabel#profileArrow {
font-size: 18px; font-size: 18px;
border-style: solid;
background-color: transparent;
}
QLabel#launchStatus {
font-size: 12px;
font-weight: 600;
} }
QFrame#profilePopup { QFrame#profilePopup {
/* background: palette(mid);*/ /* background: palette(mid);*/
@@ -40,6 +47,11 @@ QPushButton#profileItem:hover {
color: palette(highlighted-text); color: palette(highlighted-text);
} }
QPushButton#profileItem QLabel[itemHovered="true"] {
color: palette(highlighted-text);
background: transparent;
}
QPushButton#launchButton { QPushButton#launchButton {
min-width: 150px; min-width: 150px;
font-size: 15px; font-size: 15px;
+3
View File
@@ -0,0 +1,3 @@
QProgressBar[failed="true"]::chunk {
background-color: #c62828;
}
+3
View File
@@ -0,0 +1,3 @@
QPushButton#ActionButton {
padding: 6px 12px;
}
+41
View File
@@ -0,0 +1,41 @@
# Tutorial of creating custom themes
Each theme is a directory containing a `theme.toml` manifest and a
`palette.toml` color palette. Copy a built-in theme directory to `data/themes`,
rename the directory, then edit its display `name` and palette colors. The
directory name is stored as the theme ID. Restart the launcher after adding or
removing a theme directory.
Example:
```text
data/themes/
└── ocean/
├── theme.toml # name and future theme metadata
├── palette.toml # Qt palette colors
├── styles/ # optional QSS overrides, using default stylesheet names
│ └── main.qss
└── background.png # optional asset for future theme features
```
Every key in the `palette.toml` `[palette]` table is required. Colors may use
any format accepted by Qt's `QColor`, including `#RRGGBB` and standard SVG
color names.
Stylesheets are loaded as UTF-8. Put overrides in the theme's `styles`
directory using the same filenames as `resources/styles` (for example,
`profile.qss`, `toolbar.qss`, `process_log.qss`, `progress_dialog.qss`, or
`test.qss`). Each missing file falls back to the default stylesheet.
Switching themes reloads stylesheets on existing windows and pages.
`main.qss` is applied to the whole application, including parentless message
boxes and detailed error dialogs. Customize `QMessageBox`, `QMessageBox QLabel`,
and `QMessageBox QPushButton` there; page styles such as `settings.qss` only
apply within that page.
Profile list rows contain separate `QLabel` children: a button's `color` does
not override those labels' explicit colors. Use
`QPushButton#profileItem QLabel[itemHovered="true"]` for dropdown hover text
and `QPushButton#manageProfileItem QLabel[itemChecked="true"]` for selected
management rows. These properties follow the button state and refresh the
label styles automatically.
+14
View File
@@ -0,0 +1,14 @@
[palette]
window = "#eeeeee"
window_text = "#20252d"
base = "#ffffff"
alternate_base = "#edf4ff"
text = "#20252d"
button = "#e8eff9"
button_text = "#17263d"
mid = "#a0a9b7"
midlight = "#f8fbff"
dark = "#71839f"
highlight = "#3875d7"
highlighted_text = "#ffffff"
placeholder_text = "#626d7e"
@@ -0,0 +1,7 @@
QDialog { background: #f1f3f7; }
QLabel#dialogTitle { color: #203653; font-size: 18px; font-weight: bold; }
QLabel#helpText { color: #20252d; font-size: 13px; }
QLineEdit#codeEdit { min-height: 50px; padding: 0 12px; border: 1px solid #829ab9; border-radius: 8px; background: #ffffff; color: #203653; font-size: 25px; font-weight: bold; letter-spacing: 2px; }
QLabel#errorMessage { padding: 9px 11px; border: 1px solid #dfb8bd; border-radius: 6px; background: #fff0f2; color: #a52b38; font-size: 12px; }
QPushButton { min-height: 30px; padding: 3px 14px; border: 1px solid #8293ac; border-radius: 14px; color: #17263d; background: qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 #ffffff,stop:0.45 #edf2fa,stop:0.5 #ced9e9,stop:1 #f8fbff); }
QPushButton:pressed { background: #a2c9f4; }
+83
View File
@@ -0,0 +1,83 @@
QWidget {
font-family: "Lucida Grande", "Lucida Sans Unicode", "Segoe UI";
font-size: 13px;
}
QMainWindow, QDialog {
color: #20252d;
background: qlineargradient(spread:repeat, x1:0, y1:0, x2:0, y2:0.008,
stop:0 #fafafa, stop:0.49 #fafafa, stop:0.5 #e9e9e9, stop:1 #e9e9e9);
}
QPushButton, QToolButton {
color: #17263d;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #ffffff, stop:0.45 #edf2fa, stop:0.5 #ced9e9, stop:1 #f8fbff);
border: 1px solid #8293ac;
border-radius: 12px;
padding: 4px 14px;
min-height: 22px;
}
QPushButton:hover, QToolButton:hover { border-color: #4679ba; }
QPushButton:default, QPushButton:checked, QToolButton:checked {
color: #102d57;
border-color: #3266ac;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #e9f8ff, stop:0.45 #a7d0ff, stop:0.5 #649be5, stop:1 #c2e2ff);
}
QPushButton:pressed, QToolButton:pressed {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #79a5db, stop:0.5 #4f86ca, stop:1 #a2c9f4);
}
QPushButton:disabled, QToolButton:disabled { color: #8590a0; border-color: #b9c1cc; }
QLineEdit, QPlainTextEdit, QTextEdit, QSpinBox, QDoubleSpinBox,
QComboBox, QListView, QTreeView, QTableView {
background: #ffffff;
color: #20252d;
border: 1px solid #919cac;
border-top-color: #6e7c90;
border-radius: 4px;
padding: 4px;
selection-background-color: #3875d7;
selection-color: #ffffff;
}
QLineEdit:focus, QPlainTextEdit:focus, QTextEdit:focus,
QSpinBox:focus, QDoubleSpinBox:focus, QComboBox:focus { border-color: #4b8cde; }
QComboBox { padding-right: 26px; }
QComboBox::drop-down {
width: 20px;
border-left: 1px solid #7d9abd;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #e4f5ff, stop:0.48 #a1caff, stop:0.5 #699ee3, stop:1 #b9ddff);
}
QComboBox QAbstractItemView { background: #ffffff; color: #20252d; selection-background-color: #3875d7; selection-color: #ffffff; }
QGroupBox { border: 1px solid #aab2bf; border-radius: 7px; margin-top: 10px; padding-top: 10px; }
QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 4px; }
QProgressBar { border: 1px solid #8a9ab0; border-radius: 7px; background: #e0e5ed; color: #17263d; text-align: center; min-height: 14px; }
QProgressBar::chunk {
border-radius: 6px;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #e5f6ff, stop:0.4 #8ac4ff, stop:0.5 #4589db, stop:1 #9bd0ff);
}
QTabWidget::pane { border: 1px solid #9aa9bc; border-radius: 6px; }
QTabBar::tab { border: 1px solid #9aa9bc; padding: 5px 14px; background: #e4e9f0; }
QTabBar::tab:selected { background: #a8ceff; color: #16355f; }
QScrollBar { background: #e7eaf0; border: 1px solid #b3bdcc; }
QScrollBar:vertical { width: 16px; }
QScrollBar:horizontal { height: 16px; }
QScrollBar::handle { border: 1px solid #6e9bc9; border-radius: 6px; background: #a4cff7; }
QScrollBar::handle:vertical { min-height: 24px; background: qlineargradient(x1:0,y1:0,x2:1,y2:0,stop:0 #dff4ff,stop:0.5 #83b9ef,stop:1 #c7e7ff); }
QScrollBar::handle:horizontal { min-width: 24px; background: qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 #dff4ff,stop:0.5 #83b9ef,stop:1 #c7e7ff); }
QLabel#dev_info_box { font-size: 20pt; font-weight: bold; }
QLabel#dev_info_message { font-size: 10pt; }
QLabel#version_label { font-weight: bold; }
QMessageBox { background: #f1f3f7; }
QMessageBox QLabel { color: #203653; background: transparent; }
QMessageBox QPushButton { min-width: 72px; }
QMessageBox QPushButton:default {
border-color: #3266ac;
background: qlineargradient(x1:0,y1:0,x2:0,y2:1,
stop:0 #e9f8ff,stop:0.45 #a7d0ff,stop:0.5 #649be5,stop:1 #c2e2ff);
}
QMessageBox QPushButton:pressed { background: #79a5db; }
@@ -0,0 +1,20 @@
QLabel#manageTitle { color: #203653; font-size: 22px; font-weight: bold; padding: 4px; }
QScrollArea#manageProfileListScroll, QScrollArea#manageProfileOptionsScroll { background: #ffffff; border: 1px solid #9eafc5; border-radius: 8px; }
QPushButton#manageProfileItem {
/* Content height + two 1px borders = 64px; the layout supplies padding. */
min-height: 62px;
padding: 0;
background: #ffffff;
color: #203653;
border: 1px solid transparent;
border-radius: 5px;
text-align: left;
}
QPushButton#manageProfileItem:hover { background: #e2efff; }
QPushButton#manageProfileItem:checked { background: qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 #80b8f4,stop:1 #3875d7); color: #ffffff; }
QPushButton#manageProfileItem QLabel[itemChecked="true"] { color: #ffffff; background: transparent; }
QLabel#itemName { color: #203653; font-size: 15px; font-weight: bold; }
QLabel#itemVersion { color: #626d7e; font-size: 12px; }
QFrame#profileEditor { background: transparent; }
QPushButton#saveProfileButton { min-width: 130px; font-weight: bold; }
QPushButton#dangerButton { color: #a52b38; }
@@ -0,0 +1,8 @@
QMainWindow { background: #eeeeee; }
QLabel { color: #203653; }
QPlainTextEdit { background: #ffffff; color: #20252d; font-family: "Menlo", "Consolas", monospace; font-size: 10pt; border: 1px solid #91a1b8; border-radius: 4px; selection-background-color: #3875d7; selection-color: #ffffff; }
QPushButton { padding: 4px 14px; min-height: 22px; border: 1px solid #8293ac; border-radius: 12px; color: #17263d; background: qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 #ffffff,stop:0.45 #edf2fa,stop:0.5 #ced9e9,stop:1 #f8fbff); }
QPushButton:pressed { background: #a2c9f4; }
QPushButton:disabled { color: #8590a0; }
QScrollBar { background: #e7eaf0; border: 1px solid #b3bdcc; }
QScrollBar::handle { background: #a4cff7; border: 1px solid #6e9bc9; border-radius: 6px; }
+37
View File
@@ -0,0 +1,37 @@
QFrame#profileButton {
border: 1px solid #91a5c0;
border-radius: 12px;
background: qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 #ffffff,stop:0.48 #ebf3ff,stop:0.5 #d6e5fa,stop:1 #f7fbff);
}
QFrame#profileButton:hover { border-color: #4b8cde; }
QLabel#profileName, QLabel#itemName { color: #203653; font-size: 15px; font-weight: bold; }
QLabel#profileVersion, QLabel#itemVersion { color: #626d7e; font-size: 12px; }
QLabel#profileArrow { background: transparent; color: #34649c; font-size: 18px; }
QLabel#launchStatus { font-size: 12px; font-weight: bold; }
QFrame#profilePopup { border: 1px solid #91a5c0; border-radius: 8px; background: #f7faff; }
QWidget#profileListContent { background: #ffffff; }
QPushButton#profileItem {
/* Content height + two 1px borders = 62px; the layout supplies padding. */
min-height: 60px;
padding: 0;
background: #ffffff;
border: 1px solid transparent;
border-radius: 5px;
text-align: left;
}
QPushButton#profileItem:hover {
background: qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 #80b8f4,stop:1 #3875d7);
}
QPushButton#profileItem QLabel[itemHovered="true"] { color: #ffffff; background: transparent; }
QPushButton#launchButton {
min-width: 150px;
font-size: 15px;
font-weight: bold;
border-radius: 16px;
border-color: #3266ac;
background: qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 #effaff,stop:0.45 #a7d0ff,stop:0.5 #649be5,stop:1 #c2e2ff);
}
QPushButton#launchButton:pressed { background: #79a5db; }
QFrame#profileFrame { background: #dceaff; border: 1px solid #8fa8c9; border-radius: 12px; }
QFrame#header { background: rgba(245, 250, 255, 220); border: 1px solid #b6c9e3; border-radius: 8px; }
QLabel#headerLabel { color: #203653; background: transparent; font-size: 20px; font-weight: bold; }
+22
View File
@@ -0,0 +1,22 @@
QWidget#settingsPage, QWidget#settingsMainPage, QWidget#settingsScrollContent {
background: qlineargradient(spread:repeat,x1:0,y1:0,x2:0,y2:0.012,stop:0 #fafafa,stop:0.49 #fafafa,stop:0.5 #ebedf0,stop:1 #ebedf0);
}
QScrollArea#settingsScrollArea { border: none; background: transparent; }
QLabel#settingsPageTitle { color: #203653; font-size: 20px; font-weight: bold; }
QLabel#settingsSubPageTitle { color: #203653; font-size: 18px; font-weight: bold; }
QPushButton#settingsItem {
min-height: 68px;
border: 1px solid #a8b8ce;
border-radius: 10px;
background: qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 #ffffff,stop:1 #e5edf8);
text-align: left;
}
QPushButton#settingsItem:hover { border-color: #4b8cde; background: #e7f2ff; }
QPushButton#settingsItem:pressed { background: #c4ddfa; }
QLabel#settingsItemTitle { color: #203653; font-size: 14px; font-weight: bold; }
QLabel#settingsItemDescription, QLabel#settingsHelpText { color: #626d7e; font-size: 12px; }
QPushButton#settingsBackButton { min-height: 0; padding: 0; border-radius: 16px; font-size: 22px; }
QLabel#settingsBrand { color: #203653; font-size: 20px; font-weight: bold; }
QLabel#settingsVersion { font-size: 12px; }
QPlainTextEdit#settingsDescription { font-size: 13px; }
QWidget#settingsPage QComboBox { min-height: 22px; padding: 4px 26px 4px 8px; border: 1px solid #829ab9; border-radius: 5px; background: #ffffff; color: #20252d; }
+23
View File
@@ -0,0 +1,23 @@
QToolBar {
background: qlineargradient(spread:repeat,x1:0,y1:0,x2:0,y2:0.012,stop:0 #fafafa,stop:0.49 #fafafa,stop:0.5 #e6e8ec,stop:1 #e6e8ec);
border: 1px solid #aab2bf;
spacing: 4px;
padding: 3px;
}
QToolBar QToolButton, QToolBar QPushButton {
color: #243852;
background: qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 #ffffff,stop:0.48 #eff4fc,stop:0.5 #d6dfed,stop:1 #f8fbff);
border: 1px solid #9aaac0;
border-radius: 10px;
padding: 6px;
font-size: 13px;
}
QToolBar QToolButton:hover, QToolBar QPushButton:hover { border-color: #4b8cde; }
QToolBar QToolButton:focus, QToolBar QToolButton:checked, QToolBar QPushButton:focus, QToolBar QPushButton:checked {
background: qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 #e9f8ff,stop:0.45 #a7d0ff,stop:0.5 #649be5,stop:1 #c2e2ff);
border-color: #5687c4;
}
QToolBar QToolButton:pressed, QToolBar QPushButton:pressed { background: #8db6e8; }
QToolBar QToolButton:disabled, QToolBar QPushButton:disabled { color: #8590a0; }
QToolBar::separator { background: #b0bac8; width: 1px; height: 1px; margin: 4px; }
QToolBar::handle { background: #d1d8e3; border: 1px solid #b0bac8; width: 4px; height: 4px; border-radius: 2px; }
+1
View File
@@ -0,0 +1 @@
name = "Aqua"
+14
View File
@@ -0,0 +1,14 @@
[palette]
window = "#202124"
window_text = "#f1f3f4"
base = "#17181a"
alternate_base = "#292a2d"
text = "#f1f3f4"
button = "#292a2d"
button_text = "#f1f3f4"
mid = "#4a4c50"
midlight = "#383a3e"
dark = "#121315"
highlight = "#bf265e"
highlighted_text = "#ffffff"
placeholder_text = "#a0a4aa"
+1
View File
@@ -0,0 +1 @@
name = "Dark"
+14
View File
@@ -0,0 +1,14 @@
[palette]
window = "#202a22"
window_text = "#edf4e8"
base = "#151d17"
alternate_base = "#2b382d"
text = "#edf4e8"
button = "#2b382d"
button_text = "#edf4e8"
mid = "#617064"
midlight = "#3d4d40"
dark = "#0e140f"
highlight = "#8fbd57"
highlighted_text = "#10180d"
placeholder_text = "#a5b3a2"
+1
View File
@@ -0,0 +1 @@
name = "Forest Moss"
+14
View File
@@ -0,0 +1,14 @@
[palette]
window = "#f5f5f5"
window_text = "#202020"
base = "#ffffff"
alternate_base = "#eeeeee"
text = "#202020"
button = "#ffffff"
button_text = "#202020"
mid = "#c5c5c5"
midlight = "#e2e2e2"
dark = "#aaaaaa"
highlight = "#bf265e"
highlighted_text = "#ffffff"
placeholder_text = "#707070"
+1
View File
@@ -0,0 +1 @@
name = "Light"
+14
View File
@@ -0,0 +1,14 @@
[palette]
window = "#102331"
window_text = "#e6f4ff"
base = "#0a1822"
alternate_base = "#173447"
text = "#e6f4ff"
button = "#173447"
button_text = "#e6f4ff"
mid = "#40657a"
midlight = "#244b61"
dark = "#061018"
highlight = "#27a9e1"
highlighted_text = "#061018"
placeholder_text = "#8fb2c6"
+1
View File
@@ -0,0 +1 @@
name = "Ocean Night"
@@ -0,0 +1,14 @@
[palette]
window = "#f3ead3"
window_text = "#3d3527"
base = "#fffaf0"
alternate_base = "#e9ddbf"
text = "#3d3527"
button = "#fff7e6"
button_text = "#3d3527"
mid = "#b9aa87"
midlight = "#ded0ae"
dark = "#9a8a68"
highlight = "#c45d28"
highlighted_text = "#ffffff"
placeholder_text = "#746a57"
@@ -0,0 +1 @@
name = "Solarized Sand"
+14
View File
@@ -0,0 +1,14 @@
[palette]
window = "#c0c0c0"
window_text = "#000000"
base = "#ffffff"
alternate_base = "#dfdfdf"
text = "#000000"
button = "#c0c0c0"
button_text = "#000000"
mid = "#808080"
midlight = "#ffffff"
dark = "#404040"
highlight = "#000080"
highlighted_text = "#ffffff"
placeholder_text = "#808080"
@@ -0,0 +1,23 @@
QDialog { background: #c0c0c0; }
QLabel#dialogTitle {
background: #000080;
color: #ffffff;
padding: 5px;
font-size: 16px;
font-weight: bold;
}
QLabel#helpText { color: #000000; font-size: 13px; }
QLineEdit#codeEdit {
min-height: 50px;
padding: 0 12px;
border: 2px inset #c0c0c0;
border-radius: 0;
background: #ffffff;
color: #000000;
font-size: 25px;
font-weight: bold;
letter-spacing: 2px;
}
QLabel#errorMessage { padding: 9px; border: 1px solid #800000; color: #800000; font-size: 12px; }
QPushButton { min-height: 32px; border: 2px outset #c0c0c0; border-radius: 0; background: #c0c0c0; color: #000000; }
QPushButton:pressed { border-style: inset; }
+106
View File
@@ -0,0 +1,106 @@
/* Classic gray controls, raised buttons and sunken fields. */
QWidget {
font-family: "Tahoma", "Microsoft Sans Serif", "Segoe UI";
font-size: 12px;
}
QMainWindow, QDialog {
background: palette(window);
color: palette(window-text);
}
QPushButton, QToolButton {
background: palette(button);
color: palette(button-text);
border: 2px solid;
border-top-color: #ffffff;
border-left-color: #ffffff;
border-bottom-color: #404040;
border-right-color: #404040;
border-radius: 0;
padding: 5px 10px;
min-height: 20px;
}
QPushButton:pressed, QToolButton:pressed,
QPushButton:checked, QToolButton:checked {
border-top-color: #404040;
border-left-color: #404040;
border-bottom-color: #ffffff;
border-right-color: #ffffff;
background: #b0b0b0;
}
QPushButton:default { border-bottom-color: #000000; border-right-color: #000000; }
QPushButton:disabled, QToolButton:disabled { color: #808080; }
QLineEdit, QPlainTextEdit, QTextEdit, QSpinBox, QDoubleSpinBox,
QComboBox, QListView, QTreeView, QTableView {
background: palette(base);
color: palette(text);
border: 2px solid;
border-top-color: #808080;
border-left-color: #808080;
border-bottom-color: #ffffff;
border-right-color: #ffffff;
border-radius: 0;
padding: 3px;
selection-background-color: #000080;
selection-color: #ffffff;
}
QComboBox { padding-right: 24px; }
QComboBox::drop-down {
width: 18px;
background: #c0c0c0;
border: 1px solid;
border-top-color: #ffffff;
border-left-color: #ffffff;
border-bottom-color: #404040;
border-right-color: #404040;
}
QComboBox QAbstractItemView {
background: #ffffff;
color: #000000;
selection-background-color: #000080;
selection-color: #ffffff;
}
QGroupBox {
border: 1px solid #808080;
border-radius: 0;
margin-top: 10px;
padding-top: 8px;
}
QGroupBox::title { subcontrol-origin: margin; left: 8px; padding: 0 3px; }
QProgressBar {
background: #c0c0c0;
border: 2px solid;
border-top-color: #808080;
border-left-color: #808080;
border-bottom-color: #ffffff;
border-right-color: #ffffff;
border-radius: 0;
text-align: center;
color: #000000;
}
QProgressBar::chunk { background: #000080; width: 8px; margin: 1px; }
QTabWidget::pane { border: 2px outset #c0c0c0; }
QTabBar::tab {
background: #c0c0c0;
color: #000000;
border: 2px outset #c0c0c0;
border-radius: 0;
padding: 5px 12px;
}
QTabBar::tab:selected { border-bottom-color: #c0c0c0; }
QLabel#dev_info_box { font-size: 20pt; font-weight: bold; }
QLabel#dev_info_message { font-size: 10pt; }
QLabel#version_label { font-weight: bold; }
QMessageBox { background: #c0c0c0; }
QMessageBox QLabel { color: #000000; background: transparent; }
QMessageBox QPushButton { min-width: 72px; }
@@ -0,0 +1,24 @@
QLabel#manageTitle { font-size: 20px; font-weight: bold; padding: 4px; }
QScrollArea#manageProfileListScroll, QScrollArea#manageProfileOptionsScroll {
background: #ffffff;
border: 2px inset #c0c0c0;
border-radius: 0;
}
QPushButton#manageProfileItem {
/* Override the generic button sizing; 62px + 2px border = 64px. */
min-height: 62px;
padding: 0;
background: #c0c0c0;
color: #000000;
border: 1px solid transparent;
border-radius: 0;
text-align: left;
}
QPushButton#manageProfileItem:hover { background: #dfdfdf; }
QPushButton#manageProfileItem:checked { background: #000080; color: #ffffff; }
QPushButton#manageProfileItem QLabel[itemChecked="true"] { color: #ffffff; background: transparent; }
QLabel#itemName { font-size: 14px; font-weight: bold; }
QLabel#itemVersion { color: #404040; font-size: 12px; }
QFrame#profileEditor { background: #c0c0c0; }
QPushButton#saveProfileButton { min-width: 130px; font-weight: bold; }
QPushButton#dangerButton { color: #800000; }
@@ -0,0 +1,23 @@
QMainWindow { background: #c0c0c0; }
QLabel { color: #000000; }
QPlainTextEdit {
background: #ffffff;
color: #000000;
font-family: "Courier New", monospace;
font-size: 10pt;
border: 2px inset #c0c0c0;
border-radius: 0;
selection-background-color: #000080;
selection-color: #ffffff;
}
QPushButton {
background: #c0c0c0;
color: #000000;
border: 2px outset #c0c0c0;
border-radius: 0;
padding: 5px 10px;
}
QPushButton:pressed { border-style: inset; }
QPushButton:disabled { color: #808080; }
QScrollBar { background: #dfdfdf; }
QScrollBar::handle { background: #c0c0c0; border: 2px outset #c0c0c0; }
@@ -0,0 +1,27 @@
QFrame#profileButton {
background: #c0c0c0;
border: 2px outset #c0c0c0;
border-radius: 0;
}
QFrame#profileButton:hover { background: #dfdfdf; }
QLabel#profileName, QLabel#itemName { color: #000000; font-size: 14px; font-weight: bold; }
QLabel#profileVersion, QLabel#itemVersion { color: #404040; font-size: 12px; }
QLabel#profileArrow { background: transparent; font-size: 18px; }
QLabel#launchStatus { font-size: 12px; font-weight: bold; }
QFrame#profilePopup { background: #c0c0c0; border: 2px outset #c0c0c0; border-radius: 0; }
QWidget#profileListContent { background: #c0c0c0; }
QPushButton#profileItem {
/* Override the generic button sizing; 60px + 2px border = 62px. */
min-height: 60px;
padding: 0;
background: #c0c0c0;
border: 2px outset #c0c0c0;
border-radius: 0;
text-align: left;
}
QPushButton#profileItem:hover { background: #000080; }
QPushButton#profileItem QLabel[itemHovered="true"] { color: #ffffff; background: transparent; }
QPushButton#launchButton { min-width: 150px; font-size: 14px; font-weight: bold; }
QFrame#profileFrame { background: #008080; border: 2px inset #c0c0c0; border-radius: 0; }
QFrame#header { background: #000080; border: 0; }
QLabel#headerLabel { color: #ffffff; background: transparent; font-size: 18px; font-weight: bold; }
@@ -0,0 +1,36 @@
QWidget#settingsPage, QWidget#settingsMainPage, QWidget#settingsScrollContent {
background: #c0c0c0;
}
QScrollArea#settingsScrollArea { border: none; background: #c0c0c0; }
QScrollArea#settingsScrollArea > QWidget > QWidget { background: #c0c0c0; }
QLabel#settingsPageTitle, QLabel#settingsSubPageTitle {
background: #000080;
color: #ffffff;
font-size: 16px;
font-weight: bold;
padding: 5px;
}
QPushButton#settingsItem {
min-height: 68px;
background: #c0c0c0;
border: 2px outset #c0c0c0;
border-radius: 0;
text-align: left;
}
QPushButton#settingsItem:pressed { border-style: inset; }
QLabel#settingsItemTitle { color: #000000; font-size: 13px; font-weight: bold; }
QLabel#settingsItemDescription, QLabel#settingsHelpText { color: #404040; font-size: 12px; }
QPushButton#settingsBackButton { border-radius: 0; font-size: 20px; }
QLabel#settingsBrand { font-size: 20px; font-weight: bold; }
QLabel#settingsVersion { font-size: 12px; }
QPlainTextEdit#settingsDescription { font-size: 13px; }
QWidget#settingsPage QComboBox {
min-height: 22px;
padding: 3px 24px 3px 5px;
border: 2px inset #c0c0c0;
border-radius: 0;
background: #ffffff;
color: #000000;
selection-background-color: #000080;
selection-color: #ffffff;
}
@@ -0,0 +1,29 @@
QToolBar {
background: #c0c0c0;
border: 2px outset #c0c0c0;
spacing: 3px;
padding: 2px;
}
QToolBar QToolButton, QToolBar QPushButton {
background: #c0c0c0;
color: #000000;
border: 2px solid;
border-top-color: #ffffff;
border-left-color: #ffffff;
border-bottom-color: #404040;
border-right-color: #404040;
border-radius: 0;
padding: 6px;
font-size: 12px;
}
QToolBar QToolButton:pressed, QToolBar QToolButton:checked,
QToolBar QPushButton:pressed, QToolBar QPushButton:checked {
border-top-color: #404040;
border-left-color: #404040;
border-bottom-color: #ffffff;
border-right-color: #ffffff;
}
QToolBar QToolButton:focus, QToolBar QPushButton:focus { background: #dfdfdf; }
QToolBar QToolButton:disabled, QToolBar QPushButton:disabled { color: #808080; }
QToolBar::separator { background: #808080; width: 2px; height: 2px; margin: 3px; }
QToolBar::handle { background: #c0c0c0; border: 1px outset #ffffff; width: 4px; height: 4px; }
+1
View File
@@ -0,0 +1 @@
name = "Windows 9x"
+232
View File
@@ -0,0 +1,232 @@
{
"About": "關於",
"Account": "帳號",
"Account status": "帳號狀態",
"Accounts": "所有帳號",
"Add Account": "新增帳號",
"Add Modded Version": "新增模組化版本",
"Add Version": "新增版本",
"Added version {version_id}.": "新增版本 {version_id} 。",
"All assets downloaded successfully.": "所有資源檔案已下載完成。",
"All libraries downloaded successfully.": "所有依賴已下載完成",
"Appearance": "外觀",
"Authentication failed.": "驗證失敗。",
"Authentication failed. Session may expire.": "無法通過驗證,帳號工作階段可能已過期",
"Available": "可用",
"Cancel": "取消",
"Check login status": "檢查登入狀態",
"Checking Minecraft ownership": "正在檢查是否擁有Minecraft",
"Choose a Mojang Java runtime component to install.": "選取一個 Mojang Java 組件來安裝",
"Close": "關閉",
"Completed": "已完成",
"Copied!": "複製成功!",
"Copy code": "複製代碼",
"Copy the code below, then continue in your browser.": "複製下方驗證代碼,並在瀏覽器內繼續操作。",
"Create a local mod-loader version manifest without creating a profile.": "建立本地模組化版本 (無需建立Profile)",
"Create Profile": "建立安裝檔",
"Creating the Fabric version manifest...": "正在建立 Fabric 版本清單...",
"Current": "目前",
"Current launcher working directory": "目前工作路徑",
"Current program directory": "目前程式工作路徑",
"Current version: {version}": "目前版本: {version}",
"Dark": "暗黑",
"Default": "預設",
"Delete": "刪除",
"Delete account": "刪除帳號",
"Delete All": "全部刪除",
"Delete Profile": "刪除安裝檔",
"Delete this profile? Game files will not be removed.": "確定刪除此安裝檔? (遊戲檔案不會被刪除)",
"Detected Java runtimes": "檢測 Java 安裝",
"Don't Install": "不安裝",
"Download assets": "下載資源",
"Download client": "下載客戶端核心檔案",
"Download Error": "下載錯誤",
"Download libraries": "下載依賴",
"Downloaded": "已下載",
"Downloading": "下載中",
"Downloading assets for version {version}": "正在為版本 {version} 下載資源",
"Downloading libraries for version {version}": "正在為版本 {version} 下載依賴",
"Downloading missing assets": "正在下載遺失的資源",
"Downloads": "下載",
"Duplicate": "複製",
"English": "English",
"Error": "錯誤",
"Fabric": "Fabric",
"Failed: {error}": "錯誤: {error}",
"Fetch Error": "抓取資料錯誤",
"Fetch Version Data": "抓取版本資料",
"Follow system settings": "跟隨系統",
"Game directory": "遊戲資料夾",
"Game Log": "遊戲日誌",
"General": "一般",
"Home": "主頁",
"Icon": "圖示",
"Import Mods": "導入模組",
"Import Mods…": "導入模組...",
"Imported {count} mod(s).": "共{count}個模組已導入。",
"Info": "資訊",
"Install": "安裝",
"Install Java": "安裝 Java",
"Installation failed: {error}": "安裝失敗: {error}",
"Installing {component}...": "安裝組件 {component} 中...",
"Java {version} installed successfully.": "已成功安裝 Java 版本 {version}。",
"Java arguments": "Java 引數",
"Java Version:": "Java 版本;",
"Kill Process": "強制關閉",
"Killing process...": "強制關閉中...",
"Language": "語言",
"Language and launcher directories": "語言和啟動器目錄",
"Launch Failed": "啟動失敗",
"Launch Game": "開始遊戲",
"Launch Game! (Offline)": "已啟動! (離線)",
"Launch Profile": "啟動安裝檔",
"Launch Request": "啟動請求",
"Launched!": "已啟動",
"Launcher error occurred.": "發生啟動器錯誤",
"Launcher theme": "啟動器主題",
"Light": "明亮",
"Loading all types...": "正在加載所有類型...",
"Loading all versions...": "正在加載所有版本...",
"Loading available Mojang runtimes...": "正在加載可用的 Mojang 執行環境...",
"Loading Fabric versions for {version}...": "正在為版本 {version} 加載 Fabric 版本列表...",
"Loading Minecraft versions...": "加載 Minecraft 版本列表...",
"Login Minecraft Account": "登入 Minecraft 帳號",
"Main repo": "主儲存庫",
"Manage Profiles": "管理安裝檔",
"Microsoft authentication settings": "Microsoft 驗證設定",
"Microsoft Client ID": "Microsoft Client ID",
"Microsoft Login": "Microsoft Login",
"Microsoft OAuth Client ID": "Microsoft OAuth Client ID",
"Microsoft sign-in could not be completed.": "Microsoft 登入無法完成",
"Microsoft sign-in failed": "Microsoft 登入失敗",
"Minecraft Client Error": "Minecraft 客戶端錯誤",
"Minecraft exited with code {exit_code}.": "Minecraft 退出代碼 {exit_code}.",
"Minecraft type": "Minecraft 類型",
"Minecraft version": "Minecraft 版本",
"Mod Loader": "模組加載器",
"Mod Loader Version": "模組加載器版本",
"Mod loader": "模組加載器",
"Modded": "已修改",
"Mojang runtime component": "Mojang 執行環境組件",
"No accounts yet. Use Add Account to sign in.": "無帳號可用。請透過 \"新增帳號\" 功能來登入。",
"No content": "無內容",
"No Minecraft version is available for this type.": "類型無可用 Minecraft 版本",
"No profiles available": "無設定檔可用",
"No type selected.": "尚未選取類型。",
"No version selected.": "尚未選取版本。",
"Open browser": "開啟瀏覽器",
"Open Profile Folder": "開啟安裝檔目錄",
"Ouch. The icon is missing.": "歐不,圖示不見了。",
"Parse Arguments": "解析引數",
"Parse Error": "解析錯誤",
"Preparing...": "準備中...",
"Preparing to launch...": "正在準備啟動...",
"Process exited with code {exit_code}": "行程已退出,代碼 {exit_code}",
"Profile name": "安裝檔名稱",
"Profile name:": "安裝黨名稱;",
"Profile name cannot be empty.": "安裝檔名稱不能為空;",
"Profile settings saved.": "安裝檔設定已處存",
"Ready to install.": "準備安裝",
"Redownload": "重新下載",
"Refresh": "重新整理",
"Refresh all": "重新整理",
"Refresh versions": "重新整理版本",
"Requesting a Microsoft sign-in code…": "正在請求 Microsoft 登入代碼...",
"Resolution": "解析度",
"Resource Error": "資源錯誤",
"Running (PID {pid})": "執行中 (PID {pid})",
"Save Changes": "儲存變更",
"Select a loader version to continue.": "選取一個模組加載器來繼續。",
"Select a Minecraft and loader version.": "請先選取 Minecraft 和模組加載器版本。",
"Select a profile from the list to edit its settings.": "從列表內選取一個安裝檔來修改設定",
"Select a profile to launch": "選取要啟動的安裝檔",
"Select a runtime component.": "選取一個執行環境組件",
"Select a version.": "選取一個版本",
"Select a version before continuing.": "選取一個版本再繼續。",
"Select a version to continue:": "選取一個版本來繼續;",
"Set both resolution values, or set both to Default.": "需要同時設定解析度的兩個參數,或同時設定為預設值。",
"Settings": "設定",
"Settings error": "設定檔錯誤",
"Signing in to Minecraft services": "正在登入 Minecraft 服務",
"Signing in to Xbox Live": "正在登入 Xbox Live",
"Some assets could not be downloaded. They are not required to launch the game, but missing assets may cause texture issues while you play.": "Some assets could not be downloaded. They are not required to launch the game, but missing assets may cause texture issues while you play.",
"Some files failed to download.": "Some files failed to download.",
"Some files failed to download. Would you like to retry downloading them?": "Some files failed to download. Would you like to retry downloading them?",
"Still digging!": "Still digging!",
"Switch to this account": "Switch to this account",
"Test Error": "Test Error",
"Tests": "Tests",
"The Client ID must belong to an Azure application configured for Microsoft device-code authentication.": "The Client ID must belong to an Azure application configured for Microsoft device-code authentication.",
"The selected loader version is invalid.": "The selected loader version is invalid.",
"Theme": "Theme",
"There is no profile is selected. Please create one first.": "There is no profile is selected. Please create one first.",
"This version requires Java {version}.": "This version requires Java {version}.",
"Type": "Type",
"Unable to kill process": "Unable to kill process",
"Unable to launch profile": "Unable to launch profile",
"Unable to load the Minecraft version manifest.": "Unable to load the Minecraft version manifest.",
"Unable to load the selected profile.": "Unable to load the selected profile.",
"Version": "Version",
"Version and project information": "Version and project information",
"Version Type": "Version Type",
"Version: Vanilla": "Version: Vanilla",
"Version: {version}": "Version: {version}",
"Waiting for Microsoft sign-in approval": "Waiting for Microsoft sign-in approval",
"Warning": "Warning",
"If you find an issue, you can report it in the main repository. Suggestions are always welcome!": "If you find an issue, you can report it in the main repository. Suggestions are always welcome!"
,
"An error occurred while connecting to authentication server.": "An error occurred while connecting to authentication server.",
"An error occurred while executing Java runtime.": "An error occurred while executing Java runtime.",
"An error occurred while fetching third party API.": "An error occurred while fetching third party API.",
"An error occurred while processing account data.": "An error occurred while processing account data.",
"An error occurred while processing profile.": "An error occurred while processing profile.",
"An settings error occurred.": "An settings error occurred.",
"Current platform or architecture is not supported.": "Current platform or architecture is not supported.",
"Delete all accounts": "Delete all accounts",
"Delete every saved account? This cannot be undone.": "Delete every saved account? This cannot be undone.",
"Microsoft approved the sign-in but did not return an access token. Please sign in again.": "Microsoft approved the sign-in but did not return an access token. Please sign in again.",
"Microsoft could not refresh this account. Please sign in again.": "Microsoft could not refresh this account. Please sign in again.",
"Microsoft did not return a refresh token. Ensure the offline_access permission is enabled, then sign in again.": "Microsoft did not return a refresh token. Ensure the offline_access permission is enabled, then sign in again.",
"Microsoft did not return a sign-in code. Check the client ID or update the launcher.": "Microsoft did not return a sign-in code. Check the client ID or update the launcher.",
"Microsoft sign-in was rejected (HTTP {status}): {description}": "Microsoft sign-in was rejected (HTTP {status}): {description}",
"Minecraft services accepted the Xbox session but did not return a game access token. Please sign in again.": "Minecraft services accepted the Xbox session but did not return a game access token. Please sign in again.",
"Minecraft services did not return a valid player profile. Ensure this account owns Minecraft and has created a profile.": "Minecraft services did not return a valid player profile. Ensure this account owns Minecraft and has created a profile.",
"Minecraft services returned an invalid ownership response. Please sign in again or try later.": "Minecraft services returned an invalid ownership response. Please sign in again or try later.",
"Modded version {version_id} added.": "Modded version {version_id} added.",
"No compatible native library was found for this platform.": "No compatible native library was found for this platform.",
"No version found. (This should never happen)": "No version found. (This should never happen)",
"Runtime manifest is missing or corrupted.": "Runtime manifest is missing or corrupted.",
"Settings section could not be registered.": "Settings section could not be registered.",
"Settings section could not be validated.": "Settings section could not be validated.",
"Specified account was not found.": "Specified account was not found.",
"Specified asset data section (key) not found.": "Specified asset data section (key) not found.",
"Specified profile key not found. Profile may corrupted.": "Specified profile key not found. Profile may corrupted.",
"Specified version data section (key) not found.": "Specified version data section (key) not found.",
"Specified version or type not found.": "Specified version or type not found.",
"The authentication request or session was rejected.": "The authentication request or session was rejected.",
"The authentication service received too many requests. Wait a moment and try again.": "The authentication service received too many requests. Wait a moment and try again.",
"The authentication service returned an unexpected response. Try again later.": "The authentication service returned an unexpected response. Try again later.",
"The login session is invalid or expired. Sign in again.": "The login session is invalid or expired. Sign in again.",
"Unable to extract native libraries.": "Unable to extract native libraries.",
"Unable to fetch asset manifest.": "Unable to fetch asset manifest.",
"Unable to fetch runtime manifest.": "Unable to fetch runtime manifest.",
"Unable to fetch third party API. Provider may no longer exist. Try updating the launcher.": "Unable to fetch third party API. Provider may no longer exist. Try updating the launcher.",
"Unable to fetch third party API. Try updating the launcher.": "Unable to fetch third party API. Try updating the launcher.",
"Unable to fetch version manifest.": "Unable to fetch version manifest.",
"Unable to find dependency.": "Unable to find dependency.",
"Unable to load account data. The account file may be corrupted.": "Unable to load account data. The account file may be corrupted.",
"Unable to load asset manifest.": "Unable to load asset manifest.",
"Unable to load profile. Profile may corrupted": "Unable to load profile. Profile may corrupted",
"Unable to load version manifest.": "Unable to load version manifest.",
"Unable to parse Java runtime details.": "Unable to parse Java runtime details.",
"Unable to resolve native libraries.": "Unable to resolve native libraries.",
"Unable to save account data. Try again later.": "Unable to save account data. Try again later.",
"Unable to save asset manifest.": "Unable to save asset manifest.",
"Unable to save profile. Try again later.": "Unable to save profile. Try again later.",
"Unable to save version manifest.": "Unable to save version manifest.",
"Unable to verify Minecraft ownership because the ownership list is missing or invalid.": "Unable to verify Minecraft ownership because the ownership list is missing or invalid.",
"Unable to verify Minecraft ownership because the ownership response is invalid.": "Unable to verify Minecraft ownership because the ownership response is invalid.",
"Xbox Live accepted the sign-in but did not return an authentication token. Please sign in again.": "Xbox Live accepted the sign-in but did not return an authentication token. Please sign in again.",
"Xbox Live did not return the account identifier. Check the account's Xbox profile and try again.": "Xbox Live did not return the account identifier. Check the account's Xbox profile and try again.",
"Xbox security authorization did not return a token. The account may need an Xbox profile or may be restricted.": "Xbox security authorization did not return a token. The account may need an Xbox profile or may be restricted."
}
+1 -1
View File
@@ -138,6 +138,7 @@ class LauncherMainWindow(QMainWindow):
# Dialog # Dialog
self.download_dialog = ProgressDialog(self) self.download_dialog = ProgressDialog(self)
self.app.apply_qss(Path("progress_dialog.qss"), self.download_dialog.setStyleSheet)
self.download_dialog.setWindowTitle(self.app.tr_text("Downloads")) self.download_dialog.setWindowTitle(self.app.tr_text("Downloads"))
# Homepage # Homepage
@@ -191,7 +192,6 @@ class LauncherMainWindow(QMainWindow):
self.setCentralWidget(self.central) self.setCentralWidget(self.central)
# Apply qss # Apply qss
self.app.apply_qss(Path("main.qss"), self.setStyleSheet)
self.app.apply_qss(Path("toolbar.qss"), self.toolbar.setStyleSheet) self.app.apply_qss(Path("toolbar.qss"), self.toolbar.setStyleSheet)
# Toolbar # Toolbar