Changing pane with TAB doesn't refresh status bar
StatusBarExtended refreshes only upon on_path_changed(). Should refresh when changing pane with TAB button
This is most probably an issue with the on_path_changed() not being fired by fman core itself. Should probably report the issue there.
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
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.
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?
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.
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?
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 :)
What do you think of on_activated @bastijnv ?
That would work. Generic so it could also be reused for other elements in the future.
Thanks @m_herrmann.
@mherrmann so it ends up in your notifications (previous autocorrected to your twitter).
Okay, that's the way I'll implement it then. I've created a card so I don't forget.