-
Notifications
You must be signed in to change notification settings - Fork 92
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
Refresh/reload tab view & search, fix(#146). #441
base: master
Are you sure you want to change the base?
Conversation
@@ -57,6 +57,8 @@ use crate::{ | |||
tab::{self, HeadingOptions, ItemMetadata, Location, Tab, HOVER_DURATION}, | |||
}; | |||
|
|||
static REFRESH_VIEW_DELAY_MS: u64 = 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The delay value was a totally arbitrary decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess in a 60Hz display you need at least 16.6 ms , so you will see at least one frame and more that one in higher refresh rate displays assuming the execution of the rescan of the view contents is instantaneous.
let entity = entity_opt.unwrap_or_else(|| self.tab_model.active()); | ||
if let Some(tab) = self.tab_model.data_mut::<Tab>(entity) { | ||
let location = tab.location.clone(); | ||
tab.set_items(vec![]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially, I set an "empty" value for the given tab and register a delayed callback that will either rescan or search again. Maybe something better could be done here.
I will try to add a new title and perhaps icon for the in between "Loading..." view or something like that. I am not sure where i could find a "Loading..." icon. |
Attaching a new demo with the "Loading..." view, note that for demonstrative purposes the delay in the video was set at 200ms and not 20ms the one that is commited. Demo: refresh-loading-200ms.webm |
Should close F5 key for refreshing the focused folder doesn't work #146
Made an attempt to provide a refresh/reload view functionality and it seems to work but maybe not the best/novel way to do it. I managed to create a refresh-delay animation somehow otherwise the reload functionality would not be able to be noticed, similar to how nautilus at least from a user perspective is doing that.
Demo:
refresh-view.webm