Add setting to use native window titlebar (#312)

This commit is contained in:
Gregory Schier
2025-12-05 09:15:48 -08:00
committed by GitHub
parent 095af8cf4b
commit 5bf7278479
11 changed files with 111 additions and 25 deletions

View File

@@ -25,6 +25,7 @@ use tauri_plugin_deep_link::DeepLinkExt;
use tauri_plugin_log::fern::colors::ColoredLevelConfig;
use tauri_plugin_log::{Builder, Target, TargetKind, log};
use tauri_plugin_window_state::{AppHandleExt, StateFlags};
use yaak_mac_window::AppHandleMacWindowExt;
use tokio::sync::Mutex;
use tokio::task::block_in_place;
use tokio::time;
@@ -1391,6 +1392,10 @@ pub fn run() {
let grpc_handle = GrpcHandle::new(&app.app_handle());
app.manage(Mutex::new(grpc_handle));
// Specific settings
let settings = app.db().get_settings();
app.app_handle().set_native_titlebar(settings.use_native_titlebar);
monitor_plugin_events(&app.app_handle().clone());
Ok(())

View File

@@ -7,6 +7,7 @@ use tauri::{
};
use tauri_plugin_opener::OpenerExt;
use tokio::sync::mpsc;
use yaak_models::query_manager::QueryManagerExt;
const DEFAULT_WINDOW_WIDTH: f64 = 1100.0;
const DEFAULT_WINDOW_HEIGHT: f64 = 600.0;
@@ -94,7 +95,8 @@ pub(crate) fn create_window<R: Runtime>(
});
}
if config.hide_titlebar {
let settings = handle.db().get_settings();
if config.hide_titlebar && !settings.use_native_titlebar {
#[cfg(target_os = "macos")]
{
use tauri::TitleBarStyle;