Fixed resize bugs in event view, torrent detail and preferences(also made it actually handle resizing)
This commit is contained in:
parent
18091c5ad6
commit
9152d322ac
|
@ -95,6 +95,15 @@ class EventView(BaseMode):
|
|||
self.stdscr.noutrefresh()
|
||||
curses.doupdate()
|
||||
|
||||
def on_resize(self, *args):
|
||||
BaseMode.on_resize_norefresh(self, *args)
|
||||
|
||||
#Always refresh Legacy(it will also refresh AllTorrents), otherwise it will bug deluge out
|
||||
legacy = component.get("LegacyUI")
|
||||
legacy.on_resize(*args)
|
||||
self.stdscr.erase()
|
||||
self.refresh()
|
||||
|
||||
def back_to_overview(self):
|
||||
self.stdscr.erase()
|
||||
component.get("ConsoleUI").set_mode(self.parent_mode)
|
||||
|
|
|
@ -129,6 +129,12 @@ class Preferences(BaseMode):
|
|||
BaseMode.__init__(self, stdscr, encoding, False)
|
||||
|
||||
# create the panes
|
||||
self.__calc_sizes()
|
||||
|
||||
self.action_input = SelectInput(self,None,None,["Cancel","Apply","OK"],[0,1,2],0)
|
||||
self.refresh()
|
||||
|
||||
def __calc_sizes(self):
|
||||
self.prefs_width = self.cols-self.div_off-1
|
||||
self.prefs_height = self.rows-4
|
||||
self.panes = [
|
||||
|
@ -144,9 +150,6 @@ class Preferences(BaseMode):
|
|||
CachePane(self.div_off+2, self, self.prefs_width)
|
||||
]
|
||||
|
||||
self.action_input = SelectInput(self,None,None,["Cancel","Apply","OK"],[0,1,2],0)
|
||||
self.refresh()
|
||||
|
||||
def __draw_catetories(self):
|
||||
for i,category in enumerate(self.categories):
|
||||
if i == self.cur_cat and self.active_zone == ZONE.CATEGORIES:
|
||||
|
@ -165,6 +168,16 @@ class Preferences(BaseMode):
|
|||
self.stdscr.hline(self.rows-3,self.div_off+1,"_",self.cols)
|
||||
self.action_input.render(self.stdscr,self.rows-2,self.cols,selected,self.cols-22)
|
||||
|
||||
def on_resize(self, *args):
|
||||
BaseMode.on_resize_norefresh(self, *args)
|
||||
self.__calc_sizes()
|
||||
|
||||
#Always refresh Legacy(it will also refresh AllTorrents), otherwise it will bug deluge out
|
||||
legacy = component.get("LegacyUI")
|
||||
legacy.on_resize(*args)
|
||||
self.stdscr.erase()
|
||||
self.refresh()
|
||||
|
||||
def refresh(self):
|
||||
if self.popup == None and self.messages:
|
||||
title,msg = self.messages.popleft()
|
||||
|
|
|
@ -371,6 +371,11 @@ class TorrentDetail(BaseMode, component.Component):
|
|||
|
||||
def on_resize(self, *args):
|
||||
BaseMode.on_resize_norefresh(self, *args)
|
||||
|
||||
#Always refresh Legacy(it will also refresh AllTorrents), otherwise it will bug deluge out
|
||||
legacy = component.get("LegacyUI")
|
||||
legacy.on_resize(*args)
|
||||
|
||||
self.__update_columns()
|
||||
self.__split_help()
|
||||
if self.popup:
|
||||
|
|
Loading…
Reference in New Issue