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

Handle terminal resizes #390

Closed
8 tasks
Minoru opened this issue Dec 13, 2018 · 0 comments · Fixed by #1244
Closed
8 tasks

Handle terminal resizes #390

Minoru opened this issue Dec 13, 2018 · 0 comments · Fixed by #1244
Labels
refactoring This issue describes a way in which some particular part of the code could be improved
Milestone

Comments

@Minoru
Copy link
Member

Minoru commented Dec 13, 2018

Our FormAction classes (feedlist, itemview etc.) should react to terminal resizes by redrawing their contents. Feedlist and itemlist already do this, and can be used as examples.

This is a tracking issue for the whole effort.

I think the best way to implement this is:

  1. introduce redraw() method for FormAction, provide empty implementations for all classes that inherit it;

  2. add case OP_INT_RESIZE to FormAction::process_op. It should call this->redraw();

  3. implement redraw() for all classes that inherit from FormAction:

    ListFormAction is absent from this list because from the code in feedlistformaction.cpp and itemlistformaction.cpp it doesn't appear like resizing can be handled in generic way for all lists. Whoever works on this can re-evaluate, though.

@Minoru Minoru added the refactoring This issue describes a way in which some particular part of the code could be improved label Dec 13, 2018
dennisschagt added a commit to dennisschagt/newsboat that referenced this issue Jun 1, 2020
The width was retrieved from stfl with variable name "items:w".
There is no element named "items" in the `feedlist.stfl` file so `width`
would always be equal to 0, resulting in no action on an actual resize.

It is probably best to fix this in a generic way when implementing [0].

[0] newsboat#390
dennisschagt added a commit to dennisschagt/newsboat that referenced this issue Oct 24, 2020
"RESIZE" is the so-called event as returned from stfl (in the same way
as regular key-presses are registered).
So, "RESIZE" should be put in the `default_key` field.

The code which handled OP_INT_RESIZE was never called (before this fix).
Removing it in favor of a more generic approach when implementing the
idea from newsboat#390.
dennisschagt added a commit to dennisschagt/newsboat that referenced this issue Oct 26, 2020
"RESIZE" is the so-called event as returned from stfl (in the same way
as regular key-presses are registered).
So, "RESIZE" should be put in the `default_key` field.

The code which handled OP_INT_RESIZE was never called (before this fix).
Removing it in favor of a more generic approach when implementing the
idea from newsboat#390.
@Minoru Minoru added this to the 2.22 milestone Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring This issue describes a way in which some particular part of the code could be improved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant