-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite the
files
app, no redesign though
The code was horror incarnate. In its defense, it was a proof of concept both for a file explorer with the (at the time) new ext2 support, and for inheritance of widgets by using: typedef struct folder_view_t { vbox_t vbox; // Not `widget_t widget;` ...; } folder_view_t; But it clearly didn't work well, giving way to terrible code. Better to include a vbox as another member and call its functions from the outer callbacks. There's one thing still in the air: the clicked callback from the inner vbox's entries has no direct access to the `folder_view_t`: its parent is the vbox, and the vbox's parent can't be the folder view, or it messes up global coordinates calculation when drawing time comes. So, what I've done here is make use of `widget_t::data` to keep a reference to the folder view in each vbox entry. The primary reason why I looked at this though was because it crash since the big `list_t` changes. Those new lists have one caveat, it's that the pointer to the list's head can't change, so no copy allowed, unless the list's empty, then you can copy if you reset the list with `LIST_HEAD_INIT`... which is what I did here.
- Loading branch information
Showing
1 changed file
with
54 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters