Files
aza/APP/logo-tool/ui/status_bar.py
2026-03-30 07:59:11 +02:00

40 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
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)}% ")