Loading ballontranslator/data/config/stylesheet.css +8 −0 Original line number Diff line number Diff line Loading @@ -675,6 +675,14 @@ QLabel#angleLabel { color: rgba(255, 255, 255, 150); } .EffectBtn { font-size: 22px; } .EffectBtn::hover { background-color: rgba(30, 147, 229, 20%); } DrawToolCheckBox::indicator { height: 34px; width: 34px; Loading ballontranslator/ui/fontformatpanel.py +11 −2 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ from .misc import FontFormat, set_html_color, pt2px from .textitem import TextBlkItem from .canvas import Canvas from .constants import CONFIG_FONTSIZE_CONTENT, WIDGET_SPACING_CLOSE from .text_graphical_effect import EffectBtn from . import constants as C from utils.logger import logger as LOGGER Loading Loading @@ -525,6 +526,10 @@ class FontFormatPanel(Widget): self.fontfmtLabel.setText(self.global_fontfmt_str) self.fontfmtLabel.setFont(font) self.effectBtn = EffectBtn(self) self.effectBtn.setText(self.tr("Effect")) self.effectBtn.clicked.connect(self.on_effectbtn_clicked) FONTFORMAT_SPACING = 6 hl0 = QHBoxLayout() Loading @@ -546,9 +551,10 @@ class FontFormatPanel(Widget): hl2.setSpacing(FONTFORMAT_SPACING) hl2.setContentsMargins(0, 0, 0, 0) hl3 = QHBoxLayout() hl3.setAlignment(Qt.AlignmentFlag.AlignLeft) hl3.setAlignment(Qt.AlignmentFlag.AlignCenter) hl3.addLayout(stroke_hlayout) hl3.addLayout(lettersp_hlayout) hl3.addWidget(self.effectBtn) hl3.setContentsMargins(3, 3, 3, 3) hl3.setSpacing(13) Loading Loading @@ -709,3 +715,6 @@ class FontFormatPanel(Widget): self.textblk_item = textblk_item self.set_active_format(blk_fmt) self.fontfmtLabel.setText(f'TextBlock #{textblk_item.idx}') def on_effectbtn_clicked(self): print('eff cliced!') No newline at end of file ballontranslator/ui/text_graphical_effect.py 0 → 100644 +18 −0 Original line number Diff line number Diff line from qtpy.QtWidgets import QHBoxLayout, QVBoxLayout, QFrame, QFontComboBox, QComboBox, QApplication, QPushButton, QCheckBox, QLabel from qtpy.QtCore import Signal, Qt from qtpy.QtGui import QColor, QTextCharFormat, QDoubleValidator, QMouseEvent, QFont, QTextCursor, QFocusEvent, QKeyEvent class EffectBtn(QLabel): clicked = Signal() def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.text = self.tr('Effect') self.setText(self.text) def mousePressEvent(self, e: QMouseEvent) -> None: if e.button() == Qt.MouseButton.LeftButton: self.clicked.emit() return super().mousePressEvent(e) No newline at end of file Loading
ballontranslator/data/config/stylesheet.css +8 −0 Original line number Diff line number Diff line Loading @@ -675,6 +675,14 @@ QLabel#angleLabel { color: rgba(255, 255, 255, 150); } .EffectBtn { font-size: 22px; } .EffectBtn::hover { background-color: rgba(30, 147, 229, 20%); } DrawToolCheckBox::indicator { height: 34px; width: 34px; Loading
ballontranslator/ui/fontformatpanel.py +11 −2 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ from .misc import FontFormat, set_html_color, pt2px from .textitem import TextBlkItem from .canvas import Canvas from .constants import CONFIG_FONTSIZE_CONTENT, WIDGET_SPACING_CLOSE from .text_graphical_effect import EffectBtn from . import constants as C from utils.logger import logger as LOGGER Loading Loading @@ -525,6 +526,10 @@ class FontFormatPanel(Widget): self.fontfmtLabel.setText(self.global_fontfmt_str) self.fontfmtLabel.setFont(font) self.effectBtn = EffectBtn(self) self.effectBtn.setText(self.tr("Effect")) self.effectBtn.clicked.connect(self.on_effectbtn_clicked) FONTFORMAT_SPACING = 6 hl0 = QHBoxLayout() Loading @@ -546,9 +551,10 @@ class FontFormatPanel(Widget): hl2.setSpacing(FONTFORMAT_SPACING) hl2.setContentsMargins(0, 0, 0, 0) hl3 = QHBoxLayout() hl3.setAlignment(Qt.AlignmentFlag.AlignLeft) hl3.setAlignment(Qt.AlignmentFlag.AlignCenter) hl3.addLayout(stroke_hlayout) hl3.addLayout(lettersp_hlayout) hl3.addWidget(self.effectBtn) hl3.setContentsMargins(3, 3, 3, 3) hl3.setSpacing(13) Loading Loading @@ -709,3 +715,6 @@ class FontFormatPanel(Widget): self.textblk_item = textblk_item self.set_active_format(blk_fmt) self.fontfmtLabel.setText(f'TextBlock #{textblk_item.idx}') def on_effectbtn_clicked(self): print('eff cliced!') No newline at end of file
ballontranslator/ui/text_graphical_effect.py 0 → 100644 +18 −0 Original line number Diff line number Diff line from qtpy.QtWidgets import QHBoxLayout, QVBoxLayout, QFrame, QFontComboBox, QComboBox, QApplication, QPushButton, QCheckBox, QLabel from qtpy.QtCore import Signal, Qt from qtpy.QtGui import QColor, QTextCharFormat, QDoubleValidator, QMouseEvent, QFont, QTextCursor, QFocusEvent, QKeyEvent class EffectBtn(QLabel): clicked = Signal() def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.text = self.tr('Effect') self.setText(self.text) def mousePressEvent(self, e: QMouseEvent) -> None: if e.button() == Qt.MouseButton.LeftButton: self.clicked.emit() return super().mousePressEvent(e) No newline at end of file