diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2022-05-23 04:13:00 +0000 |
---|---|---|
committer | Sven-Hendrik Haase <svenstaro@gmail.com> | 2022-05-23 04:13:00 +0000 |
commit | fc75c64d9fe519e2788e6e932011478a6c859594 (patch) | |
tree | 38ef618d56a726c8c2a65b2fb774920a0b4b34e8 /src | |
parent | Add configuration `change-theme` (#805) (diff) | |
download | miniserve-fc75c64d9fe519e2788e6e932011478a6c859594.tar.gz miniserve-fc75c64d9fe519e2788e6e932011478a6c859594.zip |
Flip usage of theme selector showing functionality added in last commit
This is so it doesn't break current configurations. Let's not surprise the users.
Diffstat (limited to 'src')
-rw-r--r-- | src/args.rs | 8 | ||||
-rw-r--r-- | src/config.rs | 8 | ||||
-rw-r--r-- | src/renderer.rs | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/args.rs b/src/args.rs index 3ddfe8b..f02efa1 100644 --- a/src/args.rs +++ b/src/args.rs @@ -83,10 +83,6 @@ pub struct CliArgs { #[clap(short = 'H', long = "hidden")] pub hidden: bool, - /// Show theme selector in frontend - #[clap(long = "change-theme")] - pub change_theme: bool, - /// Default color scheme #[clap( short = 'c', @@ -172,6 +168,10 @@ pub struct CliArgs { #[clap(short = 'F', long = "hide-version-footer")] pub hide_version_footer: bool, + /// Hide theme selector + #[clap(long = "hide-theme-selector")] + pub hide_theme_selector: bool, + /// If enabled, display a wget command to recursively download the current directory #[clap(short = 'W', long = "show-wget-footer")] pub show_wget_footer: bool, diff --git a/src/config.rs b/src/config.rs index d81d47e..deec606 100644 --- a/src/config.rs +++ b/src/config.rs @@ -81,9 +81,6 @@ pub struct MiniserveConfig { /// Enable QR code display pub show_qrcode: bool, - /// Show theme selector in frontend - pub show_change_theme: bool, - /// Enable file upload pub file_upload: bool, @@ -117,6 +114,9 @@ pub struct MiniserveConfig { /// If enabled, version footer is hidden pub hide_version_footer: bool, + /// If enabled, theme selector is hidden + pub hide_theme_selector: bool, + /// If enabled, display a wget command to recursively download the current directory pub show_wget_footer: bool, @@ -228,7 +228,6 @@ impl MiniserveConfig { spa: args.spa, overwrite_files: args.overwrite_files, show_qrcode: args.qrcode, - show_change_theme: args.change_theme, file_upload: args.file_upload, uploadable_media_type, tar_enabled: args.enable_tar, @@ -239,6 +238,7 @@ impl MiniserveConfig { header: args.header, show_symlink_info: args.show_symlink_info, hide_version_footer: args.hide_version_footer, + hide_theme_selector: args.hide_theme_selector, show_wget_footer: args.show_wget_footer, tls_rustls_config: tls_rustls_server_config, }) diff --git a/src/renderer.rs b/src/renderer.rs index e2e2efb..6e83108 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -76,7 +76,7 @@ pub fn page( } } } - (color_scheme_selector(conf.show_qrcode, conf.show_change_theme)) + (color_scheme_selector(conf.show_qrcode, conf.hide_theme_selector)) div.container { span #top { } h1.title dir="ltr" { @@ -254,7 +254,7 @@ const THEME_PICKER_CHOICES: &[(&str, &str)] = &[ pub const THEME_SLUGS: &[&str] = &["squirrel", "archlinux", "zenburn", "monokai"]; /// Partial: color scheme selector -fn color_scheme_selector(show_qrcode: bool, show_change_theme: bool) -> Markup { +fn color_scheme_selector(show_qrcode: bool, hide_theme_selector: bool) -> Markup { html! { nav { @if show_qrcode { @@ -267,7 +267,7 @@ fn color_scheme_selector(show_qrcode: bool, show_change_theme: bool) -> Markup { } } } - @if show_change_theme { + @if !hide_theme_selector { div { p { "Change theme..." |