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

support for FileManager in List and Window #38

Merged
merged 2 commits into from Mar 16, 2017

Conversation

Emily
Copy link
Contributor

@Emily Emily commented Mar 6, 2017

List

  • there is now a concept of a selected entry, which will be highlighted
  • up/down changes the current selection rather than scrolling (but will scroll if entry is outside the viewable area)
  • responds to ScrollEvent
  • supports home/end to jump to top and bottom
  • enter simulates a click on the entry

Window

This PR breaks exec up into a few pieces that can be called independently. This allows FileManager to still maintain its own event queue. In the future I'd like to put everything back behind exec, but not at the window level.

Instead I think it would be nice to have an Application which is capable of housing multiple Windows and accepts some sort of callback that allows the application to hook into the application loop. Which would allow behavior like in this FileManager PR (redox-os/orbutils#19), but without the app having to poke at Window in very specific ways.

Copy link

@AyeTbk AyeTbk left a comment

Choose a reason for hiding this comment

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

Small detail about get_entry_index return value. This is not a thorough review.

// drawn at that point.
fn get_entry(&self, p: Point) -> Option<Arc<Entry>> {
fn get_entry_index(&self, p: Point) -> i32 {
Copy link

Choose a reason for hiding this comment

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

This function should probably return an Option<usize> or Option<u32> instead of an i32. Using None instead of -1 to indicate that there is no entry at the given point would be more idiomatic rust, I believe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah definitely.

@Emily
Copy link
Contributor Author

Emily commented Mar 9, 2017

List selection uses Option<u32> now. Also rebased this branch on master.

pub running: Cell<bool>
pub bg: Cell<Color>,
pub running: Cell<bool>,
events: Vec<Event>,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd favor internal mutability (RefCell<Vec<Event>>) over requiring windows to be changed to mutable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally I'd like to get rid of mutability and internal mutability entirely, by moving towards what I describe in the PR description.

@jackpot51
Copy link
Member

Sorry I did not get around to this earlier

@jackpot51 jackpot51 merged commit 2141ba1 into redox-os:master Mar 16, 2017
@Emily Emily deleted the emilydbv/fm branch March 16, 2017 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants