From 199e87896b85d214f978488d2f919ba669bf431e Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sun, 29 Jan 2017 11:39:16 +0100 Subject: [PATCH] rename "text" to "title" in NotebookTab --- widgets/notebooktab.cpp | 14 +++++++------- widgets/notebooktab.h | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/widgets/notebooktab.cpp b/widgets/notebooktab.cpp index b4a56875..07b20430 100644 --- a/widgets/notebooktab.cpp +++ b/widgets/notebooktab.cpp @@ -14,7 +14,7 @@ NotebookTab::NotebookTab(Notebook *notebook) , posAnimated(false) , posAnimationDesired() , notebook(notebook) - , text("") + , title("") , selected(false) , mouseOver(false) , mouseDown(false) @@ -52,9 +52,9 @@ void NotebookTab::calcSize() { if (Settings::getInstance().hideTabX.get()) { - this->resize(this->fontMetrics().width(this->text) + 8, 24); + this->resize(this->fontMetrics().width(this->title) + 8, 24); } else { - this->resize(this->fontMetrics().width(this->text) + 8 + 24, 24); + this->resize(this->fontMetrics().width(this->title) + 8 + 24, 24); } } @@ -115,7 +115,7 @@ NotebookTab::paintEvent(QPaintEvent *) width() - (Settings::getInstance().hideTabX.get() ? 0 : 16), height()); - painter.drawText(rect, this->text, QTextOption(Qt::AlignCenter)); + painter.drawText(rect, this->title, QTextOption(Qt::AlignCenter)); if (!Settings::getInstance().hideTabX.get() && (this->mouseOver || this->selected)) { @@ -207,9 +207,9 @@ NotebookTab::mouseMoveEvent(QMouseEvent *event) void NotebookTab::load(const boost::property_tree::ptree &tree) { - // Load tab text + // Load tab title try { - this->setText(QString::fromStdString(tree.get("text"))); + this->setTitle(QString::fromStdString(tree.get("title"))); } catch (boost::property_tree::ptree_error) { } } @@ -219,7 +219,7 @@ NotebookTab::save() { boost::property_tree::ptree tree; - tree.put("text", this->getText().toStdString()); + tree.put("title", this->getTitle().toStdString()); return tree; } diff --git a/widgets/notebooktab.h b/widgets/notebooktab.h index 51a8caf3..4a4dc6e5 100644 --- a/widgets/notebooktab.h +++ b/widgets/notebooktab.h @@ -30,15 +30,15 @@ public: NotebookPage *page; const QString & - getText() const + getTitle() const { - return this->text; + return this->title; } void - setText(const QString &text) + setTitle(const QString &title) { - this->text = text; + this->title = title; } bool @@ -95,7 +95,7 @@ private: Notebook *notebook; - QString text; + QString title; bool selected; bool mouseOver;