mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-29 06:20:28 +08:00
lib: Remove name from widget
This commit is contained in:
@@ -86,10 +86,6 @@ impl<'a> Widget<State, Action> for ListPage<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"list-page"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: termion::event::Key) {
|
||||
if self.props.show_search {
|
||||
<Search as Widget<State, Action>>::handle_key_event(&mut self.search, key)
|
||||
@@ -292,10 +288,6 @@ impl Widget<State, Action> for Notifications {
|
||||
}
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"notifications"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: Key) {
|
||||
match key {
|
||||
Key::Char('\n') => {
|
||||
@@ -517,10 +509,6 @@ impl Widget<State, Action> for Search {
|
||||
Self { input, ..self }
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"filter-popup"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: termion::event::Key) {
|
||||
match key {
|
||||
Key::Esc => {
|
||||
@@ -742,10 +730,6 @@ impl<'a> Widget<State, Action> for Help<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"help"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: termion::event::Key) {
|
||||
let len = self.props.content.lines.len() + 1;
|
||||
let page_size = self.props.page_size;
|
||||
|
||||
@@ -87,10 +87,6 @@ impl<'a> Widget<State, Action> for ListPage<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"list-page"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: termion::event::Key) {
|
||||
if self.props.show_search {
|
||||
<Search as Widget<State, Action>>::handle_key_event(&mut self.search, key)
|
||||
@@ -299,10 +295,6 @@ impl Widget<State, Action> for Issues {
|
||||
}
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"issues"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: Key) {
|
||||
match key {
|
||||
Key::Char('\n') => {
|
||||
@@ -539,10 +531,6 @@ impl Widget<State, Action> for Search {
|
||||
Self { input, ..self }
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"filter-popup"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: termion::event::Key) {
|
||||
match key {
|
||||
Key::Esc => {
|
||||
@@ -764,10 +752,6 @@ impl<'a> Widget<State, Action> for Help<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"help"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: termion::event::Key) {
|
||||
let len = self.props.content.lines.len() + 1;
|
||||
let page_size = self.props.page_size;
|
||||
|
||||
@@ -89,10 +89,6 @@ impl<'a> Widget<State, Action> for ListPage<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"list-page"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: termion::event::Key) {
|
||||
if self.props.show_search {
|
||||
<Search as Widget<State, Action>>::handle_key_event(&mut self.search, key)
|
||||
@@ -301,10 +297,6 @@ impl Widget<State, Action> for Patches {
|
||||
}
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"patches"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: Key) {
|
||||
match key {
|
||||
Key::Char('\n') => {
|
||||
@@ -568,10 +560,6 @@ impl Widget<State, Action> for Search {
|
||||
Self { input, ..self }
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"filter-popup"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: termion::event::Key) {
|
||||
match key {
|
||||
Key::Esc => {
|
||||
@@ -801,10 +789,6 @@ impl<'a> Widget<State, Action> for Help<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"help"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: termion::event::Key) {
|
||||
let len = self.props.content.lines.len() + 1;
|
||||
let page_size = self.props.page_size;
|
||||
|
||||
@@ -24,8 +24,6 @@ pub trait Widget<S, A> {
|
||||
where
|
||||
Self: Sized;
|
||||
|
||||
fn name(&self) -> &str;
|
||||
|
||||
fn handle_key_event(&mut self, key: Key);
|
||||
}
|
||||
|
||||
@@ -78,10 +76,6 @@ impl<S, A> Widget<S, A> for Shortcuts<A> {
|
||||
Self { ..self }
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"shortcuts"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, _key: termion::event::Key) {}
|
||||
}
|
||||
|
||||
@@ -326,10 +320,6 @@ where
|
||||
me
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"table"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: Key) {
|
||||
match key {
|
||||
Key::Up | Key::Char('k') => {
|
||||
|
||||
@@ -44,10 +44,6 @@ impl<S, A> Widget<S, A> for Footer<A> {
|
||||
Self { ..self }
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"footer"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, _key: Key) {}
|
||||
}
|
||||
|
||||
@@ -135,10 +131,6 @@ impl<S, A> Widget<S, A> for Header<A> {
|
||||
Self { ..self }
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"footer"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, _key: Key) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,10 +96,6 @@ impl<S, A> Widget<S, A> for TextField {
|
||||
Self { ..self }
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"Input Box"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, key: Key) {
|
||||
match key {
|
||||
Key::Char(to_insert)
|
||||
|
||||
@@ -111,10 +111,6 @@ impl<S, A> Widget<S, A> for Paragraph<A> {
|
||||
Self { ..self }
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"paragraph"
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, _key: Key) {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user