ui: Add NumericStepper component (#13954)

This PR adds a `NumericStepper` component that can be used to display a
numeric value along with controls to increment, decrement, and reset the
value.

The `ApplicationMenu` has been updated to use the `NumericStepper` for
adjusting the buffer and UI font size.

Here it is in action:


https://github.com/zed-industries/zed/assets/1486634/03cffe67-1256-4283-aa3d-560fffa06dad

Note: Due to the way we do font adjustments, once modified the reset
button will be displayed until it is clicked (or the font size
adjustment is otherwise reset). Simply returning to the original value
will currently not hide the reset button.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-07-08 18:45:49 -04:00 committed by GitHub
parent 97f315356d
commit 9e36a66fec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 159 additions and 122 deletions

View file

@ -12,6 +12,7 @@ mod keybinding;
mod label;
mod list;
mod modal;
mod numeric_stepper;
mod popover;
mod popover_menu;
mod radio;
@ -40,6 +41,7 @@ pub use keybinding::*;
pub use label::*;
pub use list::*;
pub use modal::*;
pub use numeric_stepper::*;
pub use popover::*;
pub use popover_menu::*;
pub use radio::*;