diff options
author | Saturn&Eric <[email protected]> | 2021-12-05 19:32:25 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-12-05 19:32:25 +0000 |
commit | e3ecf7cb0e5fc3058760ac28d58ad9766e9037b6 (patch) | |
tree | 4108a6205fb517a694d65b3044f7369f32b43862 /src/ui/widgets/TextEdit.cpp | |
parent | Merge branch 'main' into develop (diff) | |
parent | Improve UI (diff) | |
download | GpgFrontend-e3ecf7cb0e5fc3058760ac28d58ad9766e9037b6.tar.gz GpgFrontend-e3ecf7cb0e5fc3058760ac28d58ad9766e9037b6.zip |
Merge pull request #27 from saturneric/develop-ui
Improve UI
Diffstat (limited to 'src/ui/widgets/TextEdit.cpp')
-rw-r--r-- | src/ui/widgets/TextEdit.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ui/widgets/TextEdit.cpp b/src/ui/widgets/TextEdit.cpp index 8d4ea4a0..ec6c6c7a 100644 --- a/src/ui/widgets/TextEdit.cpp +++ b/src/ui/widgets/TextEdit.cpp @@ -51,7 +51,8 @@ void TextEdit::slotNewTab() { QString header = _("untitled") + QString::number(++countPage) + ".txt"; auto* page = new EditorPage(); - tabWidget->addTab(page, header); + auto index = tabWidget->addTab(page, header); + tabWidget->setTabIcon(index, QIcon(":file.png")); tabWidget->setCurrentIndex(tabWidget->count() - 1); page->getTextPage()->setFocus(); connect(page->getTextPage()->document(), SIGNAL(modificationChanged(bool)), @@ -66,10 +67,12 @@ void TextEdit::slotNewHelpTab(const QString& title, const QString& path) const { void TextEdit::slotNewFileTab() const { auto* page = new FilePage(qobject_cast<QWidget*>(parent())); - tabWidget->addTab(page, "[Browser]"); + auto index = tabWidget->addTab(page, QString()); + tabWidget->setTabIcon(index, QIcon(":file-browser.png")); tabWidget->setCurrentIndex(tabWidget->count() - 1); - connect(page, SIGNAL(pathChanged(const QString&)), this, - SLOT(slotFilePagePathChanged(const QString&))); + connect(page, &FilePage::pathChanged, this, + &TextEdit::slotFilePagePathChanged); + page->slotGoPath(); } void TextEdit::slotOpenFile(QString& path) { @@ -580,7 +583,6 @@ void TextEdit::slotFilePagePathChanged(const QString& path) const { } else { mPath = tPath; } - mPath.prepend("[Browser] "); tabWidget->setTabText(index, mPath); } |