Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature added, move-column-left-or-monitor-left and move-column-right… #528

Merged
merged 6 commits into from
Jul 10, 2024

Conversation

brainlessbitch
Copy link
Contributor

@brainlessbitch brainlessbitch commented Jul 7, 2024

feature added, move-column-left-or-monitor-left and move-column-right-or-monitor-right

based on #456

src/input/mod.rs Outdated Show resolved Hide resolved
@SalmanFarooqShiekh
Copy link
Contributor

SalmanFarooqShiekh commented Jul 7, 2024

Shouldn't the action name be move-column-{left,right}-or-to-monitor-{left,right} similar to move-window-{up,down}-or-to-workspace-{up,down}?

@SalmanFarooqShiekh
Copy link
Contributor

Will you also do move-window-{up,down}-or-to-monitor-{up,down} similar to https://github.com/YaLTeR/niri/pull/497/files?

@brainlessbitch
Copy link
Contributor Author

prob not, it's not personally useful to me, and i don't even know if i implemented this right

Copy link
Owner

@YaLTeR YaLTeR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost good to go, just some grammatical renames and a condition fix.

Comment on lines 980 to 981
MoveColumnLeftOrMonitorLeft,
MoveColumnRightOrMonitorRight,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MoveColumnLeftOrMonitorLeft,
MoveColumnRightOrMonitorRight,
MoveColumnLeftOrToMonitorLeft,
MoveColumnRightOrToMonitorRight,

For grammar and consistency sake (like i.e. MoveWindowDownOrToWorkspaceDown)

Comment on lines 155 to 158
/// Move the focused column to the left or to the left monitor
MoveColumnLeftOrMonitorLeft,
/// Move the focused column to the right or to the right monitor
MoveColumnRightOrMonitorRight,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Move the focused column to the left or to the left monitor
MoveColumnLeftOrMonitorLeft,
/// Move the focused column to the right or to the right monitor
MoveColumnRightOrMonitorRight,
/// Move the focused column to the left or to the monitor to the left.
MoveColumnLeftOrToMonitorLeft,
/// Move the focused column to the right or to the monitor to the right.
MoveColumnRightOrToMonitorRight,
@@ -1196,6 +1196,36 @@ impl<W: LayoutElement> Layout<W> {
monitor.move_column_to_last();
}

pub fn move_column_left_or_output(&mut self, output: &OutputId) -> bool {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub fn move_column_left_or_output(&mut self, output: &OutputId) -> bool {
pub fn move_column_left_or_to_output(&mut self, output: &Output) -> bool {

These should accept &Output not &OutputId.

let workspace = monitor.active_workspace();
let curr_idx = workspace.active_column_idx;

if !workspace.columns.is_empty() && curr_idx != 0 {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if !workspace.columns.is_empty() && curr_idx != 0 {
if !workspace.columns.is_empty() && curr_idx != workspace.columns.len() - 1 {
Comment on lines 2830 to 2831
MoveColumnLeftOrMonitorLeft(#[proptest(strategy = "1..=2u8")] u8),
MoveColumnRightOrMonitorRight(#[proptest(strategy = "1..=2u8")] u8),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MoveColumnLeftOrMonitorLeft(#[proptest(strategy = "1..=2u8")] u8),
MoveColumnRightOrMonitorRight(#[proptest(strategy = "1..=2u8")] u8),
MoveColumnLeftOrToMonitorLeft(#[proptest(strategy = "1..=2u8")] u8),
MoveColumnRightOrToMonitorRight(#[proptest(strategy = "1..=2u8")] u8),
@brainlessbitch
Copy link
Contributor Author

@YaLTeR, added your fixes, should be ready now

@brainlessbitch brainlessbitch marked this pull request as ready for review July 8, 2024 20:54
@YaLTeR
Copy link
Owner

YaLTeR commented Jul 9, 2024

Looks like you've changed the lines that I commented about but not the other lines that depend on them, or the same name used elsewhere

@brainlessbitch
Copy link
Contributor Author

oh yea, sorry

Copy link
Owner

@YaLTeR YaLTeR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@YaLTeR YaLTeR enabled auto-merge (squash) July 10, 2024 04:37
@YaLTeR YaLTeR merged commit a283c34 into YaLTeR:main Jul 10, 2024
8 checks passed
@YaLTeR
Copy link
Owner

YaLTeR commented Jul 10, 2024

Thanks

@brainlessbitch brainlessbitch deleted the feat branch July 16, 2024 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants