mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Decrease indentation with shift-tab
This commit is contained in:
@@ -51,6 +51,18 @@ impl std::ops::Sub<usize> for CCursor {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::AddAssign<usize> for CCursor {
|
||||
fn add_assign(&mut self, rhs: usize) {
|
||||
self.index = self.index.saturating_add(rhs);
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::SubAssign<usize> for CCursor {
|
||||
fn sub_assign(&mut self, rhs: usize) {
|
||||
self.index = self.index.saturating_sub(rhs);
|
||||
}
|
||||
}
|
||||
|
||||
/// Row Cursor
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq)]
|
||||
#[cfg_attr(feature = "persistence", derive(serde::Deserialize, serde::Serialize))]
|
||||
|
||||
@@ -127,7 +127,7 @@ impl FontImpl {
|
||||
|
||||
if c == '\t' {
|
||||
if let Some(space) = self.glyph_info(' ') {
|
||||
glyph_info.advance_width = crate::text::TAB_SIZE * space.advance_width;
|
||||
glyph_info.advance_width = crate::text::TAB_SIZE as f32 * space.advance_width;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ mod font;
|
||||
mod fonts;
|
||||
mod galley;
|
||||
|
||||
/// Default size for a `\t` character.
|
||||
pub const TAB_SIZE: f32 = 4.0;
|
||||
/// One `\t` character is this many spaces wide.
|
||||
pub const TAB_SIZE: usize = 4;
|
||||
|
||||
pub use {
|
||||
fonts::{FontDefinitions, FontFamily, Fonts, TextStyle},
|
||||
|
||||
Reference in New Issue
Block a user