Skip to content

Commit

Permalink
Fix styling issues introduced in Anki 2.1.60(not well tested yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMoolenaar committed Mar 11, 2023
1 parent f24f900 commit 314ba07
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 30 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
src/user_files/accentAudio
src/user_files/accentAudio
meta.json
4 changes: 2 additions & 2 deletions src/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
addon_path = dirname(__file__)
import platform

verNumber = "1.2.3+1.0.0"
verNumber = "1.2.3+1.0.1"

class JSGui(QScrollArea):
def __init__(self, mw, colArray, languageModeler, reboot, CSSJSHandler, UEManager):
Expand Down Expand Up @@ -946,7 +946,7 @@ def setToolTips(self):
self.ui.graphOverwrite.setToolTip('Pitch graph(s) will be generated into the selected pitch graph field(s),\noverwriting their current contents.')
self.ui.graphIfEmpty.setToolTip('Pitch graph(s) will be only be added to the selected pitch graph field(s) if they are empty.')
self.ui.graphSep.setToolTip('This is the separator to be used when adding pitch graph(s) to the selected pitch graph field(s)\' current contents.\nThe default separator is an html line break "<br>".')
self.ui.lookAhead.setToolTip('This is the number of characters within which the addon will attempt to search for a recognizable word when using the "語" button, a larger number will be slightly slower.')
self.ui.lookAhead.setToolTip('This is the number of characters within which the addon will attempt to search for a recognizable word, a larger number will be slightly slower.')
self.ui.heibanColor.setToolTip('This is the color setting for words with a heiban (平板) pitch accent.')
self.ui.atamadakaColor.setToolTip('This is the color setting for words with an atamadaka (頭高) pitch accent.')
self.ui.nakadakaColor.setToolTip('This is the color setting for words with a nakadaka (中高) pitch accent.')
Expand Down
52 changes: 25 additions & 27 deletions src/jsgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def setupUi(self, Dialog):
self.groupBox_4.setTitle("")
self.groupBox_4.setObjectName("groupBox_4")
self.gridLayout_15 = QGridLayout(self.groupBox_4)
self.gridLayout_15.setContentsMargins(5, 5, 5, 5)
self.gridLayout_15.setContentsMargins(5, 15, 5, 0)
self.gridLayout_15.setObjectName("gridLayout_15")
self.horizontalLayout_31 = QHBoxLayout()
self.horizontalLayout_31.setObjectName("horizontalLayout_31")
Expand Down Expand Up @@ -93,6 +93,7 @@ def setupUi(self, Dialog):
self.horizontalLayout_32.addWidget(self.atamadakaColor)
self.atamadakaSelect = QPushButton(self.groupBox_4)
self.groupBox_4.setFixedHeight(110)
self.groupBox_4.setContentsMargins(0, 0, 0, 0)
self.gridLayout_15.setSpacing(3)
self.horizontalLayout_32.addWidget(self.atamadakaSelect)
spacerItem1 = QSpacerItem(40, 20, QSizePolicy.Policy.MinimumExpanding, QSizePolicy.Policy.Minimum)
Expand Down Expand Up @@ -246,7 +247,7 @@ def setupUi(self, Dialog):
self.gridLayout_13.setContentsMargins(5, 0, 5, 5)
self.gridLayout_13.setObjectName("gridLayout_13")
self.groupBox_7 = QGroupBox()
self.groupBox_7.setFixedHeight(90)
self.groupBox_7.setFixedHeight(110)
self.groupBox_7.setObjectName("groupBox_7")
self.gridLayout_16 = QGridLayout(self.groupBox_7)
self.gridLayout_16.setContentsMargins(5, 5, 5, 5)
Expand Down Expand Up @@ -287,9 +288,10 @@ def setupUi(self, Dialog):
self.sentenceKana.setObjectName("sentenceKana")
self.gridLayout_16.addWidget(self.sentenceKana, 0, 1, 1, 1)
self.groupBox_8 = QGroupBox()
self.groupBox_8.setFixedHeight(90)
self.groupBox_8.setFixedHeight(110)
self.groupBox_8.setObjectName("groupBox_8")
self.gridLayout_18 = QGridLayout(self.groupBox_8)
self.gridLayout_18.setColumnStretch(3, 0)
self.gridLayout_18.setContentsMargins(5, 5, 5, 5)
self.gridLayout_18.setObjectName("gridLayout_18")
self.wordGraphs = QCheckBox(self.groupBox_8)
Expand Down Expand Up @@ -323,17 +325,27 @@ def setupUi(self, Dialog):
self.wordAudio.setText("")
self.wordAudio.setObjectName("wordAudio")
self.gridLayout_18.addWidget(self.wordAudio, 2, 1, 1, 1)
self.label_29 = QLabel()
self.label_29.setObjectName("label_29")
self.gridLayout_18.addWidget(self.label_29, 2, 2, 1, 1)
self.lookAhead = QSpinBox()
self.lookAhead.setFixedWidth(70)
self.lookAhead.setMaximum(1000)
self.lookAhead.setObjectName("lookAhead")
self.gridLayout_18.addWidget(self.lookAhead, 2, 3, 1, 1)
self.wordKana = QCheckBox(self.groupBox_8)
self.wordKana.setText("")
self.wordKana.setObjectName("wordKana")
self.gridLayout_18.addWidget(self.wordKana, 0, 1, 1, 1)
self.audioFieldsCB = QComboBox()
self.audioFieldsCB.setFixedHeight(20)
self.audioFieldsCB.setObjectName("audioFieldsCB")
self.audioLayout = QHBoxLayout()
self.audioLayout.addWidget(QLabel('Audio Field(s):'))
self.audioLayout.addWidget(self.audioFieldsCB)
self.gridLayout_13.addLayout(self.audioLayout, 0, 0, 1, 1)
self.pitchGraphsCB = QComboBox()
self.pitchGraphsCB.setFixedHeight(20)
self.pitchGraphsCB.setObjectName("pitchGraphsCB")
self.pitchGraphsLayout = QHBoxLayout()
self.pitchGraphsLayout.addWidget(QLabel('Pitch Graph Field(s):'))
Expand Down Expand Up @@ -439,14 +451,6 @@ def setupUi(self, Dialog):
self.gridLayout_13.addLayout(self.horizontalLayout_11, 2, 1, 1, 3)
self.horizontalLayout_12 = QHBoxLayout()
self.horizontalLayout_12.setObjectName("horizontalLayout_12")
self.label_29 = QLabel()
self.label_29.setFixedWidth(68)
self.label_29.setObjectName("label_29")
self.horizontalLayout_12.addWidget(self.label_29, 0, Qt.AlignmentFlag.AlignLeft)
self.lookAhead = QSpinBox()
self.lookAhead.setFixedWidth(80)
self.lookAhead.setObjectName("lookAhead")
self.horizontalLayout_12.addWidget(self.lookAhead, 0, Qt.AlignmentFlag.AlignLeft)
spacerItem10 = QSpacerItem(40, 20, QSizePolicy.Policy.MinimumExpanding, QSizePolicy.Policy.Minimum)
self.horizontalLayout_12.addItem(spacerItem10)
self.gridLayout_13.addLayout(self.horizontalLayout_12, 4, 0, 1, 4)
Expand All @@ -464,10 +468,10 @@ def setupUi(self, Dialog):
self.genHL.addWidget(self.groupBox_8)
self.genVL.addLayout(self.genHL)
self.genVL.setSpacing(3)
self.genGrid.setFixedHeight(170)
self.genGrid.setFixedHeight(150)
self.genVL.addWidget(self.genGrid)
self.genVL.addStretch()
self.groupBox.setFixedHeight(295)
self.genVL.addStretch(5)
self.groupBox.setFixedHeight(280)
self.groupBox.setLayout(self.genVL)
self.groupBox_6.setTitle("")
self.groupBox_6.setObjectName("groupBox_6")
Expand All @@ -489,6 +493,7 @@ def setupUi(self, Dialog):
self.label_3.setObjectName("label_3")
self.gridLayout_12.addWidget(self.label_3, 0, 0, 1, 1)
self.profilesCB = QComboBox(self.groupBox_6)
self.profilesCB.setFixedHeight(20)
self.profilesCB.setObjectName("profilesCB")
self.gridLayout_12.addWidget(self.profilesCB, 1, 0, 1, 1)
self.horizontalLayout_2 = QHBoxLayout()
Expand All @@ -515,6 +520,7 @@ def setupUi(self, Dialog):
self.activeActionButton.setObjectName("activeActionButton")
self.gridLayout.addWidget(self.activeActionButton, 2, 5, 1, 1)
self.label_10 = QLabel(self.tab)
self.label_10.setStyleSheet("QLabel{font-size: 8pt;}")
self.label_10.setObjectName("label_10")
self.gridLayout.addWidget(self.label_10, 0, 2, 1, 1)
self.activeNoteTypeCB = QComboBox(self.tab)
Expand Down Expand Up @@ -542,9 +548,11 @@ def setupUi(self, Dialog):
self.gridLayout.addWidget(self.autoCSSJS, 0, 1, 1, 1)
self.addMigakuNoteType = QCheckBox(self.tab)
self.addMigakuNoteType.setText("")
self.addMigakuNoteType.setContentsMargins(5, 5 ,5, 5)
self.addMigakuNoteType.setObjectName("addMigakuNoteType")
self.gridLayout.addWidget(self.addMigakuNoteType, 0, 3, 1, 1)
self.listWidget = QTableWidget(self.tab)
self.listWidget.verticalHeader().setVisible(False)
if is_win and platform.release() == '10' and theme_manager.night_mode != True:
self.listWidget.setStyleSheet(
"QHeaderView::section{"
Expand Down Expand Up @@ -614,6 +622,7 @@ def setupUi(self, Dialog):
self.horizontalLayout_3.addWidget(self.searchRulesButton, 0, Qt.AlignmentFlag.AlignLeft)
self.verticalLayout.addLayout(self.horizontalLayout_3)
self.rulesTable = QTableView(self.tab_3)
self.rulesTable.verticalHeader().setVisible(False)
if is_win and platform.release() == '10' and theme_manager.night_mode != True:
self.rulesTable.setStyleSheet(
"QHeaderView::section{"
Expand Down Expand Up @@ -732,7 +741,7 @@ def setupUi(self, Dialog):
'is maintained by Mike Moolenaar and not affiliated with Migaku in any way. Don\'t report any issues with this version to the official migaku repository, but rather use '+
'<a href="https://github.com/MikeMoolenaar/MIA-Japanese-Add-on/">this Github page</a>. Refer to the README there for more info.<br>'+
'Please feel free to create an issue if you have any problems and I wish you the best of luck with Language Learning :).<br><br>'+
'The original about section continues below.')
'The original about section continues below, I have removed the link to the original GitHub page to avoid confusion.')
aboutLabel.setWordWrap(True)
aboutLabel.setOpenExternalLinks(True)
self.updatedAboutVL.addWidget(aboutLabel)
Expand Down Expand Up @@ -775,13 +784,6 @@ def setupUi(self, Dialog):
self.migakuAboutVL.addWidget(self.migakuAboutLinksTitle)

self.migakuAboutVL.addLayout(self.migakuAboutLinksHL3)

self.migakuContact = QGroupBox()
self.migakuContact.setTitle('Contact Us')
self.migakuContactVL = QVBoxLayout()
self.migakuContact.setStyleSheet("QGroupBox { font-weight: bold; } ")
self.migakuContactText = QLabel("If you would like to report a bug or contribute to the add-on, the best way to do so is by starting a ticket or pull request on GitHub. If you are looking for personal assistance using the add-on, check out the Migaku Patreon Discord Server.")
self.migakuContactText.setWordWrap(True)

self.gitHubIcon = self.getSVGWidget('Github.svg')
self.gitHubIcon.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
Expand All @@ -795,19 +797,15 @@ def setupUi(self, Dialog):
self.migakuThanksText.setWordWrap(True);
self.migakuThanksVL.addWidget(self.migakuThanksText)

self.migakuContactVL.addWidget(self.migakuContactText)
self.migakuContactVL.addWidget(self.gitHubIcon)
self.migakuContact.setLayout(self.migakuContactVL)
self.migakuThanks.setLayout(self.migakuThanksVL)
self.tab4vl.addWidget(self.updatedAbout)
self.tab4vl.addWidget(self.migakuAbout)
self.tab4vl.addWidget(self.migakuContact)
self.tab4vl.addWidget(self.migakuThanks)
self.tab4vl.addStretch()
self.tab_4.setLayout(self.tab4vl)
self.tabWidget.addTab(self.tab_4, "")
self.restoreDefaults = QPushButton(Dialog)
self.restoreDefaults.setGeometry(QRect(10, 690, 120, 32))
self.restoreDefaults.setGeometry(QRect(10, 690, 130, 32))
self.restoreDefaults.setObjectName("restoreDefaults")
self.activeProfileCB.setFixedWidth(184)
self.activeNoteTypeCB.setFixedWidth(184)
Expand Down

0 comments on commit 314ba07

Please sign in to comment.