40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
"""
|
||
Statusleiste am unteren Rand: zeigt Dateiinfo, Bildgröße, Pfadanzahl.
|
||
"""
|
||
from __future__ import annotations
|
||
|
||
from PySide6.QtWidgets import QStatusBar, QLabel
|
||
|
||
|
||
class LogoStatusBar(QStatusBar):
|
||
def __init__(self, parent=None):
|
||
super().__init__(parent)
|
||
self.setStyleSheet("""
|
||
QStatusBar {
|
||
background: #1e1e1e;
|
||
color: #888;
|
||
border-top: 1px solid #333;
|
||
font-size: 12px;
|
||
}
|
||
""")
|
||
|
||
self.lbl_file = QLabel("Keine Datei geladen")
|
||
self.lbl_size = QLabel("")
|
||
self.lbl_paths = QLabel("")
|
||
self.lbl_zoom = QLabel("Zoom: 100%")
|
||
|
||
self.addWidget(self.lbl_file, stretch=1)
|
||
self.addPermanentWidget(self.lbl_size)
|
||
self.addPermanentWidget(self.lbl_paths)
|
||
self.addPermanentWidget(self.lbl_zoom)
|
||
|
||
def set_file_info(self, path: str, width: int, height: int):
|
||
self.lbl_file.setText(f" {path}")
|
||
self.lbl_size.setText(f"{width} × {height} px ")
|
||
|
||
def set_path_count(self, count: int):
|
||
self.lbl_paths.setText(f"{count} Pfade ")
|
||
|
||
def set_zoom(self, zoom: float):
|
||
self.lbl_zoom.setText(f"Zoom: {int(zoom * 100)}% ")
|