From: Danilo M. Date: Sun, 3 May 2026 08:26:29 +0000 (+0200) Subject: fix: wire badge into sidebar layout, remove unused QFont/QSizePolicy imports X-Git-Tag: v1.0~18 X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=97ed0956eeb88a8ebe7ff1646dfdaf78c6057a6e;p=publisher.git fix: wire badge into sidebar layout, remove unused QFont/QSizePolicy imports --- diff --git a/ui/main_window.py b/ui/main_window.py index 9f0594b..cbefa5f 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -1,10 +1,9 @@ from __future__ import annotations from PyQt6.QtWidgets import ( QMainWindow, QWidget, QHBoxLayout, QVBoxLayout, - QLabel, QPushButton, QStackedWidget, QFrame, QSizePolicy, + QLabel, QPushButton, QStackedWidget, QFrame, ) from PyQt6.QtCore import Qt, QFileSystemWatcher -from PyQt6.QtGui import QFont from pathlib import Path from core.config import Config from core.article_scanner import scan_articles @@ -99,9 +98,18 @@ class MainWindow(QMainWindow): section("CONTENUTO") btn("📋 Articoli", "_page_articles") - self._btn_no_trans = btn("⚠️ Senza Traduzione", "_page_no_translation") + + no_trans_row = QHBoxLayout() + no_trans_row.setContentsMargins(0, 0, 0, 0) + self._btn_no_trans = SidebarButton("⚠️ Senza Traduzione") + self._btn_no_trans.clicked.connect(lambda: self._show_page("_page_no_translation", self._btn_no_trans)) + self._btn_group.append(self._btn_no_trans) + no_trans_row.addWidget(self._btn_no_trans, stretch=1) self._badge_no_trans = QLabel("0") self._badge_no_trans.setStyleSheet("background:#3a1a1a;color:#ff6b6b;border-radius:8px;padding:1px 6px;font-size:10px;") + no_trans_row.addWidget(self._badge_no_trans) + layout.addLayout(no_trans_row) + btn("➕ Nuovo articolo", "_page_new_article") btn("🏷 Tassonomia", "_page_taxonomy") btn("🖼 Media", "_page_media")