undo-picker-preview-ratio-change

pull/12311/head
Salman Farooq 2025-01-02 01:31:27 +05:00
parent fe959c80ca
commit e63f01694b
1 changed files with 7 additions and 7 deletions

View File

@ -934,18 +934,18 @@ impl<T: 'static + Send + Sync, D: 'static + Send + Sync> Picker<T, D> {
impl<I: 'static + Send + Sync, D: 'static + Send + Sync> Component for Picker<I, D> {
fn render(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) {
// +---------+ +-------------+
// +---------+ +---------+
// |prompt | |preview |
// +---------+ | |
// |picker | | |
// | | | |
// +---------+ +-------------+
// +---------+ +---------+
let render_preview =
self.show_preview && self.file_fn.is_some() && area.width > MIN_AREA_WIDTH_FOR_PREVIEW;
let picker_width = if render_preview {
area.width * 3 / 8
area.width / 2
} else {
area.width
};