Skip to content

Commit

Permalink
update listview.d
Browse files Browse the repository at this point in the history
  • Loading branch information
ZILtoid1991 committed Jul 24, 2023
1 parent 034f2ea commit a7e8baf
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -544,13 +544,18 @@ public class ListView : WindowElement, ElementContainer, TextInputListener {
return null;
return item;
}
public void moveEntry(size_t index, size_t at) {
/**
* Moves the entry to the given position.
* Params:
* index: the entry to be moved.
* target: the position to be moved to.
*/
public void moveEntry(size_t index, size_t target) {
ListViewItem[] backup = entries[0..index - 1] ~ entries[index..$];
entries = backup[0..at] ~ entries[index] ~ backup[at..$];
entries = backup[0..target] ~ entries[index] ~ backup[target..$];
}
/**
*
* Returns:
* Returns the current x and y scroll positions.
*/
public int[2] scroll() {
int[2] result;
Expand All @@ -561,10 +566,7 @@ public class ListView : WindowElement, ElementContainer, TextInputListener {
return result;
}
/**
*
* Params:
* pos =
* Returns:
* Sets the scrolling to `pos`, then returns the new scrolling positions.
*/
public int[2] scroll(int[2] pos) {
if (horizSlider !is null)
Expand Down

0 comments on commit a7e8baf

Please sign in to comment.