Commit 5e5245fd authored by dmMaze's avatar dmMaze
Browse files

Bump minimum Qt version to 6.6.2 for macOS

parent ac5f389c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
# To install pytorch cuda (gpu) version, please look https://pytorch.org/

PyQt6-Qt6==6.4.2    # for qt>6.4.2 , framelesswindow is broken on windows, and text rendering is wrong on macOS
PyQt6==6.4.2   #PyQt5>=5.15.9
PyQt6-Qt6==6.4.2; sys_platform == 'win32'
PyQt6==6.4.2; sys_platform == 'win32'
PyQt6-Qt6>=6.6.2; sys_platform == 'darwin'
PyQt6>=6.6.1; sys_platform == 'darwin'
numpy
urllib3==1.25.11 # https://github.com/psf/requests/issues/5740
jaconv
+12 −11
Original line number Diff line number Diff line
@@ -337,14 +337,14 @@ class FontFamilyComboBox(QFontComboBox):
            self._current_font = ffamily

    def on_fontfamily_changed(self):
        if not self.hasFocus():
            self._current_font = self.currentFont().family()
            self.lineedit._text_changed = False
            if self.emit_if_focused and not self.hasFocus():
                return

        ffamily = self.currentFont().family()
        if self._current_font != ffamily:
        # if not self.hasFocus():
        # #     self._current_font = self.currentFont().family()
        # #     self.lineedit._text_changed = False
        #     if self.emit_if_focused and not self.hasFocus():
        #         return

        # ffamily = self.currentFont().family()
        # if self._current_font != ffamily:
        self.apply_fontfamily()
            

@@ -1113,6 +1113,7 @@ class FontFormatPanel(Widget):
            
    def set_active_format(self, font_format: FontFormat):
        C.active_format = font_format
        self.familybox.blockSignals(True)
        self.fontsizebox.fcombobox.setCurrentText(str(int(font_format.size)))
        self.familybox.setCurrentText(font_format.family)
        self.colorPicker.setPickerColor(font_format.frgb)
@@ -1125,6 +1126,7 @@ class FontFormatPanel(Widget):
        self.formatBtnGroup.underlineBtn.setChecked(font_format.underline)
        self.formatBtnGroup.italicBtn.setChecked(font_format.italic)
        self.alignBtnGroup.setAlignment(font_format.alignment)
        self.familybox.blockSignals(False)

    def set_globalfmt_title(self):
        active_text_style_label = self.active_text_style_label()
@@ -1176,4 +1178,3 @@ class FontFormatPanel(Widget):
        self.effect_panel.fontfmt = copy.deepcopy(C.active_format)
        self.effect_panel.updatePanels()
        self.effect_panel.show()
 No newline at end of file
        
 No newline at end of file
+3 −2
Original line number Diff line number Diff line
import re, traceback

from qtpy.QtWidgets import QHeaderView, QTableView, QWidget, QVBoxLayout
from qtpy.QtWidgets import QHeaderView, QTableView, QWidget, QVBoxLayout, QDialog
from qtpy.QtCore import Qt, Signal
from qtpy.QtGui import QStandardItem, QStandardItemModel
from typing import List, Dict
@@ -9,7 +9,7 @@ from utils.logger import logger as LOGGER
from utils.fontformat import FontFormat
from .stylewidgets import Widget, NoBorderPushBtn

class KeywordSubWidget(Widget):
class KeywordSubWidget(QDialog):

    hide_signal = Signal()
    load_preset = Signal(FontFormat)
@@ -17,6 +17,7 @@ class KeywordSubWidget(Widget):
    def __init__(self, title: str, parent: QWidget = None, *args, **kwargs) -> None:
        super().__init__(parent=parent, *args, **kwargs)
        self.setWindowTitle(title)
        self.setModal(True)
        self.sublist: List[Dict] = []

        self.submodel = QStandardItemModel()
+4 −2
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ import cv2
import numpy as np
from qtpy.QtCore import Signal, Qt, QPoint
from qtpy.QtGui import QColor, QShowEvent, QPixmap, QImage, QPainter, QFontMetricsF
from qtpy.QtWidgets import QHBoxLayout, QVBoxLayout, QGridLayout, QScrollArea, QGroupBox, QPushButton, QLabel
from qtpy.QtWidgets import QHBoxLayout, QVBoxLayout, QGridLayout, QScrollArea, QGroupBox, QPushButton, QLabel, QDialog

from utils import shared as C
from .misc import pixmap2ndarray, ndarray2pixmap
@@ -67,12 +67,14 @@ def text_effect_preview_pipe(target: QPixmap, font_size: float, fontfmt: FontFor
    return target


class TextEffectPanel(Widget):
class TextEffectPanel(QDialog):
    apply = Signal()

    def __init__(self, update_text_style_label: Callable, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)

        self.setModal(True)

        self.update_text_style_label = update_text_style_label
        self.fontfmt: FontFormat = None
        self.fontfmt = FontFormat()