fix: cleaning repo
This commit is contained in:
11
.gitignore
vendored
11
.gitignore
vendored
@ -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/
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<link rel="icon" type="image/png" href="/logo_tougli.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>TougliGui</title>
|
||||
</head>
|
||||
|
||||
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@ -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]]
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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::<gtk::ScrolledWindow>() {
|
||||
sw.set_policy(gtk::PolicyType::Never, gtk::PolicyType::Never);
|
||||
}
|
||||
}
|
||||
}).ok();
|
||||
}
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
"minHeight": 500,
|
||||
"decorations": false,
|
||||
"transparent": false,
|
||||
"backgroundColor": "#0d1117",
|
||||
"alwaysOnTop": true,
|
||||
"resizable": true
|
||||
}
|
||||
|
||||
@ -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; }
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -14,7 +14,7 @@ export default function GuideView() {
|
||||
const pct = allQuests.length > 0 ? Math.round((completedCount / allQuests.length) * 100) : 0;
|
||||
|
||||
return (
|
||||
<div style={{ flex: 1, display: "flex", overflow: "hidden" }}>
|
||||
<div style={{ flex: 1, display: "flex", overflow: "hidden", minHeight: 0 }}>
|
||||
{/* Main quest list */}
|
||||
<div style={{ flex: 1, overflowY: "auto", padding: "20px 24px" }}>
|
||||
{/* Guide header */}
|
||||
|
||||
@ -13,7 +13,7 @@ export default function HomeView() {
|
||||
const inProgressGuides = guides.filter(g => g.completed_quests > 0 && g.completed_quests < g.total_quests);
|
||||
|
||||
return (
|
||||
<div style={{ flex: 1, overflowY: "auto", padding: "20px 24px" }}>
|
||||
<div style={{ flex: 1, overflowY: "auto", padding: "20px 24px", minHeight: 0 }}>
|
||||
{/* Header */}
|
||||
<div style={{ marginBottom: "24px" }}>
|
||||
<h1 style={{ fontSize: "18px", fontWeight: 700, color: "#f0c040", marginBottom: "4px" }}>
|
||||
|
||||
@ -30,7 +30,7 @@ export default function Sidebar() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div style={{ flex: 1, overflowY: "auto", padding: "8px 0" }}>
|
||||
<div style={{ flex: 1, overflowY: "auto", padding: "8px 0", scrollbarWidth: "none" }}>
|
||||
{filtered.length === 0 ? (
|
||||
<div style={{ padding: "16px 12px", color: "#4a5568", fontSize: "12px", textAlign: "center" }}>
|
||||
Aucun guide synchronisé
|
||||
|
||||
@ -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",
|
||||
}}
|
||||
>
|
||||
<img src="/logo_tougli.png" style={{ pointerEvents: "none", width: "24px", height: "24px", objectFit: "contain" }} />
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
15
src/main.tsx
15
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(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
|
||||
Reference in New Issue
Block a user