Hide file category in charset font selector. - icy_draw - icy_draw is the successor to mystic draw. fork / mirror
(HTM) git clone https://git.drkhsh.at/icy_draw.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 37c80c3e1a3fc2e61354b8e262e34ddd05f71534
(DIR) parent 872058633f51f7209c02d1e0431b454a0add027e
(HTM) Author: Mike Krüger <mkrueger@posteo.de>
Date: Mon, 2 Oct 2023 12:05:09 +0200
Hide file category in charset font selector.
Diffstat:
M src/ui/dialogs/font_selector.rs | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/src/ui/dialogs/font_selector.rs b/src/ui/dialogs/font_selector.rs
@@ -28,6 +28,7 @@ pub struct FontSelector {
show_builtin: bool,
show_library: bool,
show_file: bool,
+ has_file:bool,
show_sauce: bool,
should_add: bool,
@@ -138,6 +139,7 @@ impl FontSelector {
show_builtin: true,
show_library: true,
show_file: true,
+ has_file: true,
show_sauce: true,
edit_selected_font: false,
should_add,
@@ -211,6 +213,7 @@ impl FontSelector {
show_builtin: true,
show_library: true,
show_file: true,
+ has_file: false,
show_sauce: true,
edit_selected_font: false,
should_add: false,
@@ -436,9 +439,11 @@ impl crate::ModalDialog for FontSelector {
self.show_library = !self.show_library;
}
- let response = ui.selectable_label(self.show_file, fl!(crate::LANGUAGE_LOADER, "font_selector-file_font"));
- if response.clicked() {
- self.show_file = !self.show_file;
+ if self.has_file {
+ let response = ui.selectable_label(self.show_file, fl!(crate::LANGUAGE_LOADER, "font_selector-file_font"));
+ if response.clicked() {
+ self.show_file = !self.show_file;
+ }
}
let response = ui.selectable_label(self.show_builtin, fl!(crate::LANGUAGE_LOADER, "font_selector-ansi_font"));