@@ -431,7 +431,7 @@ def _create_input_section(self):
431431
432432 row = QHBoxLayout ()
433433 self .input_label = QLabel ("No file selected" )
434- self .input_label .setStyleSheet ( "color: #888888; padding: 5px; " )
434+ self .input_label .setProperty ( "labelState" , "inactive " )
435435 self .input_label .setWordWrap (True )
436436 row .addWidget (self .input_label , 1 )
437437
@@ -443,7 +443,7 @@ def _create_input_section(self):
443443 layout .addLayout (row )
444444
445445 self .page_info_label = QLabel ("" )
446- self .page_info_label .setStyleSheet ( "color: #aaaaaa; font-size: 10pt; " )
446+ self .page_info_label .setObjectName ( "pageInfoLabel " )
447447 layout .addWidget (self .page_info_label )
448448
449449 group .setLayout (layout )
@@ -478,7 +478,7 @@ def _create_page_section(self):
478478 layout .addWidget (self .page_entry )
479479
480480 self .help_label = QLabel (self .current_mode .help_text )
481- self .help_label .setStyleSheet ( "color: #aaaaaa; font-size: 9pt; " )
481+ self .help_label .setObjectName ( "helpLabel " )
482482 layout .addWidget (self .help_label )
483483
484484 group .setLayout (layout )
@@ -497,7 +497,7 @@ def _create_output_section(self):
497497
498498 row = QHBoxLayout ()
499499 self .output_label = QLabel ("No output location selected" )
500- self .output_label .setStyleSheet ( "color: #888888; padding: 5px; " )
500+ self .output_label .setProperty ( "labelState" , "inactive " )
501501 self .output_label .setWordWrap (True )
502502 row .addWidget (self .output_label , 1 )
503503
@@ -514,8 +514,18 @@ def _update_label(self, label, text, active=False):
514514 """Update a label with truncated text and appropriate styling."""
515515 display_text = text if len (text ) < 80 else f"...{ text [- 77 :]} "
516516 label .setText (display_text )
517- color = "#ffffff" if active else "#888888"
518- label .setStyleSheet (f"color: { color } ; padding: 5px;" )
517+ # Use dynamic property instead of inline styles
518+ label .setProperty ("labelState" , "active" if active else "inactive" )
519+ # Force style refresh
520+ label .style ().unpolish (label )
521+ label .style ().polish (label )
522+
523+ def _set_label_state (self , label , state ):
524+ """Set a label's state property and refresh styling."""
525+ label .setProperty ("labelState" , state )
526+ if style := label .style ():
527+ style .unpolish (label )
528+ style .polish (label )
519529
520530 def _get_base_name (self ):
521531 """Get base filename from input path."""
@@ -615,7 +625,7 @@ def process_pdf(self):
615625 return
616626
617627 self .status_label .setText ("Processing..." )
618- self .status_label . setStyleSheet ( "color: #aaaaaa; " )
628+ self ._set_label_state ( self . status_label , "processing " )
619629 QApplication .processEvents ()
620630
621631 try :
@@ -641,7 +651,7 @@ def process_pdf(self):
641651
642652 except Exception as e :
643653 self .status_label .setText ("Failed" )
644- self .status_label . setStyleSheet ( "color: #f44336; " )
654+ self ._set_label_state ( self . status_label , "error " )
645655 QMessageBox .critical (self , "Error" , str (e ))
646656
647657 def _confirm_overwrite (self ):
@@ -656,7 +666,7 @@ def _confirm_overwrite(self):
656666 def _show_success (self , message ):
657667 """Display success message."""
658668 self .status_label .setText (f"Success! Saved to: { self .output_folder } " )
659- self .status_label . setStyleSheet ( "color: #4caf50; " )
669+ self ._set_label_state ( self . status_label , "success " )
660670
661671 # Create custom message box with "Open Folder" button
662672 msg_box = QMessageBox (self )
0 commit comments