Skip to content

Commit

Permalink
Add income & deductible to report
Browse files Browse the repository at this point in the history
  • Loading branch information
probablykasper committed Apr 26, 2022
1 parent a67005d commit c38e2a5
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 15 deletions.
12 changes: 10 additions & 2 deletions core/tauri-runtime-wry/src/lib.rs
Expand Up @@ -880,12 +880,20 @@ impl WindowBuilder for WindowBuilderWrapper {

#[cfg(target_os = "macos")]
fn transparent_titlebar(mut self, transparent: bool) -> Self {
self.inner = self.inner.with_title_hidden(true);
self.inner = self.inner.with_fullsize_content_view(true);
// self.inner = self.inner.with_title_hidden(transparent);
// self.inner = self.inner.with_fullsize_content_view(transparent);
self.inner = self.inner.with_titlebar_transparent(transparent);
self
}

#[cfg(target_os = "macos")]
fn transparent_title(mut self, transparent: bool) -> Self {
// self.inner = self.inner.with_title_hidden(true);
// self.inner = self.inner.with_fullsize_content_view(true);
// self.inner = self.inner.with_titlebar_transparent(transparent);
self
}

fn icon(mut self, icon: WindowIcon) -> Result<Self> {
self.inner = self
.inner
Expand Down
2 changes: 2 additions & 0 deletions core/tauri-runtime/src/webview.rs
Expand Up @@ -194,6 +194,8 @@ pub trait WindowBuilder: WindowBuilderBase {
#[must_use]
fn transparent_titlebar(self, transparent: bool) -> Self;

fn transparent_title(self, transparent: bool) -> Self;

/// Forces a theme or uses the system settings if None was provided.
fn theme(self, theme: Option<Theme>) -> Self;

Expand Down
8 changes: 8 additions & 0 deletions core/tauri/src/window.rs
Expand Up @@ -429,6 +429,14 @@ impl<R: Runtime> WindowBuilder<R> {
self
}

/// Hides the title.
#[cfg(target_os = "macos")]
#[must_use]
pub fn transparent_title(mut self, transparent: bool) -> Self {
self.window_builder = self.window_builder.transparent_title(transparent);
self
}

// ------------------------------------------- Webview attributes -------------------------------------------

/// Sets the init script.
Expand Down
20 changes: 18 additions & 2 deletions examples/helloworld/main.rs
Expand Up @@ -7,10 +7,26 @@
windows_subsystem = "windows"
)]

use tauri::{window, Manager, WindowUrl};

fn main() {
tauri::Builder::default()
.run(tauri::generate_context!(
let tauri_app = tauri::Builder::default()
.build(tauri::generate_context!(
"../../examples/helloworld/tauri.conf.json"
))
.expect("error while running tauri application");

window::WindowBuilder::new(&tauri_app.app_handle(), "main", WindowUrl::default())
.title("Kryp")
.resizable(true)
.decorations(true)
.always_on_top(false)
.transparent_titlebar(true)
// .transparent_title(false)
.inner_size(1050.0, 800.0)
.min_inner_size(300.0, 200.0)
.fullscreen(false)
.build();

tauri_app.run(|_, _| {});
}
17 changes: 6 additions & 11 deletions examples/helloworld/tauri.conf.json
@@ -1,7 +1,11 @@
{
"build": {
"distDir": ["index.html"],
"devPath": ["index.html"],
"distDir": [
"index.html"
],
"devPath": [
"index.html"
],
"beforeDevCommand": "",
"beforeBuildCommand": ""
},
Expand Down Expand Up @@ -34,15 +38,6 @@
"allowlist": {
"all": false
},
"windows": [
{
"title": "Welcome to Tauri!",
"width": 800,
"height": 600,
"resizable": true,
"fullscreen": false
}
],
"security": {
"csp": "default-src 'self'"
}
Expand Down

0 comments on commit c38e2a5

Please sign in to comment.