settings_ui: Add pickers for theme and icon themes (#40829)
In the process of adding pickers for the theme and icon themes fields in the settings UI, I felt like there was an improvement opportunity in regards to where some of these components are stored. The `ui_input` crate originally was meant only for the text field-like component, which couldn't be in the regular `ui` crate due to the dependency with `editor`. Given we had also added the number field there—which is similar in also having the same dependency—it made sense to think of this crate more like a home for form-like components rather than for only one component. However, we were also storing some settings UI-specific stuff in that crate, which didn't feel right. So I ended up creating a new directory within the `settings_ui` for components and moved all the pickers and the custom input field there. I think this makes it for a cleaner structure. Release Notes: - settings_ui: Added the ability to search for theme and icon themes in their respective fields.
This commit is contained in:
@@ -32,7 +32,7 @@ use ui::{
|
||||
SharedString, Styled as _, Table, TableColumnWidths, TableInteractionState,
|
||||
TableResizeBehavior, Tooltip, Window, prelude::*,
|
||||
};
|
||||
use ui_input::SingleLineInput;
|
||||
use ui_input::InputField;
|
||||
use util::ResultExt;
|
||||
use workspace::{
|
||||
Item, ModalView, SerializableItem, Workspace, notifications::NotifyTaskExt as _,
|
||||
@@ -2114,7 +2114,7 @@ struct KeybindingEditorModal {
|
||||
editing_keybind: ProcessedBinding,
|
||||
editing_keybind_idx: usize,
|
||||
keybind_editor: Entity<KeystrokeInput>,
|
||||
context_editor: Entity<SingleLineInput>,
|
||||
context_editor: Entity<InputField>,
|
||||
action_arguments_editor: Option<Entity<ActionArgumentsEditor>>,
|
||||
fs: Arc<dyn Fs>,
|
||||
error: Option<InputError>,
|
||||
@@ -2148,8 +2148,8 @@ impl KeybindingEditorModal {
|
||||
let keybind_editor = cx
|
||||
.new(|cx| KeystrokeInput::new(editing_keybind.keystrokes().map(Vec::from), window, cx));
|
||||
|
||||
let context_editor: Entity<SingleLineInput> = cx.new(|cx| {
|
||||
let input = SingleLineInput::new(window, cx, "Keybinding Context")
|
||||
let context_editor: Entity<InputField> = cx.new(|cx| {
|
||||
let input = InputField::new(window, cx, "Keybinding Context")
|
||||
.label("Edit Context")
|
||||
.label_size(LabelSize::Default);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user