Skip to content

Commit

Permalink
Merge branch 'master' into macos-premultiply-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
zkxs committed Jul 2, 2024
2 parents 5ab6531 + 2c55145 commit 1369ec3
Show file tree
Hide file tree
Showing 9 changed files with 1,153 additions and 930 deletions.
800 changes: 500 additions & 300 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ debug = true # required for `cargo flamegraph`, and makes `cargo-bloat` output s
benchmark = [] # used to compile reference functions only needed for benchmarking against

[dependencies]
tray-icon = { version = "0.13", default-features = false }
winit = "0.29"
tray-icon = { version = "0.14", default-features = false }
winit = "0.30"
softbuffer = "0.4"
serde = { version = "1", features = ["derive"] }
toml = "0.8.12"
Expand All @@ -47,7 +47,7 @@ winapi = { version = "0.3", features = ["winuser", "windef", "minwindef"] }
[target.'cfg(target_os = "linux")'.dependencies]
gtk = "0.18" # must use this version of gtk because it's what tray-icon 0.10 needs

[target.'cfg(target_os = "windows")'.build-dependencies]
[build-dependencies]
winres = "0.1"
ico = "0.3"

Expand Down
6 changes: 6 additions & 0 deletions MAINTENANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ This document contains some common commands that I need to remember for package

`cargo deny check`

## Check & Lint

To check all supported targets for compilation/lint errors, run:

`cargo clippy --target x86_64-pc-windows-msvc --target x86_64-apple-darwin --target aarch64-apple-darwin --all-features`

## Tests

`cargo test`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ For suggestions, questions, or even just to say hey, feel free to start a [discu

## License

Copyright 2023 [Michael Ripley](https://github.com/zkxs).
Copyright 2023-2024 [Michael Ripley](https://github.com/zkxs).

Simple Crosshair Overlay is provided under the [GPL-3.0 license](LICENSE).
10 changes: 4 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of simple-crosshair-overlay and is licenced under the GNU GPL v3.0.
// See LICENSE file for full text.
// Copyright © 2023 Michael Ripley
// Copyright © 2023-2024 Michael Ripley

use std::{env, fs, io};
use std::io::{BufWriter, Write};
Expand All @@ -17,11 +17,11 @@ use std::process::Command;
const TRAY_ICON_DIMENSION: u32 = 32;

/// The sexy Windows .ico with the multiple size defined below adds ~26k to the binary.
#[cfg(target_os = "windows")] const APP_ICON_DIMENSIONS: [u32; 5] = [16, 24, 32, 48, 64];
const APP_ICON_DIMENSIONS: [u32; 5] = [16, 24, 32, 48, 64];

static CONSTANTS_SOURCE_NAME: &str = "constants.rs";
static TRAY_ICON_NAME: &str = "trayicon.argb";
#[cfg(target_os = "windows")] static APP_ICON_NAME: &str = "app.ico";
static APP_ICON_NAME: &str = "app.ico";
static APP_NAME: &str = "Simple Crosshair Overlay";

// Put in some indication that a build was in debug profile so there's a chance someone with the wrong build might one day notice
Expand Down Expand Up @@ -56,8 +56,7 @@ fn main() -> io::Result<()> {
}

// only generate Windows resource info on Windows.
#[cfg(target_os = "windows")]
{
if env::var("CARGO_CFG_TARGET_OS").unwrap() == "windows" {
let icon_path = out_dir.join(APP_ICON_NAME);
generate_file_if_not_cached(icon_path.as_path(), create_windows_app_icon_file)?;

Expand Down Expand Up @@ -138,7 +137,6 @@ fn create_tray_icon_file(path: &Path) -> io::Result<()> {
}

/// build a .ico file for windows
#[cfg(target_os = "windows")]
fn create_windows_app_icon_file(path: &Path) -> io::Result<()> {
let mut icon_dir = ico::IconDir::new(ico::ResourceType::Icon);

Expand Down
108 changes: 0 additions & 108 deletions src/linux.rs

This file was deleted.

Loading

0 comments on commit 1369ec3

Please sign in to comment.