Projects STRLCPY alacritty Commits f409f743
🤬
  • Resize the window by cell dimensions

    This should resize window by cell dimensions granularity instead of
    using pixels.
    
    Fixes #388.
  • Loading...
  • Kirill Chibisov committed with GitHub 1 year ago
    f409f743
    1 parent 8a838710
  • ■ ■ ■ ■ ■
    CHANGELOG.md
    skipped 22 lines
    23 23  - `window.decorations_theme_variant` could now control theme on macOS and Windows
    24 24  - The IME purpose is now set to `Terminal` which could help with OSK
    25 25  - `window.decorations_theme_variant` is now using `Dark`, `Light`, and `None` values
     26 +- Resize increments are now set on macOS and X11 to resize by cell sizes
    26 27   
    27 28  ### Fixed
    28 29   
    skipped 1089 lines
  • ■ ■ ■ ■ ■ ■
    alacritty/src/display/mod.rs
    skipped 468 lines
    469 469   renderer.finish();
    470 470   }
    471 471   
     472 + // Set resize increments for the newly created window.
     473 + window.set_resize_increments(PhysicalSize::new(cell_width, cell_height));
     474 + 
    472 475   window.set_visible(true);
    473 476   
    474 477   #[allow(clippy::single_match)]
    skipped 166 lines
    641 644   let message_bar_lines = message_buffer.message().map_or(0, |m| m.text(&new_size).len());
    642 645   let search_lines = usize::from(search_active);
    643 646   new_size.reserve_lines(message_bar_lines + search_lines);
     647 + 
     648 + // Update resize increments.
     649 + self.window.set_resize_increments(PhysicalSize::new(cell_width, cell_height));
    644 650   
    645 651   // Resize PTY.
    646 652   pty_resize_handle.on_resize(new_size.into());
    skipped 996 lines
  • ■ ■ ■ ■ ■ ■
    alacritty/src/display/window.rs
    skipped 352 lines
    353 353   self.window.set_minimized(minimized);
    354 354   }
    355 355   
     356 + pub fn set_resize_increments(&self, increments: PhysicalSize<f32>) {
     357 + self.window.set_resize_increments(Some(increments));
     358 + }
     359 + 
    356 360   /// Toggle the window's fullscreen state.
    357 361   pub fn toggle_fullscreen(&self) {
    358 362   self.set_fullscreen(self.window.fullscreen().is_none());
    skipped 120 lines
Please wait...
Page is in error, reload to recover