Skip to content

Commit

Permalink
Configure Renovate (#2)
Browse files Browse the repository at this point in the history
* chore(deps): add renovate.json

* fix build

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: amrbashir <[email protected]>
  • Loading branch information
renovate[bot] and amrbashir authored Nov 27, 2022
1 parent e5f8fe3 commit a8cfda2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use system_tray::{TrayIconBuilder, menu::Menu};

let tray_menu = Menu::new();
let tray_icon = TrayIconBuilder::new()
.with_menu(tray_menu)
.with_menu(Box::new(tray_menu))
.with_tooltip("system-tray - tray icon library!")
.with_icon(icon)
.build()
Expand All @@ -38,7 +38,7 @@ which you can use to listen to events when a click happens on the tray icon
use system_tray::tray_event_receiver;

if let Ok(event) = tray_event_receiver().try_recv() {
println!("{}", event);
println!("{:?}", event);
}
```

Expand All @@ -48,10 +48,10 @@ You can also listen for the menu events using `menu_event_listener` to get event
use system_tray::{tray_event_receiver, menu::menu_event_receiver};

if let Ok(event) = tray_event_receiver().try_recv() {
println!("tray event: {}", event);
println!("tray event: {:?}", event);
}

if let Ok(event) = menu_event_receiver().try_recv() {
println!("menu event: {}", event);
println!("menu event: {:?}", event);
}
```
4 changes: 4 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", ":disableDependencyDashboard"]
}
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
//! Create a tray icon without a menu.
//!
//! ```no_run
//! use system_tray::TrayIconBuilder;
//! use system_tray::{TrayIconBuilder, icon::Icon};
//!
//! # let icon = Vec::new();
//! # let icon = Icon::from_rgba(Vec::new(), 0, 0).unwrap();
//! let tray_icon = TrayIconBuilder::new()
//! .with_tooltip("system-tray - tray icon library!")
//! .with_icon(icon)
Expand All @@ -20,12 +20,12 @@
//! Create a tray icon with a menu.
//!
//! ```no_run
//! use system_tray::{TrayIconBuilder, menu::Menu};
//! use system_tray::{TrayIconBuilder, menu::Menu, icon::Icon};
//!
//! #let icon = Vec::new();
//! # let icon = Icon::from_rgba(Vec::new(), 0, 0).unwrap();
//! let tray_menu = Menu::new();
//! let tray_icon = TrayIconBuilder::new()
//! .with_menu(tray_menu)
//! .with_menu(Box::new(tray_menu))
//! .with_tooltip("system-tray - tray icon library!")
//! .with_icon(icon)
//! .build()
Expand All @@ -40,7 +40,7 @@
//! use system_tray::tray_event_receiver;
//!
//! if let Ok(event) = tray_event_receiver().try_recv() {
//! println!("{}", event);
//! println!("{:?}", event);
//! }
//! ```
//!
Expand All @@ -50,11 +50,11 @@
//! use system_tray::{tray_event_receiver, menu::menu_event_receiver};
//!
//! if let Ok(event) = tray_event_receiver().try_recv() {
//! println!("tray event: {}", event);
//! println!("tray event: {:?}", event);
//! }
//!
//! if let Ok(event) = menu_event_receiver().try_recv() {
//! println!("menu event: {}", event);
//! println!("menu event: {:?}", event);
//! }
//! ```
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/gtk/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl PlatformIcon {

pub fn write_to_png(&self, path: impl AsRef<Path>) {
let png = File::create(path).unwrap();
let ref mut w = BufWriter::new(png);
let w = &mut BufWriter::new(png);

let mut encoder = png::Encoder::new(w, self.width as _, self.height as _);
encoder.set_color(png::ColorType::Rgba);
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/gtk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn temp_icon_path(temp_icon_dir: Option<&PathBuf>, id: u32) -> std::io::Result<(
let parent_path = match temp_icon_dir.as_ref() {
Some(path) => path.to_path_buf(),
None => dirs_next::runtime_dir()
.unwrap_or_else(|| std::env::temp_dir())
.unwrap_or_else(std::env::temp_dir)
.join("tao"),
};

Expand Down

0 comments on commit a8cfda2

Please sign in to comment.