Skip to content

Commit a8f1fc2

Browse files
authored
Merge pull request #184 from unsecretised/remove-hotkey-hot-reloading
Remove hotkey reloading on config reload
2 parents ba415ee + d4215cf commit a8f1fc2

2 files changed

Lines changed: 1 addition & 23 deletions

File tree

src/app/tile.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::{app::apps::App, platform::default_app_paths};
1010

1111
use arboard::Clipboard;
1212
use global_hotkey::hotkey::HotKey;
13-
use global_hotkey::{GlobalHotKeyEvent, GlobalHotKeyManager, HotKeyState};
13+
use global_hotkey::{GlobalHotKeyEvent, HotKeyState};
1414

1515
use iced::futures::SinkExt;
1616
use iced::futures::channel::mpsc::{Sender, channel};
@@ -136,14 +136,6 @@ pub struct Hotkeys {
136136
pub clipboard_hotkey: HotKey,
137137
}
138138

139-
impl Hotkeys {
140-
pub fn register(&self) {
141-
let manager = GlobalHotKeyManager::new().unwrap();
142-
manager.register(self.toggle).ok();
143-
manager.register(self.clipboard_hotkey).ok();
144-
}
145-
}
146-
147139
impl Tile {
148140
/// This returns the theme of the window
149141
pub fn theme(&self, _: window::Id) -> Option<Theme> {

src/app/tile/update.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use crate::app::{Message, Page, tile::Tile};
2626
use crate::calculator::Expr;
2727
use crate::commands::Function;
2828
use crate::config::Config;
29-
use crate::tile::Hotkeys;
3029
use crate::unit_conversion;
3130
use crate::utils::is_valid_url;
3231
use crate::{app::ArrowKey, platform::focus_this_app};
@@ -267,19 +266,6 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task<Message> {
267266
new_options.extend(App::basic_apps());
268267
new_options.par_sort_by_key(|x| x.display_name.len());
269268

270-
tile.hotkeys = Hotkeys {
271-
toggle: new_config
272-
.toggle_hotkey
273-
.parse()
274-
.unwrap_or(tile.hotkeys.toggle),
275-
clipboard_hotkey: new_config
276-
.clipboard_hotkey
277-
.parse()
278-
.unwrap_or(tile.hotkeys.clipboard_hotkey),
279-
};
280-
281-
tile.hotkeys.register();
282-
283269
tile.theme = new_config.theme.to_owned().into();
284270
tile.config = new_config;
285271
tile.options = AppIndex::from_apps(new_options);

0 commit comments

Comments
 (0)