Open 152334H opened 2 years ago
tagType is just the index for tagColor, functionally it doesn't matter. QML crash course: create a tagColors property on the backend that returns the list of colors:
@pyqtProperty(list, notify=updated)
def tagColors(self):
return ["#0879f8", "#c00004", "#fff", "#c10cad", "#00ab2c", "#fd9200", "#08f4f8"]
if you change what tagColors returns you need to emit the notify signal (self.updated.emit()
) for the front end to update. then use it in the QML:
color: backend.showingTagColors ? backend.tagColors[backend.tagType(model.text)] : "white"
next is: where is the program looking for tag lists, how is the user going to select the tag list, and where are the tag colors stored for each list.
The a1111-tagcomplete extension has support for different booru tag lists, in the form of a config file.
Currently, this project is hardcoded to use the
danbooru.csv
file. I would like to develop a fork that allows for arbitrary booru csv files to be used, buttagColor
property dynamically