mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
support rtl text in sort field in browser
This commit is contained in:
parent
2fec9248f8
commit
0acf9b38a4
1 changed files with 14 additions and 0 deletions
|
@ -312,6 +312,17 @@ class DataModel(QAbstractTableModel):
|
||||||
return ""
|
return ""
|
||||||
return time.strftime("%Y-%m-%d", time.localtime(date))
|
return time.strftime("%Y-%m-%d", time.localtime(date))
|
||||||
|
|
||||||
|
def isRTL(self, index):
|
||||||
|
col = index.column()
|
||||||
|
type = self.columnType(col)
|
||||||
|
if type != "noteFld":
|
||||||
|
return False
|
||||||
|
|
||||||
|
row = index.row()
|
||||||
|
c = self.getCard(index)
|
||||||
|
nt = c.note().model()
|
||||||
|
return nt['flds'][self.col.models.sortIdx(nt)]['rtl']
|
||||||
|
|
||||||
# Line painter
|
# Line painter
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
@ -343,6 +354,9 @@ class StatusDelegate(QItemDelegate):
|
||||||
finally:
|
finally:
|
||||||
self.browser.mw.progress.blockUpdates = True
|
self.browser.mw.progress.blockUpdates = True
|
||||||
|
|
||||||
|
if self.model.isRTL(index):
|
||||||
|
option.direction = Qt.RightToLeft
|
||||||
|
|
||||||
col = None
|
col = None
|
||||||
if c.queue == -1:
|
if c.queue == -1:
|
||||||
col = COLOUR_SUSPENDED
|
col = COLOUR_SUSPENDED
|
||||||
|
|
Loading…
Reference in a new issue