Skip to content

Commit

Permalink
feat(ui): laying the groundwork for a new resize algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLostLambda authored Jun 3, 2021
2 parents 24165b6 + a9ce13c commit c65987a
Show file tree
Hide file tree
Showing 34 changed files with 552 additions and 285 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ assets = [

[features]
disable_automatic_asset_installation = []
parametric_resize_beta = []
2 changes: 1 addition & 1 deletion default-plugins/status-bar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl ZellijPlugin for State {
fn load(&mut self) {
set_selectable(false);
set_invisible_borders(true);
set_max_height(2);
set_fixed_height(2);
subscribe(&[EventType::ModeUpdate]);
}

Expand Down
3 changes: 1 addition & 2 deletions default-plugins/tab-bar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl ZellijPlugin for State {
fn load(&mut self) {
set_selectable(false);
set_invisible_borders(true);
set_max_height(1);
set_fixed_height(1);
subscribe(&[EventType::TabUpdate, EventType::ModeUpdate]);
}

Expand Down Expand Up @@ -57,7 +57,6 @@ impl ZellijPlugin for State {
let tab = tab_style(
tabname,
t.active,
t.position,
t.is_sync_panes_active,
self.mode_info.palette,
self.mode_info.capabilities,
Expand Down
1 change: 0 additions & 1 deletion default-plugins/tab-bar/src/tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ pub fn non_active_tab(text: String, palette: Palette, separator: &str) -> LinePa
pub fn tab_style(
text: String,
is_active_tab: bool,
position: usize,
is_sync_panes_active: bool,
palette: Palette,
capabilities: PluginCapabilities,
Expand Down
28 changes: 14 additions & 14 deletions src/tests/integration/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn get_fake_os_input(fake_win_size: &PositionAndSize) -> FakeInputOutput {
#[test]
pub fn starts_with_one_terminal() {
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -48,7 +48,7 @@ pub fn starts_with_one_terminal() {
#[test]
pub fn split_terminals_vertically() {
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -76,7 +76,7 @@ pub fn split_terminals_vertically() {
#[test]
pub fn split_terminals_horizontally() {
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -105,7 +105,7 @@ pub fn split_terminals_horizontally() {
pub fn split_largest_terminal() {
// this finds the largest pane and splits along its longest edge (vertically or horizontally)
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -139,7 +139,7 @@ pub fn split_largest_terminal() {
#[test]
pub fn cannot_split_terminals_vertically_when_active_terminal_is_too_small() {
let fake_win_size = PositionAndSize {
columns: 8,
cols: 8,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -167,7 +167,7 @@ pub fn cannot_split_terminals_vertically_when_active_terminal_is_too_small() {
#[test]
pub fn cannot_split_terminals_horizontally_when_active_terminal_is_too_small() {
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 4,
x: 0,
y: 0,
Expand Down Expand Up @@ -195,7 +195,7 @@ pub fn cannot_split_terminals_horizontally_when_active_terminal_is_too_small() {
#[test]
pub fn cannot_split_largest_terminal_when_there_is_no_room() {
let fake_win_size = PositionAndSize {
columns: 8,
cols: 8,
rows: 4,
x: 0,
y: 0,
Expand Down Expand Up @@ -223,7 +223,7 @@ pub fn cannot_split_largest_terminal_when_there_is_no_room() {
#[test]
pub fn scrolling_up_inside_a_pane() {
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -259,7 +259,7 @@ pub fn scrolling_up_inside_a_pane() {
#[test]
pub fn scrolling_down_inside_a_pane() {
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -297,7 +297,7 @@ pub fn scrolling_down_inside_a_pane() {
#[test]
pub fn scrolling_page_up_inside_a_pane() {
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -332,7 +332,7 @@ pub fn scrolling_page_up_inside_a_pane() {
#[test]
pub fn scrolling_page_down_inside_a_pane() {
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -372,7 +372,7 @@ pub fn max_panes() {
// with the --max-panes option, we only allow a certain amount of panes on screen
// simultaneously, new panes beyond this limit will close older panes on screen
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -409,7 +409,7 @@ pub fn max_panes() {
#[test]
pub fn toggle_focused_pane_fullscreen() {
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -452,7 +452,7 @@ pub fn bracketed_paste() {
// since it's inside a bracketed paste block, while the "QUIT" command is, since it is already
// past the block
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down
26 changes: 13 additions & 13 deletions src/tests/integration/close_pane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn close_pane_with_another_pane_above_it() {
// └───────────┘ └───────────┘
// █ == pane being closed
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -70,7 +70,7 @@ pub fn close_pane_with_another_pane_below_it() {
// └───────────┘ └───────────┘
// █ == pane being closed
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -111,7 +111,7 @@ pub fn close_pane_with_another_pane_to_the_left() {
// └─────┴─────┘ └──────────┘
// █ == pane being closed
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -151,7 +151,7 @@ pub fn close_pane_with_another_pane_to_the_right() {
// └─────┴─────┘ └──────────┘
// █ == pane being closed
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -194,7 +194,7 @@ pub fn close_pane_with_multiple_panes_above_it() {
// └───────────┘ └─────┴─────┘
// █ == pane being closed
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -240,7 +240,7 @@ pub fn close_pane_with_multiple_panes_below_it() {
// └─────┴─────┘ └─────┴─────┘
// █ == pane being closed
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -284,7 +284,7 @@ pub fn close_pane_with_multiple_panes_to_the_left() {
// └─────┴─────┘ └──────────┘
// █ == pane being closed
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -330,7 +330,7 @@ pub fn close_pane_with_multiple_panes_to_the_right() {
// └─────┴─────┘ └──────────┘
// █ == pane being closed
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -374,7 +374,7 @@ pub fn close_pane_with_multiple_panes_above_it_away_from_screen_edges() {
// └───┴───────┴───┘ └───┴───┴───┴───┘
// █ == pane being closed
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -441,7 +441,7 @@ pub fn close_pane_with_multiple_panes_below_it_away_from_screen_edges() {
// └───┴───┴───┴───┘ └───┴───┴───┴───┘
// █ == pane being closed
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down Expand Up @@ -506,7 +506,7 @@ pub fn close_pane_with_multiple_panes_to_the_left_away_from_screen_edges() {
// └────┴──────┘ └────┴──────┘
// █ == pane being closed
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 30,
x: 0,
y: 0,
Expand Down Expand Up @@ -571,7 +571,7 @@ pub fn close_pane_with_multiple_panes_to_the_right_away_from_screen_edges() {
// └────┴──────┘ └────┴──────┘
// █ == pane being closed
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 30,
x: 0,
y: 0,
Expand Down Expand Up @@ -626,7 +626,7 @@ pub fn close_pane_with_multiple_panes_to_the_right_away_from_screen_edges() {
#[test]
pub fn closing_last_pane_exits_app() {
let fake_win_size = PositionAndSize {
columns: 121,
cols: 121,
rows: 20,
x: 0,
y: 0,
Expand Down
Loading

0 comments on commit c65987a

Please sign in to comment.