Loading ui/fontformatpanel.py +7 −3 Original line number Diff line number Diff line Loading @@ -1006,7 +1006,7 @@ class FontFormatPanel(Widget): self.effectBtn = ClickableLabel(self.tr("Effect"), self) self.effectBtn.clicked.connect(self.on_effectbtn_clicked) self.effect_panel = TextEffectPanel() self.effect_panel = TextEffectPanel(update_text_style_label=self.update_text_style_label) self.effect_panel.hide() self.foldTextBtn = CheckableLabel(self.tr("Unfold"), self.tr("Fold"), False) Loading Loading @@ -1073,11 +1073,15 @@ class FontFormatPanel(Widget): func = FM.handle_ffmt_change.get(param_name) if self.global_mode(): func(param_name, value, self.global_format, is_global=True) self.update_text_style_label() else: func(param_name, value, C.active_format, is_global=False, blkitems=self.textblk_item, set_focus=True) def update_text_style_label(self): if self.global_mode(): active_text_style_label = self.active_text_style_label() if active_text_style_label is not None: active_text_style_label.update_style(self.global_format) else: func(param_name, value, C.active_format, is_global=False, blkitems=self.textblk_item, set_focus=True) def changingColor(self): self.focusOnColorDialog = True Loading ui/text_graphical_effect.py +4 −2 Original line number Diff line number Diff line from typing import Union, Tuple from typing import Union, Tuple, Callable import cv2 import numpy as np Loading Loading @@ -70,9 +70,10 @@ def text_effect_preview_pipe(target: QPixmap, font_size: float, fontfmt: FontFor class TextEffectPanel(Widget): apply = Signal() def __init__(self, *args, **kwargs) -> None: def __init__(self, update_text_style_label: Callable, *args, **kwargs) -> None: super().__init__(*args, **kwargs) self.update_text_style_label = update_text_style_label self.fontfmt: FontFormat = None self.fontfmt = FontFormat() self.active_fontfmt = FontFormat() Loading Loading @@ -182,6 +183,7 @@ class TextEffectPanel(Widget): self.active_fontfmt.shadow_radius = self.fontfmt.shadow_radius self.active_fontfmt.shadow_strength = self.fontfmt.shadow_strength self.active_fontfmt.shadow_offset = self.fontfmt.shadow_offset self.update_text_style_label() self.apply.emit() def on_cancel_clicked(self): Loading Loading
ui/fontformatpanel.py +7 −3 Original line number Diff line number Diff line Loading @@ -1006,7 +1006,7 @@ class FontFormatPanel(Widget): self.effectBtn = ClickableLabel(self.tr("Effect"), self) self.effectBtn.clicked.connect(self.on_effectbtn_clicked) self.effect_panel = TextEffectPanel() self.effect_panel = TextEffectPanel(update_text_style_label=self.update_text_style_label) self.effect_panel.hide() self.foldTextBtn = CheckableLabel(self.tr("Unfold"), self.tr("Fold"), False) Loading Loading @@ -1073,11 +1073,15 @@ class FontFormatPanel(Widget): func = FM.handle_ffmt_change.get(param_name) if self.global_mode(): func(param_name, value, self.global_format, is_global=True) self.update_text_style_label() else: func(param_name, value, C.active_format, is_global=False, blkitems=self.textblk_item, set_focus=True) def update_text_style_label(self): if self.global_mode(): active_text_style_label = self.active_text_style_label() if active_text_style_label is not None: active_text_style_label.update_style(self.global_format) else: func(param_name, value, C.active_format, is_global=False, blkitems=self.textblk_item, set_focus=True) def changingColor(self): self.focusOnColorDialog = True Loading
ui/text_graphical_effect.py +4 −2 Original line number Diff line number Diff line from typing import Union, Tuple from typing import Union, Tuple, Callable import cv2 import numpy as np Loading Loading @@ -70,9 +70,10 @@ def text_effect_preview_pipe(target: QPixmap, font_size: float, fontfmt: FontFor class TextEffectPanel(Widget): apply = Signal() def __init__(self, *args, **kwargs) -> None: def __init__(self, update_text_style_label: Callable, *args, **kwargs) -> None: super().__init__(*args, **kwargs) self.update_text_style_label = update_text_style_label self.fontfmt: FontFormat = None self.fontfmt = FontFormat() self.active_fontfmt = FontFormat() Loading Loading @@ -182,6 +183,7 @@ class TextEffectPanel(Widget): self.active_fontfmt.shadow_radius = self.fontfmt.shadow_radius self.active_fontfmt.shadow_strength = self.fontfmt.shadow_strength self.active_fontfmt.shadow_offset = self.fontfmt.shadow_offset self.update_text_style_label() self.apply.emit() def on_cancel_clicked(self): Loading