-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Group message data #1537
base: main
Are you sure you want to change the base?
Group message data #1537
Changes from 2 commits
15a7c86
c734d2a
e316327
9e5036e
9051d4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,7 @@ def __init__( | |
self.notify_enabled = notify | ||
self.maximum_footlinks = maximum_footlinks | ||
self.editor_command = editor_command | ||
self.popup_stack: List[urwid.Widget] = [] | ||
|
||
self.debug_path = debug_path | ||
|
||
|
@@ -226,6 +227,8 @@ def clamp(n: int, minn: int, maxn: int) -> int: | |
return max_popup_cols, max_popup_rows | ||
|
||
def show_pop_up(self, to_show: Any, style: str) -> None: | ||
self.popup_stack.append(self.loop.widget) | ||
|
||
text = urwid.Text(to_show.title, align="center") | ||
title_map = urwid.AttrMap(urwid.Filler(text), style) | ||
title_box_adapter = urwid.BoxAdapter(title_map, height=1) | ||
|
@@ -249,6 +252,10 @@ def is_any_popup_open(self) -> bool: | |
return isinstance(self.loop.widget, urwid.Overlay) | ||
|
||
def exit_popup(self) -> None: | ||
self.loop.widget = self.popup_stack.pop() | ||
|
||
def exit_all_popups(self) -> None: | ||
self.popup_stack.clear() | ||
self.loop.widget = self.view | ||
Comment on lines
254
to
259
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks good, though slightly differently it might be more resilient?
I'm not sure how feasible it is with all the extra code involved in popups, but it would be useful to add some tests involving show/exit/exit_all, and maybe also is_any_popup_open? |
||
|
||
def show_help(self) -> None: | ||
|
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.
Re the commit text for the 'stack' change, my only nit would be re the end of the 'why stack popups' that, we don't need to pass the entire data around... unless we need it :) None of these now do, but as per discussion there are upcoming PRs that will do so.
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.
Ah, is that so? I can't seem to recall that discussion.
The change to the commit text sounds better anyways.
Glad to know that the rest is fine.
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've not rechecked, but was likely referring to Sashank's comment here, where he is expecting this will be necessary for spoilers.
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.
Ah, that's covered by this PR. Won't need to pass around any data for that.