diff --git a/slpkg/views/views.py b/slpkg/views/views.py index 0971a230..4aa1c1e8 100644 --- a/slpkg/views/views.py +++ b/slpkg/views/views.py @@ -53,24 +53,25 @@ class ViewMessage: def draw_title_box(self, message, title): """ Drawing title message. """ + middle_title = int((self.columns / 2) - len(title) + 2) print(f'{self.bgreen}┌' + '─' * (self.columns - 2) + '┐') - print('│' + ' ' * int((self.columns / 2) - len(title) + 2) + f'{title}' + ' ' * 36 + f'│') - print('├' + '─' * (self.columns - 2) + f'┤') + print('│' + ' ' * middle_title + f'{title}' + ' ' * (self.columns - middle_title - len(title) - 2) + f'│') + self.draw_middle_line() print(f'│{self.endc} {message}' + ' ' * (self.columns - len(message) - 3) + f'{self.bgreen}│') - print('├' + '─' * (self.columns - 2) + f'┤{self.endc}') - print(f'{self.bgreen}│{self.endc} Package:' + ' ' * 27 + 'Version:' + ' ' * 29 + f'Size{self.bgreen} │{self.endc}') + self.draw_middle_line() + print(f'{self.bgreen}│{self.endc} Package:' + ' ' * 27 + 'Version:' + ' ' * (self.columns - 51) + f'Size{self.bgreen} │{self.endc}') def draw_middle_line(self): """ Drawing a middle line. """ - print(f'{self.bgreen}├' + '─' * 78 + f'┤{self.endc}') + print(f'{self.bgreen}├' + '─' * (self.columns - 2) + f'┤') def draw_dependency_line(self): """ Drawing the dependencies line. """ - print(f'{self.bgreen}│{self.endc} Dependencies:' + ' ' * 64 + f'{self.bgreen}│{self.endc}') + print(f'{self.bgreen}│{self.endc} Dependencies:' + ' ' * (self.columns - 16) + f'{self.bgreen}│{self.endc}') def view_packages(self, package, version): """ Printing the main packages. """ - print(f'{self.bgreen}│ {self.bcyan}{package}{self.endc}' + ' ' * (35 - len(package)) + f'{version}' + ' ' * (42 - len(version)) + f'{self.bgreen}│{self.endc}') + print(f'{self.bgreen}│ {self.bcyan}{package}{self.endc}' + ' ' * (35 - len(package)) + f'{version}' + ' ' * ((self.columns - 37) - len(version) - 1) + f'{self.bgreen}│{self.endc}') def draw_bottom_line(self): """" Drawing the bottom line. """