mirror of
https://github.com/zaphar/sheetsui.git
synced 2025-07-22 04:39:48 -04:00
wip: different keybinds for bold and italic
This commit is contained in:
parent
4623a911f4
commit
621c35d7c4
Binary file not shown.
@ -669,12 +669,12 @@ impl<'ws> Workspace<'ws> {
|
||||
self.state.reset_n_prefix();
|
||||
self.state.char_queue.clear();
|
||||
}
|
||||
KeyCode::Char('b') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
KeyCode::Char('B') => {
|
||||
let address = self.book.location.clone();
|
||||
let style = self.book.get_cell_style(self.book.current_sheet, &address).map(|s| s.font.b);
|
||||
self.toggle_bool_style(style, "font.b", &address)?;
|
||||
}
|
||||
KeyCode::Char('i') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
KeyCode::Char('I') => {
|
||||
let address = self.book.location.clone();
|
||||
let style = self.book.get_cell_style(self.book.current_sheet, &address).map(|s| s.font.i);
|
||||
self.toggle_bool_style(style, "font.i", &address)?;
|
||||
|
@ -1291,7 +1291,7 @@ fn test_bold_text() {
|
||||
.expect("Failed to get style");
|
||||
assert!(!before_style.font.b);
|
||||
script()
|
||||
.ctrl('b')
|
||||
.char('B')
|
||||
.run(&mut ws)
|
||||
.expect("Unable to run script");
|
||||
let style = ws
|
||||
@ -1300,7 +1300,7 @@ fn test_bold_text() {
|
||||
.expect("Failed to get style");
|
||||
assert!(style.font.b);
|
||||
script()
|
||||
.ctrl('b')
|
||||
.char('B')
|
||||
.run(&mut ws)
|
||||
.expect("Unable to run script");
|
||||
assert!(!before_style.font.b);
|
||||
@ -1315,7 +1315,7 @@ fn test_italic_text() {
|
||||
.expect("Failed to get style");
|
||||
assert!(!before_style.font.i);
|
||||
script()
|
||||
.ctrl('i')
|
||||
.char('I')
|
||||
.run(&mut ws)
|
||||
.expect("Unable to run script");
|
||||
let style = ws
|
||||
@ -1324,7 +1324,7 @@ fn test_italic_text() {
|
||||
.expect("Failed to get style");
|
||||
assert!(style.font.i);
|
||||
script()
|
||||
.ctrl('i')
|
||||
.char('I')
|
||||
.run(&mut ws)
|
||||
.expect("Unable to run script");
|
||||
assert!(!before_style.font.i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user