From 7de1fa2850c56d8245d845d3736adadb1284e871 Mon Sep 17 00:00:00 2001 From: Blomios Date: Wed, 22 Apr 2026 12:44:10 +0200 Subject: [PATCH] fix: cleaning repo --- .gitignore | 11 ++++++++++- index.html | 2 +- src-tauri/Cargo.lock | 2 ++ src-tauri/Cargo.toml | 4 ++++ src-tauri/src/lib.rs | 17 +++++++++++++++++ src-tauri/tauri.conf.json | 1 + src/App.tsx | 2 +- src/components/GuideView.tsx | 2 +- src/components/HomeView.tsx | 2 +- src/components/Sidebar.tsx | 2 +- src/components/TitleBar.tsx | 4 ++-- src/index.css | 24 ++++++++++++++++++++++-- src/main.tsx | 15 +++++++++++++++ 13 files changed, 78 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 137f3bc..ee9e552 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,16 @@ dist-ssr/ # Rust / Tauri src-tauri/target/ -src-tauri/gen/schemas/ +src-tauri/gen/ + +# Local dev scripts (machine-specific paths) +run.sh + +# Template assets (not used) +public/tauri.svg +public/vite.svg +src/assets/react.svg +src/App.css # Logs logs/ diff --git a/index.html b/index.html index 9dbe31e..9bd070b 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + TougliGui diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index fb109c0..d9405b8 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -5589,6 +5589,7 @@ dependencies = [ "chrono", "csv", "dirs-next", + "gtk", "reqwest 0.12.28", "rusqlite", "serde", @@ -5600,6 +5601,7 @@ dependencies = [ "tauri-plugin-sql", "tokio", "uuid", + "webkit2gtk", ] [[package]] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index ab0bc55..05432a4 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -26,3 +26,7 @@ tokio = { version = "1", features = ["full"] } chrono = { version = "0.4", features = ["serde"] } uuid = { version = "1", features = ["v4"] } dirs-next = "2" + +[target.'cfg(target_os = "linux")'.dependencies] +webkit2gtk = { version = "2.0", features = ["v2_38"] } +gtk = "0.18" diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index ae74080..4e3f25f 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -14,6 +14,23 @@ pub fn run() { let conn = db::open().expect("Failed to open database"); db::migrate(&conn).expect("Failed to migrate database"); app.manage(DbState(Mutex::new(conn))); + + #[cfg(target_os = "linux")] + { + use gtk::prelude::*; + use webkit2gtk::WebViewExt; + + let window = app.get_webview_window("main").expect("no main window"); + window.with_webview(|wv| { + let webkit_view = wv.inner(); + if let Some(parent) = webkit_view.parent() { + if let Ok(sw) = parent.downcast::() { + sw.set_policy(gtk::PolicyType::Never, gtk::PolicyType::Never); + } + } + }).ok(); + } + Ok(()) }) .invoke_handler(tauri::generate_handler![ diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 016aca4..866c926 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -19,6 +19,7 @@ "minHeight": 500, "decorations": false, "transparent": false, + "backgroundColor": "#0d1117", "alwaysOnTop": true, "resizable": true } diff --git a/src/App.tsx b/src/App.tsx index 30e3667..f78d07e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -82,7 +82,7 @@ export default function App() { background: #0d1117; overflow: hidden; } .app-body { display: flex; flex: 1; overflow: hidden; } - .app-main { flex: 1; overflow: hidden; display: flex; flex-direction: column; } + .app-main { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; } `} ); diff --git a/src/components/GuideView.tsx b/src/components/GuideView.tsx index 233f81c..db464fd 100644 --- a/src/components/GuideView.tsx +++ b/src/components/GuideView.tsx @@ -14,7 +14,7 @@ export default function GuideView() { const pct = allQuests.length > 0 ? Math.round((completedCount / allQuests.length) * 100) : 0; return ( -
+
{/* Main quest list */}
{/* Guide header */} diff --git a/src/components/HomeView.tsx b/src/components/HomeView.tsx index 14dd6f8..985c9c6 100644 --- a/src/components/HomeView.tsx +++ b/src/components/HomeView.tsx @@ -13,7 +13,7 @@ export default function HomeView() { const inProgressGuides = guides.filter(g => g.completed_quests > 0 && g.completed_quests < g.total_quests); return ( -
+
{/* Header */}

diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 257fff2..5a240af 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -30,7 +30,7 @@ export default function Sidebar() { />

-
+
{filtered.length === 0 ? (
Aucun guide synchronisé diff --git a/src/components/TitleBar.tsx b/src/components/TitleBar.tsx index da2a965..9b5edac 100644 --- a/src/components/TitleBar.tsx +++ b/src/components/TitleBar.tsx @@ -9,7 +9,7 @@ export default function TitleBar({ onOpenProfiles }: Props) { const { alwaysOnTop, toggleAlwaysOnTop, syncing, syncGuides, view, closeGuide, activeGuideData } = useStore(); function handleDragMouseDown(e: React.MouseEvent) { - if (e.button === 0) { + if (e.button === 0 && !alwaysOnTop) { getCurrentWindow().startDragging(); } } @@ -36,7 +36,7 @@ export default function TitleBar({ onOpenProfiles }: Props) { onMouseDown={handleDragMouseDown} style={{ display: "flex", alignItems: "center", gap: "8px", flex: 1, - cursor: "grab", userSelect: "none", + cursor: alwaysOnTop ? "default" : "grab", userSelect: "none", }} > diff --git a/src/index.css b/src/index.css index 05872ea..93f69d7 100644 --- a/src/index.css +++ b/src/index.css @@ -32,10 +32,30 @@ padding: 0; } -html, body, #root { +html, body { height: 100%; - width: 100%; overflow: hidden; + overscroll-behavior: none; + margin: 0; + padding: 0; +} + +html::-webkit-scrollbar, +body::-webkit-scrollbar { + display: none; + width: 0; + height: 0; +} + +html, body { + scrollbar-width: none; +} + +#root { + position: fixed; + inset: 0; + overflow: hidden; + overscroll-behavior: none; font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; } diff --git a/src/main.tsx b/src/main.tsx index 2be325e..831cee0 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -2,6 +2,21 @@ import React from "react"; import ReactDOM from "react-dom/client"; import App from "./App"; +// Block all document-level scrolling +document.addEventListener("wheel", (e) => { + let el = e.target as HTMLElement | null; + while (el && el !== document.documentElement) { + const { overflowY } = window.getComputedStyle(el); + if (overflowY === "scroll" || overflowY === "auto") return; + el = el.parentElement; + } + e.preventDefault(); +}, { passive: false }); + +document.addEventListener("scroll", () => { + window.scrollTo(0, 0); +}, { passive: true }); + ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(