mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 19:21:38 +02:00
Redraw progress bar on resize
This commit is contained in:
@@ -18,7 +18,7 @@ from kitty.file_transmission import (
|
|||||||
IdentityDecompressor, NameReprEnum, TransmissionType, ZlibDecompressor,
|
IdentityDecompressor, NameReprEnum, TransmissionType, ZlibDecompressor,
|
||||||
encode_bypass, split_for_transfer
|
encode_bypass, split_for_transfer
|
||||||
)
|
)
|
||||||
from kitty.typing import KeyEventType
|
from kitty.typing import KeyEventType, ScreenSize
|
||||||
from kitty.utils import sanitize_control_codes
|
from kitty.utils import sanitize_control_codes
|
||||||
|
|
||||||
from ..tui.handler import Handler
|
from ..tui.handler import Handler
|
||||||
@@ -619,6 +619,11 @@ class Receive(Handler):
|
|||||||
elif self.transmit_iterator is not None:
|
elif self.transmit_iterator is not None:
|
||||||
self.transmit_one()
|
self.transmit_one()
|
||||||
|
|
||||||
|
def on_resize(self, screen_size: ScreenSize) -> None:
|
||||||
|
super().on_resize(screen_size)
|
||||||
|
if self.progress_drawn:
|
||||||
|
self.refresh_progress()
|
||||||
|
|
||||||
|
|
||||||
def receive_main(cli_opts: TransferCLIOptions, args: List[str]) -> None:
|
def receive_main(cli_opts: TransferCLIOptions, args: List[str]) -> None:
|
||||||
dest = ''
|
dest = ''
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ from kitty.file_transmission import (
|
|||||||
Action, Compression, FileTransmissionCommand, FileType, NameReprEnum,
|
Action, Compression, FileTransmissionCommand, FileType, NameReprEnum,
|
||||||
TransmissionType, encode_bypass, split_for_transfer
|
TransmissionType, encode_bypass, split_for_transfer
|
||||||
)
|
)
|
||||||
from kitty.typing import KeyEventType
|
from kitty.typing import KeyEventType, ScreenSize
|
||||||
from kitty.utils import sanitize_control_codes
|
from kitty.utils import sanitize_control_codes
|
||||||
|
|
||||||
from ..tui.handler import Handler
|
from ..tui.handler import Handler
|
||||||
@@ -703,6 +703,11 @@ class Send(Handler):
|
|||||||
self.schedule_progress_update(self.spinner.interval)
|
self.schedule_progress_update(self.spinner.interval)
|
||||||
self.progress_drawn = True
|
self.progress_drawn = True
|
||||||
|
|
||||||
|
def on_resize(self, screen_size: ScreenSize) -> None:
|
||||||
|
super().on_resize(screen_size)
|
||||||
|
if self.progress_drawn:
|
||||||
|
self.refresh_progress()
|
||||||
|
|
||||||
def refresh_progress(self) -> None:
|
def refresh_progress(self) -> None:
|
||||||
if not self.transmit_started:
|
if not self.transmit_started:
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user