fix: fix some build errors

This commit is contained in:
2026-04-24 20:34:50 +02:00
parent 2984699033
commit e391e9ff6a
9 changed files with 43 additions and 25 deletions

View File

@ -546,7 +546,13 @@ pub async fn open_image_viewer(
builder = builder.position(x, y);
}
builder.build().map_err(|e| e.to_string())?;
let viewer = builder.build().map_err(|e| e.to_string())?;
viewer.eval(r#"(function(){
var s=document.createElement('style');
s.textContent='::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}*{scrollbar-width:none!important}';
var apply=function(){if(document.head)document.head.appendChild(s)};
if(document.head)apply();else document.addEventListener('DOMContentLoaded',apply);
})();"#).ok();
Ok(())
}

View File

@ -21,6 +21,12 @@ pub fn run() {
use webkit2gtk::WebViewExt;
let window = app.get_webview_window("main").expect("no main window");
window.eval(r#"(function(){
var s=document.createElement('style');
s.textContent='*:not(.with-scrollbar)::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}*:not(.with-scrollbar){scrollbar-width:none!important}';
var apply=function(){if(document.head)document.head.appendChild(s)};
if(document.head)apply();else document.addEventListener('DOMContentLoaded',apply);
})();"#).ok();
window.with_webview(|wv| {
let webkit_view = wv.inner();
if let Some(parent) = webkit_view.parent() {