mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-02-25 01:19:57 -05:00
Added fullscreen mode to browser and conversations
This commit is contained in:
parent
3c7b8511d7
commit
726ee8873e
@ -23,6 +23,8 @@ class BrowserFrame(urwid.Frame):
|
||||
self.delegate.url_dialog()
|
||||
elif key == "ctrl s":
|
||||
self.delegate.save_node_dialog()
|
||||
elif key == "ctrl g":
|
||||
nomadnet.NomadNetworkApp.get_shared_instance().ui.main_display.sub_displays.network_display.toggle_fullscreen()
|
||||
elif self.get_focus() == "body":
|
||||
return super(BrowserFrame, self).keypress(size, key)
|
||||
# if key == "up" and self.delegate.messagelist.top_is_visible:
|
||||
|
@ -32,6 +32,8 @@ class ConversationsArea(urwid.LineBox):
|
||||
self.delegate.new_conversation()
|
||||
elif key == "ctrl r":
|
||||
self.delegate.sync_conversations()
|
||||
elif key == "ctrl g":
|
||||
self.delegate.toggle_fullscreen()
|
||||
elif key == "tab":
|
||||
self.delegate.app.ui.main_display.frame.set_focus("header")
|
||||
elif key == "up" and (self.delegate.ilb.first_item_is_selected() or self.delegate.ilb.body_is_empty()):
|
||||
@ -332,6 +334,15 @@ class ConversationsDisplay():
|
||||
conversation = ConversationsDisplay.cached_conversation_widgets[source_hash]
|
||||
self.close_conversation(conversation)
|
||||
|
||||
def toggle_fullscreen(self):
|
||||
if ConversationsDisplay.given_list_width != 0:
|
||||
self.saved_list_width = ConversationsDisplay.given_list_width
|
||||
ConversationsDisplay.given_list_width = 0
|
||||
else:
|
||||
ConversationsDisplay.given_list_width = self.saved_list_width
|
||||
|
||||
self.update_conversation_list()
|
||||
|
||||
def sync_conversations(self):
|
||||
g = self.app.ui.glyphs
|
||||
self.dialog_open = True
|
||||
@ -790,6 +801,8 @@ class ConversationWidget(urwid.WidgetWrap):
|
||||
self.toggle_editor()
|
||||
elif key == "ctrl x":
|
||||
self.clear_history_dialog()
|
||||
elif key == "ctrl g":
|
||||
nomadnet.NomadNetworkApp.get_shared_instance().ui.main_display.sub_displays.conversations_display.toggle_fullscreen()
|
||||
elif key == "ctrl o":
|
||||
self.sort_by_timestamp ^= True
|
||||
self.conversation_changed(None)
|
||||
|
@ -213,6 +213,7 @@ The different sections of the program has a number of keyboard shortcuts mapped,
|
||||
- Ctrl-O Toggle sort mode
|
||||
- Ctrl-P Purge failed messages
|
||||
- Ctrl-X Clear conversation history
|
||||
- Ctrl-G Toggle fullscreen conversation
|
||||
- Ctrl-W Close conversation
|
||||
|
||||
>>`!Network Window`!
|
||||
@ -232,7 +233,7 @@ The different sections of the program has a number of keyboard shortcuts mapped,
|
||||
- Ctrl-R Reload page
|
||||
- Ctrl-U Open URL entry dialog
|
||||
- Ctrl-S Save connected node
|
||||
- Ctrl-L Toggle fullscreen browser window
|
||||
- Ctrl-G Toggle fullscreen browser window
|
||||
- Ctrl-W Disconnect from node
|
||||
'''
|
||||
|
||||
|
@ -1275,6 +1275,8 @@ class NetworkLeftPile(urwid.Pile):
|
||||
def keypress(self, size, key):
|
||||
if key == "ctrl l":
|
||||
self.parent.toggle_list()
|
||||
elif key == "ctrl g":
|
||||
self.parent.toggle_fullscreen()
|
||||
elif key == "ctrl e":
|
||||
self.parent.selected_node_info()
|
||||
elif key == "ctrl p":
|
||||
@ -1349,6 +1351,16 @@ class NetworkDisplay():
|
||||
self.left_pile.contents[0] = (self.known_nodes_display, options)
|
||||
self.list_display = 1
|
||||
|
||||
def toggle_fullscreen(self):
|
||||
if NetworkDisplay.given_list_width != 0:
|
||||
self.saved_list_width = NetworkDisplay.given_list_width
|
||||
NetworkDisplay.given_list_width = 0
|
||||
else:
|
||||
NetworkDisplay.given_list_width = self.saved_list_width
|
||||
|
||||
options = self.widget.options("given", NetworkDisplay.given_list_width)
|
||||
self.widget.contents[0] = (self.left_area, options)
|
||||
|
||||
def show_peers(self):
|
||||
options = self.left_pile.options(height_type="weight", height_amount=1)
|
||||
self.left_pile.contents[0] = (self.lxmf_peers_display, options)
|
||||
|
Loading…
x
Reference in New Issue
Block a user