mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
honor styles in css in add/edit dialogs too
This commit is contained in:
parent
dcf65465b3
commit
ea76ddc9f3
4 changed files with 13 additions and 7 deletions
|
@ -29,6 +29,7 @@ class AddCards(QDialog):
|
|||
windParent = parent
|
||||
QDialog.__init__(self, windParent, Qt.Window)
|
||||
self.parent = parent
|
||||
ui.utils.applyStyles(self)
|
||||
self.config = parent.config
|
||||
self.dialog = ankiqt.forms.addcards.Ui_AddCards()
|
||||
self.dialog.setupUi(self)
|
||||
|
|
|
@ -14,7 +14,8 @@ from anki.facts import factsTable, fieldsTable, Fact
|
|||
from anki.utils import fmtTimeSpan, parseTags, findTag, addTags, deleteTags, \
|
||||
stripHTML, ids2str
|
||||
from ankiqt.ui.utils import saveGeom, restoreGeom, saveSplitter, restoreSplitter
|
||||
from ankiqt.ui.utils import saveHeader, restoreHeader, saveState, restoreState
|
||||
from ankiqt.ui.utils import saveHeader, restoreHeader, saveState, \
|
||||
restoreState, applyStyles
|
||||
from anki.errors import *
|
||||
from anki.db import *
|
||||
from anki.stats import CardStats
|
||||
|
@ -336,6 +337,7 @@ class EditDeck(QMainWindow):
|
|||
else:
|
||||
windParent = parent
|
||||
QMainWindow.__init__(self, windParent)
|
||||
applyStyles(self)
|
||||
self.parent = parent
|
||||
self.deck = self.parent.deck
|
||||
self.config = parent.config
|
||||
|
|
|
@ -2540,12 +2540,7 @@ it to your friends.
|
|||
##########################################################################
|
||||
|
||||
def setupStyle(self):
|
||||
try:
|
||||
styleFile = open(os.path.join(self.config.configPath,
|
||||
"style.css"))
|
||||
self.setStyleSheet(styleFile.read())
|
||||
except (IOError, OSError):
|
||||
pass
|
||||
ui.utils.applyStyles(self)
|
||||
|
||||
# Sounds
|
||||
##########################################################################
|
||||
|
|
|
@ -205,6 +205,14 @@ def mungeQA(deck, txt):
|
|||
"font-weight: 900;")
|
||||
return txt
|
||||
|
||||
def applyStyles(widget):
|
||||
try:
|
||||
styleFile = open(os.path.join(ankiqt.mw.config.configPath,
|
||||
"style.css"))
|
||||
widget.setStyleSheet(styleFile.read())
|
||||
except (IOError, OSError):
|
||||
pass
|
||||
|
||||
def getBase(deck, card):
|
||||
base = None
|
||||
if deck and card:
|
||||
|
|
Loading…
Reference in a new issue