diff --git a/README.md b/README.md index 8dade61..947605b 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Use the tray icon to: - Toggle crosshair visibility (you can also use Ctrl+H) - Toggle **Adjust Mode** (you can also use Ctrl+J) -- Pick a color for the default crosshair (you can also use Ctrl+K). +- Pick a color for the default crosshair (you can also use Ctrl+K if you are in Adjust Mode). - Load a PNG image as your crosshair - Reset crosshair to default settings - Safely exit the application and save your settings @@ -48,6 +48,7 @@ In **Adjust Mode**: - Arrow keys to move the crosshair - PageUp/PageDown to increase/decrease the crosshair scale - Ctrl+M to cycle through your monitors +- Ctrl+K to pick a color for the default crosshair ### Custom PNG Crosshairs diff --git a/src/main.rs b/src/main.rs index 4720559..c38d9d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -229,7 +229,8 @@ fn main() { hotkey_manager.poll_keys(); hotkey_manager.process_keys(); - if menu_items.adjust_button.is_checked() { + let adjust_mode = menu_items.adjust_button.is_checked(); + if adjust_mode { if hotkey_manager.move_up() != 0 { settings.persisted.window_dy -= hotkey_manager.move_up() as i32; window_position_dirty = true; @@ -284,7 +285,8 @@ fn main() { } } - if hotkey_manager.toggle_color_picker() { + // only enable this hotkey if the color picker is already visible OR if adjust mode is on + if hotkey_manager.toggle_color_picker() && (adjust_mode || settings.get_pick_color()) { let color_pick = settings.toggle_pick_color(); menu_items.color_pick_button.set_checked(color_pick); handle_color_pick(color_pick, &window, &mut last_focused_window, true); diff --git a/src/settings.rs b/src/settings.rs index 3470d6f..6c8e008 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -160,6 +160,11 @@ impl Settings { } } + /// Returns `true` if color picker mode is now enabled, `false` otherwise. + pub fn get_pick_color(&self) -> bool { + self.render_mode == RenderMode::ColorPicker + } + /// Set the color of the generated crosshair. The provided `color` must not have premultiplied alpha (yet) pub fn set_color(&mut self, color: u32) { debug_println!("set color to {color:08X}");