summaryrefslogtreecommitdiffstats
path: root/src/config/clean/app/preview/config.rs
diff options
context:
space:
mode:
authorBenjamin Grosse <ste3ls@gmail.com>2024-02-28 00:33:21 +0000
committerGitHub <noreply@github.com>2024-02-27 19:33:21 -0500
commit285df85cdd745a959ddcbe0c2c1f176e28370abe (patch)
tree95bb5f8454eda1c9a6f183f46c07890216baa754 /src/config/clean/app/preview/config.rs
parentf6d1f71d6c11eaebc13ef9f26b06bd31e2275d51 (diff)
ratatui-image widget for image previews without scripts (#467)
_Disclaimer: I'm the author of ratatui-image._ Use [ratatui-image](https://github.com/benjajaja/ratatui-image) crate to render images. No script or hook setup is required.
Diffstat (limited to 'src/config/clean/app/preview/config.rs')
-rw-r--r--src/config/clean/app/preview/config.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/config/clean/app/preview/config.rs b/src/config/clean/app/preview/config.rs
index 2fd50e5..e14407e 100644
--- a/src/config/clean/app/preview/config.rs
+++ b/src/config/clean/app/preview/config.rs
@@ -1,18 +1,18 @@
use std::path;
use crate::{
- config::{raw::app::display::preview::PreviewOptionRaw, search_directories},
+ config::{
+ raw::app::display::preview::{default_max_preview_size, PreviewOptionRaw, PreviewProtocol},
+ search_directories,
+ },
util::unix,
CONFIG_HIERARCHY,
};
-const fn default_max_preview_size() -> u64 {
- 2 * 1024 * 1024 // 2 MB
-}
-
#[derive(Clone, Debug)]
pub struct PreviewOption {
pub max_preview_size: u64,
+ pub preview_protocol: PreviewProtocol,
pub preview_script: Option<path::PathBuf>,
pub preview_shown_hook_script: Option<path::PathBuf>,
pub preview_removed_hook_script: Option<path::PathBuf>,
@@ -22,6 +22,7 @@ impl std::default::Default for PreviewOption {
fn default() -> Self {
Self {
max_preview_size: default_max_preview_size(),
+ preview_protocol: PreviewProtocol::Auto,
preview_script: None,
preview_shown_hook_script: None,
preview_removed_hook_script: None,
@@ -46,6 +47,7 @@ impl From<PreviewOptionRaw> for PreviewOption {
Self {
max_preview_size: raw.max_preview_size,
+ preview_protocol: raw.preview_protocol,
preview_script,
preview_shown_hook_script,
preview_removed_hook_script,