<commit_before>import QtQuick 2.5
import QtQuick.Controls 1.4
import NoteEverywhere 1.0
import QtQuick.Dialogs 1.2

Item {

    Component.onDestruction: {
        if (NoteEverywhere.currentNote){
            if (NoteEverywhere.currentNote.content !== contentTextArea.text){
                NoteEverywhere.sqlInterface.updateNoteContent(NoteEverywhere.currentNote.id, contentTextArea.text)
            }
        }
    }


    Connections {
        target: NoteEverywhere
        onCurrentNoteChanged: {
            saveCurrentNote(NoteEverywhere.previousNote)
            textFormatter.text = NoteEverywhere.currentNote? NoteEverywhere.currentNote.content : ""
            textFormatter.textChanged() //This is it.
        }
    }

    Loader {
        id: colorDialogLoader
        active: false
        sourceComponent: ColorDialog {
            title: "Select font color"
            modality: Qt.WindowModal
            visible: colorDialogLoader.active
            onAccepted: {
                textFormatter.textColor = color
                colorDialogLoader.active = false
            }
        }
    }
<commit_msg>Fixed bug when ColorDialog could not be opened again after closing.<commit_after>import QtQuick 2.5
import QtQuick.Controls 1.4
import NoteEverywhere 1.0
import QtQuick.Dialogs 1.2

Item {

    Component.onDestruction: {
        if (NoteEverywhere.currentNote){
            if (NoteEverywhere.currentNote.content !== contentTextArea.text){
                NoteEverywhere.sqlInterface.updateNoteContent(NoteEverywhere.currentNote.id, contentTextArea.text)
            }
        }
    }


    Connections {
        target: NoteEverywhere
        onCurrentNoteChanged: {
            saveCurrentNote(NoteEverywhere.previousNote)
            textFormatter.text = NoteEverywhere.currentNote? NoteEverywhere.currentNote.content : ""
            textFormatter.textChanged() //This is it.
        }
    }

    Loader {
        id: colorDialogLoader
        active: false
        sourceComponent: ColorDialog {
            title: "Select font color"
            modality: Qt.WindowModal
            visible: colorDialogLoader.active
            onAccepted: {
                textFormatter.textColor = color
                colorDialogLoader.active = false
            }
            onRejected: colorDialogLoader.active = false
        }
    }

{'fraction_non_alphanumeric': 0.07133757961783439, 'fraction_numerical': 0.006794055201698514, 'mean_word_length': 2.047865459249677, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4492497', 'n_tokens_mistral': 616, 'n_tokens_neox': 590, 'n_words': 119}