Compare commits

...
Author SHA1 Message Date
Brandon Thomas 71d336e0f8 cleanup deps 2025-08-24 14:52:19 -04:00
Brandon Thomas 8596bf2087 fix drag region 2025-08-24 12:34:37 -04:00
12 changed files with 103 additions and 38 deletions
Generated
+2 -2
View File
@@ -10876,9 +10876,9 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
[[package]]
name = "tauri"
version = "2.8.2"
version = "2.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a54629607ea3084a8b455c1ebe888cbdfc4de02fa5edb2e40db0dc97091007e3"
checksum = "dcead52ec80df0e9e4be671c0f2596a1f3bd7b6b2c9418c1eb7dd737499ff4bd"
dependencies = [
"anyhow",
"bytes 1.10.1",
+2 -1
View File
@@ -208,8 +208,9 @@ serde_derive = "1.0.219"
serde_json = "1.0.140"
serde_yaml = "0.9.34+deprecated"
sha3 = "0.10.8"
tauri = { version = "2.8.2", features = ["unstable", "devtools"] } # NB: "devtools" prevents App Store distribution
tauri = { version = "2.8.3", features = ["unstable", "devtools"] } # NB: "devtools" prevents App Store distribution; "ubstable" is needed for window access
tauri-plugin-dialog = "2.3.3"
tauri-plugin-fs = "2.4.2"
tauri-plugin-log = "2.6.0"
tauri-plugin-upload = "2.3.1"
tempdir = "0.3.7"
+19 -13
View File
@@ -46,31 +46,31 @@ tokens.workspace = true
web_base64.workspace = true
# External
anyhow = { workspace = true }
base64 = { workspace = true }
anyhow.workspace = true
base64.workspace = true
bytes = "1.10.1"
chrono = { workspace = true }
chrono.workspace = true
directories = "6.0.0"
dirs = "6.0.0"
futures = "0.3"
image = "0.25.5"
indexmap = { workspace = true }
log = { workspace = true }
once_cell = { workspace = true }
rand = { workspace = true }
indexmap.workspace = true
log.workspace = true
once_cell.workspace = true
rand.workspace = true
reqwest = { workspace = true, features = ["multipart", "stream"], default-features = false } # NB(bt,2025-03-10): default-features = false on Windows while I debug openssl / rustls
serde = { workspace = true }
serde_derive = { workspace = true }
serde_json = { workspace = true }
serde.workspace = true
serde_derive.workspace = true
serde_json.workspace = true
tauri.workspace = true
tauri-plugin-dialog.workspace = true
tauri-plugin-log.workspace = true
tauri-plugin-upload.workspace = true
tempdir = { workspace = true }
tempfile = { workspace = true }
tempdir.workspace = true
tempfile.workspace = true
tokio = { version = "1.42", features = ["rt", "rt-multi-thread", "fs"] }
tokio-util = { version = "0.7", features = ["codec"] }
url = { workspace = true }
url.workspace = true
# NB: We need to vendor this in so that we can access the cookies inside via the private API
tauri-plugin-http = { path = "../../vendor/tauri-plugin-http" }
@@ -79,6 +79,12 @@ tauri-plugin-http = { path = "../../vendor/tauri-plugin-http" }
# types and can't do threading. We need to wait for a new version to unpin from Git.
discord-rich-presence = { git = "https://github.com/vionya/discord-rich-presence" }
# # Transparent title bar on MacOS
# # NB: See the notes here:
# # https://v2.tauri.app/learn/window-customization/
# [target."cfg(target_os = \"macos\")".dependencies]
# cocoa = "0.26"
[dev-dependencies]
serial_test = "3.2.0"
@@ -5,13 +5,16 @@
"windows": ["main"],
"permissions": [
"core:default",
"log:default",
"core:window:allow-minimize",
"core:window:allow-toggle-maximize",
"core:window:allow-close",
"core:window:allow-minimize",
"core:window:allow-start-dragging",
"core:window:allow-toggle-maximize",
"core:window:default",
"dialog:default",
"http:allow-fetch",
"log:default",
"upload:allow-download",
"upload:default",
"http:allow-fetch",
{
"identifier": "http:default",
"allow": [
@@ -22,7 +25,6 @@
"url": "http://localhost:12345"
}
]
},
"dialog:default"
}
]
}
@@ -1,2 +1,3 @@
mod tasks;
pub mod handle_tauri_startup;
mod tasks;
pub mod setup_main_window;
@@ -0,0 +1,51 @@
use tauri::{AppHandle, TitleBarStyle, WebviewUrl, WebviewWindowBuilder};
use tauri::window::Color;
use errors::AnyhowResult;
pub async fn setup_main_window(
app: &AppHandle,
) -> AnyhowResult<()> {
let win_builder =
WebviewWindowBuilder::new(app, "main", WebviewUrl::default())
.title("Artcraft")
//.decorations(false) // NB: This breaks Mac!
.resizable(true)
.fullscreen(false)
.background_color(Color(0, 0, 0, 0))
.enable_clipboard_access()
.inner_size(800.0, 600.0);
// set transparent title bar only when building for macOS
#[cfg(target_os = "macos")]
let win_builder = win_builder
.decorations(true) // NB: Mac requires decorations. Tons of capabilities disappear without it.
.title_bar_style(TitleBarStyle::Overlay)
.hidden_title(true)
.accept_first_mouse(true) // https://github.com/tauri-apps/tauri/issues/11605#issuecomment-2460112096
.focusable(true)
.focused(true);
let window = win_builder.build()?;
/*// set background color only when building for macOS
#[cfg(target_os = "macos")]
{
use cocoa::appkit::{NSColor, NSWindow};
use cocoa::base::{id, nil};
let ns_window = window.ns_window().unwrap() as id;
unsafe {
let bg_color = NSColor::colorWithRed_green_blue_alpha_(
nil,
50.0 / 255.0,
158.0 / 255.0,
163.5 / 255.0,
0.0,
);
ns_window.setBackgroundColor_(bg_color);
}
}*/
Ok(())
}
+3
View File
@@ -18,6 +18,7 @@ use crate::core::commands::platform_info_command::platform_info_command;
use crate::core::commands::providers::get_provider_order_command::get_provider_order_command;
use crate::core::commands::providers::set_provider_order_command::set_provider_order_command;
use crate::core::lifecycle::startup::handle_tauri_startup::handle_tauri_startup;
use crate::core::lifecycle::startup::setup_main_window::setup_main_window;
use crate::core::state::app_env_configs::app_env_configs::AppEnvConfigs;
use crate::core::state::app_preferences::app_preferences_manager::load_app_preferences_or_default;
use crate::core::state::data_dir::app_data_root::AppDataRoot;
@@ -121,6 +122,8 @@ pub fn run() {
let fal_tasks = fal_task_queue_2.clone();
tauri::async_runtime::block_on(async move {
let result = setup_main_window(&app).await;
let result = handle_tauri_startup(
handle,
root,
@@ -7,13 +7,6 @@
},
"app": {
"windows": [
{
"title": "ArtCraft",
"resizable": true,
"fullscreen": false,
"dragDropEnabled": false,
"decorations": true
}
]
}
}
+1 -1
View File
@@ -42,7 +42,7 @@ tauri = { workspace = true }
thiserror = { workspace = true }
tokio = { version = "1", features = ["sync", "macros"] }
#tauri-plugin-fs = { path = "../fs", version = "2.2.1" }
tauri-plugin-fs = { version = "2.2.1" }
tauri-plugin-fs = { workspace = true }
urlpattern = "0.3"
regex = "1"
http = "1"
@@ -167,14 +167,16 @@ export const TopBar = ({ pageName, loginSignUpPressed }: Props) => {
<nav
className="mx-auto grid h-[56px] w-screen grid-cols-3 items-center justify-between ps-3"
aria-label="navigation"
data-tauri-drag-region
>
<div className="flex items-center gap-3">
<div className="mr-2">
<span className="sr-only">ArtCraft</span>
<div className="flex items-center gap-3" data-tauri-drag-region>
<div className="mr-2" data-tauri-drag-region>
<span className="sr-only" data-tauri-drag-region>ArtCraft</span>
<img
className="h-[24px] w-auto"
src="/resources/images/artcraft-logo-3.png"
alt="Logo ArtCraft"
data-tauri-drag-region
/>
</div>
<MenuIconSelector
@@ -211,15 +213,16 @@ export const TopBar = ({ pageName, loginSignUpPressed }: Props) => {
<div
className={`${tabStore.activeTabId === "3D" ? "no-drag" : ""} flex items-center justify-center gap-2 font-medium`}
data-tauri-drag-region
>
{tabStore.activeTabId === "3D" ? (
<SceneTitleInput pageName={pageName} />
) : (
<h1>{pageTitle}</h1>
<h1 data-tauri-drag-region>{pageTitle}</h1>
)}
</div>
<div className="flex justify-end gap-2">
<div className="flex justify-end gap-2" data-tauri-drag-region>
<div className="no-drag flex gap-2">
{/* - Uncomment for pricing modal - BFlat */}
{/* <Button
+4 -1
View File
@@ -76,7 +76,10 @@ createRoot(document.getElementById("root")!).render(
<StrictMode>
<BrowserRouter>
<GlobalSettingsManager env={ENV} />
<div className="topbar-spacer" />
<div className="topbar-spacer"
data-tauri-drag-region={true}
/>
<PageEnigma />
</BrowserRouter>
</StrictMode>
+3 -1
View File
@@ -60,7 +60,9 @@ export default function App() {
<Links />
</head>
<body className="overflow-hidden bg-ui-background">
<div className="topbar-spacer" />
<div className="topbar-spacer"
data-tauri-drag-region={true}
/>
<PostHogProvider client={posthog}>
<Outlet />
</PostHogProvider>