UI: Fixed style.css not working when installed
All checks were successful
checks-impure / test (pull_request) Successful in 1m38s
checks / test (pull_request) Successful in 2m16s

This commit is contained in:
Luis Hebendanz 2024-02-08 14:10:17 +07:00
parent 6ddb8dfe9d
commit a2ce341995
3 changed files with 7 additions and 3 deletions

View File

@ -1,10 +1,11 @@
#!/usr/bin/env python3
import logging
from pathlib import Path
from typing import Any, ClassVar
import gi
from clan_vm_manager import assets
gi.require_version("Gtk", "4.0")
gi.require_version("Adw", "1")
@ -86,7 +87,9 @@ class MainApplication(Adw.Application):
# TODO: For css styling
def init_style(self) -> None:
resource_path = Path(__file__).parent / "style.css"
resource_path = assets.loc / "style.css"
log.debug(f"Style css path: {resource_path}")
css_provider = Gtk.CssProvider()
css_provider.load_from_path(str(resource_path))
Gtk.StyleContext.add_provider_for_display(

View File

@ -25,7 +25,8 @@ mkShell {
set -eou pipefail
DESKTOP_DST=~/.local/share/applications/clan-vm-manager.desktop
DESKTOP_SRC=${clan-vm-manager}/share/applications/clan-vm-manager.desktop
UI_BIN=${clan-vm-manager}/bin/clan-vm-manager
# UI_BIN="env GTK_DEBUG=interactive ${clan-vm-manager}/bin/clan-vm-manager"
UI_BIN="${clan-vm-manager}/bin/clan-vm-manager"
cp -f $DESKTOP_SRC $DESKTOP_DST
sleep 2