@@ -692,6 +692,14 @@ def _update_items(self, result=None, error=None):
692
692
alignment = QtCore .Qt .AlignmentFlag .AlignLeft | QtCore .Qt .AlignmentFlag .AlignTop
693
693
694
694
for i , tag in enumerate (self .tag_diff .tag_names ):
695
+ is_preserved = tag in self .preserved_tags
696
+ if tag == '~length' or is_preserved :
697
+ self .tag_diff .set_bits (tag , TagStatus .NOTREMOVABLE | TagStatus .READONLY )
698
+ new_item_flags = orig_flags
699
+ elif tag != '~length' :
700
+ self .tag_diff .unset_bits (tag , TagStatus .NOTREMOVABLE | TagStatus .READONLY )
701
+ new_item_flags = new_flags
702
+
695
703
color = self .colors .get (self .tag_diff .tag_status (tag ),
696
704
self .colors [TagStatus .NOCHANGE ])
697
705
@@ -726,18 +734,14 @@ def _update_items(self, result=None, error=None):
726
734
new_item = QtWidgets .QTableWidgetItem ()
727
735
new_item .setTextAlignment (alignment )
728
736
self .setItem (i , self .COLUMN_NEW , new_item )
729
- if is_preserved or tag == '~length' :
730
- self .tag_diff .set_bits (tag , TagStatus .NOTREMOVABLE | TagStatus .READONLY )
731
- new_item .setFlags (orig_flags )
732
- else :
733
- if tag != '~length' :
734
- self .tag_diff .unset_bits (tag , TagStatus .NOTREMOVABLE | TagStatus .READONLY )
735
- new_item .setFlags (new_flags )
736
- self ._set_item_value (new_item , self .tag_diff .new , tag )
737
+ new_item .setFlags (new_item_flags )
738
+
737
739
font = new_item .font ()
738
740
strikeout = self .tag_diff .tag_status (tag ) == TagStatus .REMOVED
739
741
font .setStrikeOut (strikeout )
740
742
new_item .setFont (font )
743
+
744
+ self ._set_item_value (new_item , self .tag_diff .new , tag )
741
745
new_item .setForeground (color )
742
746
743
747
# Adjust row height to content size
0 commit comments