bug: Fix sizing in search and broken tab logic
This commit is contained in:
parent
b32c984843
commit
7d9ad1ee78
10
src/app.rs
10
src/app.rs
|
@ -720,12 +720,12 @@ impl App {
|
|||
|
||||
let is_in_search_widget = self.is_in_search_widget();
|
||||
if !self.is_in_dialog() {
|
||||
if is_in_search_widget {
|
||||
if let Some(proc_widget_state) = self
|
||||
.proc_state
|
||||
.widget_states
|
||||
.get_mut(&(self.current_widget.widget_id - 1))
|
||||
{
|
||||
if is_in_search_widget {
|
||||
if !proc_widget_state.is_grouped {
|
||||
if proc_widget_state.process_search_state.is_searching_with_pid {
|
||||
self.search_with_name();
|
||||
|
@ -733,7 +733,12 @@ impl App {
|
|||
self.search_with_pid();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
} else if let Some(proc_widget_state) = self
|
||||
.proc_state
|
||||
.widget_states
|
||||
.get_mut(&self.current_widget.widget_id)
|
||||
{
|
||||
// Toggles process widget grouping state
|
||||
proc_widget_state.is_grouped = !(proc_widget_state.is_grouped);
|
||||
if proc_widget_state.is_grouped {
|
||||
|
@ -742,7 +747,6 @@ impl App {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// I don't like this, but removing it causes a bunch of breakage.
|
||||
/// Use ``proc_widget_state.is_grouped`` if possible!
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use std::cmp::{max, min};
|
||||
use std::cmp::max;
|
||||
|
||||
use crate::{
|
||||
app::{self, App, ProcWidgetState},
|
||||
|
@ -319,12 +319,14 @@ impl ProcessTableWidget for Painter {
|
|||
|
||||
let is_on_widget = widget_id == app_state.current_widget.widget_id;
|
||||
let num_columns = draw_loc.width as usize;
|
||||
let small_mode = chosen_text.len() != min(num_columns / 2, chosen_text.len());
|
||||
let small_mode = num_columns < 70;
|
||||
let search_title: &str = if !small_mode {
|
||||
chosen_text
|
||||
} else if chosen_text.is_empty() {
|
||||
""
|
||||
} else if proc_widget_state.process_search_state.is_searching_with_pid {
|
||||
} else if proc_widget_state.process_search_state.is_searching_with_pid
|
||||
&& !proc_widget_state.is_grouped
|
||||
{
|
||||
"p> "
|
||||
} else {
|
||||
"n> "
|
||||
|
|
Loading…
Reference in New Issue