remove viewport control from renderable trait

This is now handled 100% by the gui layer
This commit is contained in:
Wez Furlong committed 2020-01-05 14:37:17 -08:00
1 parent d8701dc771
commit ed97a56055
3 files changed
+3 -15

No files matched your search

+1 -7
View File
@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
use std::borrow::Cow;
use std::ops::Range;
use std::sync::Arc;
use term::{Line, StableRowIndex, Terminal, TerminalState, VisibleRowIndex};
use term::{Line, StableRowIndex, Terminal, TerminalState};
use termwiz::hyperlink::Hyperlink;
/// Describes the location of the cursor
@@ -72,8 +72,6 @@ pub trait Renderable: Downcast {
/// Returns render related dimensions
fn get_dimensions(&self) -> RenderableDimensions;
fn set_viewport_position(&mut self, position: VisibleRowIndex);
}
impl_downcast!(Renderable);
@@ -136,8 +134,4 @@ impl Renderable for Terminal {
fn has_dirty_lines(&self) -> bool {
TerminalState::has_dirty_lines(self)
}
fn set_viewport_position(&mut self, position: VisibleRowIndex) {
self.set_scroll_viewport(position);
}
}
+1 -3
View File
@@ -24,7 +24,7 @@ use term::color::ColorPalette;
use term::selection::SelectionRange;
use term::{
Clipboard, KeyCode, KeyModifiers, Line, MouseButton, MouseEvent, MouseEventKind,
StableRowIndex, TerminalHost, VisibleRowIndex,
StableRowIndex, TerminalHost,
};
use termwiz::hyperlink::Hyperlink;
use termwiz::input::KeyEvent;
@@ -481,8 +481,6 @@ impl Renderable for RenderableState {
scrollback_top: 0,
}
}
fn set_viewport_position(&mut self, _: VisibleRowIndex) {}
}
struct TabWriter {
+1 -5
View File
@@ -26,9 +26,7 @@ use std::sync::{Arc, Mutex};
use std::time::Duration;
use term::color::ColorPalette;
use term::selection::SelectionRange;
use term::{
KeyCode, KeyModifiers, Line, MouseEvent, StableRowIndex, TerminalHost, VisibleRowIndex,
};
use term::{KeyCode, KeyModifiers, Line, MouseEvent, StableRowIndex, TerminalHost};
use termwiz::hyperlink::Hyperlink;
use termwiz::input::{InputEvent, KeyEvent};
use termwiz::lineedit::*;
@@ -166,8 +164,6 @@ impl Renderable for RenderableState {
scrollback_top: 0,
}
}
fn set_viewport_position(&mut self, _: VisibleRowIndex) {}
}
struct TermWizTerminalDomain {