Move layout metrics into theme and apply audit cleanups
This commit is contained in:
@@ -10,11 +10,11 @@ use gpui::{
|
||||
SharedString, StatefulInteractiveElement as _, Styled as _, Window, canvas, deferred, div,
|
||||
fill, point, px,
|
||||
};
|
||||
use gpui_native_theme::{ActiveTheme as _, Size};
|
||||
use gpui_native_theme::{ActiveTheme as _, RESIZE_KEYBOARD_STEP, Size};
|
||||
use gpui_native_utils::{focus_handle, focus_ring};
|
||||
|
||||
/// How far one keyboard arrow step moves the seam.
|
||||
const KEYBOARD_STEP: f32 = 32.0;
|
||||
const KEYBOARD_STEP: Pixels = RESIZE_KEYBOARD_STEP;
|
||||
|
||||
type ResizeHandler = Rc<dyn Fn(Pixels, &mut Window, &mut App)>;
|
||||
type ResetHandler = Rc<dyn Fn(&mut Window, &mut App)>;
|
||||
@@ -180,10 +180,10 @@ impl RenderOnce for ResizeHandle {
|
||||
let on_resize = self.on_resize.clone();
|
||||
move |event: &KeyDownEvent, window, cx| {
|
||||
let delta = match (axis, event.keystroke.key.as_str()) {
|
||||
(Axis::Horizontal, "left") => Some(px(-KEYBOARD_STEP)),
|
||||
(Axis::Horizontal, "right") => Some(px(KEYBOARD_STEP)),
|
||||
(Axis::Vertical, "up") => Some(px(-KEYBOARD_STEP)),
|
||||
(Axis::Vertical, "down") => Some(px(KEYBOARD_STEP)),
|
||||
(Axis::Horizontal, "left") => Some(-KEYBOARD_STEP),
|
||||
(Axis::Horizontal, "right") => Some(KEYBOARD_STEP),
|
||||
(Axis::Vertical, "up") => Some(-KEYBOARD_STEP),
|
||||
(Axis::Vertical, "down") => Some(KEYBOARD_STEP),
|
||||
_ => None,
|
||||
};
|
||||
if let Some(delta) = delta {
|
||||
|
||||
Reference in New Issue
Block a user