support rtl text in sort field in browser
This commit is contained in:
parent
2fec9248f8
commit
0acf9b38a4
@ -312,6 +312,17 @@ class DataModel(QAbstractTableModel):
|
||||
return ""
|
||||
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
|
||||
######################################################################
|
||||
|
||||
@ -343,6 +354,9 @@ class StatusDelegate(QItemDelegate):
|
||||
finally:
|
||||
self.browser.mw.progress.blockUpdates = True
|
||||
|
||||
if self.model.isRTL(index):
|
||||
option.direction = Qt.RightToLeft
|
||||
|
||||
col = None
|
||||
if c.queue == -1:
|
||||
col = COLOUR_SUSPENDED
|
||||
|
Loading…
Reference in New Issue
Block a user