Comments (11)
I agree, makes sense. Would be nice if a on_pane_changed() was there though it might be overkill if we can't find more use-cases for this.
from statusbarextended.
@mherrmann so it ends up in your notifications (previous autocorrected to your twitter).
from statusbarextended.
Okay, that's the way I'll implement it then. I've created a card so I don't forget.
from statusbarextended.
This is most probably an issue with the on_path_changed() not being fired by fman core itself. Should probably report the issue there.
from statusbarextended.
But the tab button shouldn't trigger on_path_changed()
because it doesn't actually change path, it just moves the cursor to the other pane, so there's nothing wrong with on_path_changed()
per se.
I just need a method to hook into (like I did on toggle_selection()), I looked through the core plugin but I couldn't find any methods for changing cursor pane, only "MoveCursorDown/Up" etc (and I guess it would be overkill to refresh statusbar on every cursor movement in the same pane).
I'll tag @mherrmann and maybe he can give us a hint
from statusbarextended.
I can see the need for this. What would be most logical to me would be an on_pane_activated
event. What do you guys think?
from statusbarextended.
on_pane_activated suggest you subscribe to both panes (guessing by the API naming). Or did you mean to fire with the activated pane ID in the args and is the API name a bit confusing.
I can think of two situations:
- You want to know when a specific pane is activated; this would suggest on_pane_actived.
- You just want to refresh something when a pane is switched. In this case it might be easier to have something like on_active_pane_changed(id).
Of course on_pane_activated(id) could be your intention but I was misinterpreting the API.
from statusbarextended.
Actually, on_activated
would be a better name for what I mean. Maybe that already clarifies what you now asked @bastijnv.
I would make on_activated
similar to on_path_changed
. Say you have:
class Foo(DirectoryPaneListener):
def on_path_changed(self):
pass
def on_activated(self):
pass
When there are two panes (the default), there would be two instances of Foo
. When one pane's path changes, on_path_changed
is called on that instance. When the user presses TAB so the other pane becomes active, that other Foo instance's on_activated
method is called.
Does that make sense?
from statusbarextended.
on_pane_activated
or on_activated
or whatever is perfect. Once that is fired we can simply do self.pane.id
to get the current pane :)
from statusbarextended.
What do you think of on_activated
@bastijnv ?
from statusbarextended.
That would work. Generic so it could also be reused for other elements in the future.
Thanks @m_herrmann.
from statusbarextended.
Related Issues (15)
- Updating upon toggling HOT 1
- Formatting suggestions HOT 1
- Doesn't seem to be working on my end HOT 1
- Register as an fman's plugin HOT 4
- Exception raised when reading filesize on file with no access
- F3 key is NC saved key for "Preview" HOT 1
- Squigly brackets in filename cause an error HOT 5
- Display size when selecting files/directories
- Performance problem refreshing both panes HOT 1
- Progress bar for IO operations
- Refresh statusbar when toggling Show/Hide hidden files
- Responsive/prettier statusbar HOT 1
- IndexError when opening fman if left pane is currently on show drives
- Unable to resize when plugin enabled HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from statusbarextended.