Массовые исправления UX: вкладки (MouseArea не блокирует ×), контент редактора (onDocIndexChanged), авто-расширение .md, ошибка дубликата, ПКМ-создание внутри папок, точки в календаре, граф (зум колесом, клик по файлу, pan правой кнопкой), fileExists(), 16/16 тестов
This commit is contained in:
@@ -88,6 +88,13 @@ Item {
|
||||
return { day: t.getDate(), month: t.getMonth(), year: t.getFullYear() }
|
||||
}
|
||||
|
||||
// Проверяем, есть ли заметка за этот день
|
||||
readonly property bool hasNote: {
|
||||
if (modelData <= 0 || !fileStore.ready) return false
|
||||
const ds = Qt.formatDate(new Date(cal.year, cal.month, modelData), "yyyy-MM-dd")
|
||||
return fileStore.fileExists(fileStore.vault + "/Журнал/" + ds + ".md")
|
||||
}
|
||||
|
||||
Label {
|
||||
anchors.centerIn: parent
|
||||
visible: modelData > 0
|
||||
@@ -96,6 +103,18 @@ Item {
|
||||
color: modelData > 0 ? "#222" : "#ddd"
|
||||
}
|
||||
|
||||
// Точка — есть заметка за этот день
|
||||
Rectangle {
|
||||
visible: modelData > 0 && parent.hasNote
|
||||
width: 5
|
||||
height: 5
|
||||
radius: 3
|
||||
color: "#3b82f6"
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 3
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
visible: modelData > 0
|
||||
|
||||
Reference in New Issue
Block a user