fix: fix some build errors
This commit is contained in:
@ -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(())
|
||||
}
|
||||
|
||||
|
||||
@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user