- Ausrücken mit Shift-Tab implementiert
- RÜcksprung mit Backspace implementiert - Anzeige für veränderte Datei implementiert
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "SearchPanel.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QTextDocument>
|
||||
|
||||
EditorPanel::EditorPanel(Settings *settings, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
@@ -70,7 +71,20 @@ void EditorPanel::openFile(const QString &filePath)
|
||||
m_tabWidget->setTabToolTip(index, filePath);
|
||||
m_openTabs.insert(filePath, tab);
|
||||
|
||||
// Tab-Titel nach "Speichern unter" aktualisieren
|
||||
// Änderungsindikator im Tab-Titel (● = ungespeichert)
|
||||
connect(tab->editor()->document(), &QTextDocument::modificationChanged,
|
||||
this, [this, tab](bool modified)
|
||||
{
|
||||
const int idx = m_tabWidget->indexOf(tab);
|
||||
if (idx == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
const QString name = QFileInfo(tab->filePath()).fileName();
|
||||
m_tabWidget->setTabText(idx, modified ? "● " + name : name);
|
||||
});
|
||||
|
||||
// Tab-Titel nach "Speichern unter" aktualisieren (neuer Dateiname, kein Punkt)
|
||||
connect(tab->editor(), &CodeEditor::fileSaved, this, [this, tab](const QString &savedPath)
|
||||
{
|
||||
const int idx = m_tabWidget->indexOf(tab);
|
||||
|
||||
Reference in New Issue
Block a user