clan-app: prepare icon support on linux
For some reason the icon is not shown when using the gtk backend but at least the API calls look correct.
This commit is contained in:
@@ -39,6 +39,8 @@ def app_run(app_opts: ClanAppOptions) -> int:
|
||||
|
||||
webview = Webview(debug=app_opts.debug)
|
||||
webview.title = "Clan App"
|
||||
# This seems to call the gtk api correctly but and gtk also seems to our icon, but somehow the icon is not loaded.
|
||||
webview.icon = "clan-white"
|
||||
|
||||
def cancel_task(
|
||||
task_id: str, *, op_key: str
|
||||
|
||||
@@ -88,6 +88,9 @@ class _WebviewLibrary:
|
||||
self.webview_set_title = self.lib.webview_set_title
|
||||
self.webview_set_title.argtypes = [c_void_p, c_char_p]
|
||||
|
||||
self.webview_set_icon = self.lib.webview_set_icon
|
||||
self.webview_set_icon.argtypes = [c_void_p, c_char_p]
|
||||
|
||||
self.webview_set_size = self.lib.webview_set_size
|
||||
self.webview_set_size.argtypes = [c_void_p, c_int, c_int, c_int]
|
||||
|
||||
|
||||
@@ -84,6 +84,15 @@ class Webview:
|
||||
_webview_lib.webview_set_title(self._handle, _encode_c_string(value))
|
||||
self._title = value
|
||||
|
||||
@property
|
||||
def icon(self) -> str:
|
||||
return self._icon
|
||||
|
||||
@icon.setter
|
||||
def icon(self, value: str) -> None:
|
||||
_webview_lib.webview_set_icon(self._handle, _encode_c_string(value))
|
||||
self._icon = value
|
||||
|
||||
def destroy(self) -> None:
|
||||
for name in list(self._callbacks.keys()):
|
||||
self.unbind(name)
|
||||
|
||||
@@ -11,8 +11,8 @@ pkgs.clangStdenv.mkDerivation {
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "clan-lol";
|
||||
repo = "webview";
|
||||
rev = "33374e1030c5e243dac491e6c0e84d32e895c2e5";
|
||||
sha256 = "sha256-8BgfQL0V3f2n5lq5MDwJCJo6MkVSYvJkwpKCj2tBRz8=";
|
||||
rev = "7d24f0192765b7e08f2d712fae90c046d08f318e";
|
||||
hash = "sha256-yokVI9tFiEEU5M/S2xAeJOghqqiCvTelLo8WLKQZsSY=";
|
||||
};
|
||||
|
||||
outputs = [
|
||||
@@ -20,6 +20,12 @@ pkgs.clangStdenv.mkDerivation {
|
||||
"dev"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DWEBVIEW_BUILD_TESTS=OFF"
|
||||
];
|
||||
|
||||
# Dependencies used during the build process, if any
|
||||
nativeBuildInputs = with pkgs; [
|
||||
gnumake
|
||||
|
||||
Reference in New Issue
Block a user