mirror of https://github.com/helix-editor/helix
undo-picker-preview-ratio-change
parent
fe959c80ca
commit
e63f01694b
|
@ -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 | | |
|
||||
// | | | |
|
||||
// +---------+ +-------------+
|
||||
// +---------+ +---------+
|
||||
// |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
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue