do not add emoji to auto mode
This commit is contained in:
parent
28adf2ca85
commit
fbff13752c
3 changed files with 6 additions and 8 deletions
|
@ -25,7 +25,6 @@ The standard view will show `ssh` and `drun`, for other modes the following pref
|
||||||
* `ssh` (optional)
|
* `ssh` (optional)
|
||||||
* `?` web search
|
* `?` web search
|
||||||
* `/`, `$` or `~` for files
|
* `/`, `$` or `~` for files
|
||||||
* `emoji` for emojis
|
|
||||||
|
|
||||||
<img src="images/demo.gif">
|
<img src="images/demo.gif">
|
||||||
|
|
||||||
|
|
|
@ -425,6 +425,7 @@ where
|
||||||
gtk4::init().map_err(|e| Error::Graphics(e.to_string()))?;
|
gtk4::init().map_err(|e| Error::Graphics(e.to_string()))?;
|
||||||
log::debug!("Starting GUI");
|
log::debug!("Starting GUI");
|
||||||
if let Some(ref css) = config.style() {
|
if let Some(ref css) = config.style() {
|
||||||
|
log::debug!("loading css from {css}");
|
||||||
let provider = CssProvider::new();
|
let provider = CssProvider::new();
|
||||||
let css_file_path = File::for_path(css);
|
let css_file_path = File::for_path(css);
|
||||||
provider.load_from_file(&css_file_path);
|
provider.load_from_file(&css_file_path);
|
||||||
|
@ -498,8 +499,8 @@ fn build_ui<T, P>(
|
||||||
.application(&app)
|
.application(&app)
|
||||||
.decorated(false)
|
.decorated(false)
|
||||||
.resizable(false)
|
.resizable(false)
|
||||||
.default_width(100)
|
.default_width(1)
|
||||||
.default_height(100)
|
.default_height(1)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
let ui_elements = Rc::new(UiElements {
|
let ui_elements = Rc::new(UiElements {
|
||||||
|
@ -563,7 +564,7 @@ fn build_ui<T, P>(
|
||||||
let wait_for_items = Instant::now();
|
let wait_for_items = Instant::now();
|
||||||
let (_changed, provider_elements) = get_provider_elements.join().unwrap();
|
let (_changed, provider_elements) = get_provider_elements.join().unwrap();
|
||||||
log::debug!("got items after {:?}", wait_for_items.elapsed());
|
log::debug!("got items after {:?}", wait_for_items.elapsed());
|
||||||
build_ui_from_menu_items(&ui_elements, &meta, provider_elements);
|
|
||||||
|
|
||||||
let animate_cfg = config.clone();
|
let animate_cfg = config.clone();
|
||||||
let animate_window = ui_elements.window.clone();
|
let animate_window = ui_elements.window.clone();
|
||||||
|
@ -573,6 +574,8 @@ fn build_ui<T, P>(
|
||||||
window_show_resize(&animate_cfg.clone(), w);
|
window_show_resize(&animate_cfg.clone(), w);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
build_ui_from_menu_items(&ui_elements, &meta, provider_elements);
|
||||||
|
|
||||||
// hide the fact that we are starting with a small window
|
// hide the fact that we are starting with a small window
|
||||||
ui_elements.window.set_opacity(0.01);
|
ui_elements.window.set_opacity(0.01);
|
||||||
let window_start = Instant::now();
|
let window_start = Instant::now();
|
||||||
|
|
|
@ -26,7 +26,6 @@ struct AutoItemProvider {
|
||||||
file: FileItemProvider<AutoRunType>,
|
file: FileItemProvider<AutoRunType>,
|
||||||
math: MathProvider<AutoRunType>,
|
math: MathProvider<AutoRunType>,
|
||||||
ssh: SshProvider<AutoRunType>,
|
ssh: SshProvider<AutoRunType>,
|
||||||
emoji: EmojiProvider<AutoRunType>,
|
|
||||||
last_mode: Option<AutoRunType>,
|
last_mode: Option<AutoRunType>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +36,6 @@ impl AutoItemProvider {
|
||||||
file: FileItemProvider::new(AutoRunType::File, config.sort_order()),
|
file: FileItemProvider::new(AutoRunType::File, config.sort_order()),
|
||||||
math: MathProvider::new(AutoRunType::Math),
|
math: MathProvider::new(AutoRunType::Math),
|
||||||
ssh: SshProvider::new(AutoRunType::Ssh, &config.sort_order()),
|
ssh: SshProvider::new(AutoRunType::Ssh, &config.sort_order()),
|
||||||
emoji: EmojiProvider::new(AutoRunType::Emoji, &config.sort_order()),
|
|
||||||
last_mode: None,
|
last_mode: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,8 +82,6 @@ impl ItemProvider<AutoRunType> for AutoItemProvider {
|
||||||
(AutoRunType::File, self.file.get_elements(search_opt))
|
(AutoRunType::File, self.file.get_elements(search_opt))
|
||||||
} else if search.starts_with("ssh") {
|
} else if search.starts_with("ssh") {
|
||||||
(AutoRunType::Ssh, self.ssh.get_elements(search_opt))
|
(AutoRunType::Ssh, self.ssh.get_elements(search_opt))
|
||||||
} else if search.starts_with("emoji") {
|
|
||||||
(AutoRunType::Emoji, self.emoji.get_elements(search_opt))
|
|
||||||
} else {
|
} else {
|
||||||
return self.default_auto_elements(search_opt);
|
return self.default_auto_elements(search_opt);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue