show file size and name in status bar
This commit is contained in:
7
tabs.py
7
tabs.py
@@ -6,6 +6,7 @@ from PyQt6.QtCore import *
|
||||
from PyQt6.QtGui import *
|
||||
|
||||
from bigtext import BigText
|
||||
from conversion import humanbytes
|
||||
from fulltabwidget import FullTabWidget
|
||||
from logFileModel import LogFileModel
|
||||
from ravenui import RavenUI
|
||||
@@ -55,11 +56,17 @@ class Tabs(QWidget):
|
||||
def _current_tab_changed(self, tab_index: int):
|
||||
full_tab: FullTabWidget = self.tabs.widget(tab_index)
|
||||
if full_tab:
|
||||
# window title
|
||||
file = full_tab.file_view.get_file()
|
||||
file_name = os.path.basename(file)
|
||||
RavenUI.update_window_title(file_name)
|
||||
|
||||
# status bar text
|
||||
status_text = "%s - %s" % (humanbytes(full_tab.file_view.model.byte_count()), file)
|
||||
RavenUI.update_status_bar(status_text)
|
||||
else:
|
||||
RavenUI.update_window_title("")
|
||||
RavenUI.update_status_bar("")
|
||||
|
||||
def _close_tab(self, tab_index: int):
|
||||
full_tab: FullTabWidget = self.tabs.widget(tab_index)
|
||||
|
||||
Reference in New Issue
Block a user