put singletons into their namespace

This commit is contained in:
2017-12-31 22:58:35 +01:00
parent ad001431f2
commit 5a26d5f17f
72 changed files with 357 additions and 288 deletions
+6 -6
View File
@@ -29,7 +29,7 @@ NotebookTab::NotebookTab(Notebook *_notebook, const std::string &_uuid)
this->positionChangedAnimation.setEasingCurve(QEasingCurve(QEasingCurve::InCubic));
SettingsManager::getInstance().hideTabX.connect(
singletons::SettingManager::getInstance().hideTabX.connect(
boost::bind(&NotebookTab::hideTabXChanged, this, _1), this->managedConnections);
this->setMouseTracking(true);
@@ -74,7 +74,7 @@ void NotebookTab::calcSize()
float scale = getDpiMultiplier();
QString qTitle(qS(this->title));
if (SettingsManager::getInstance().hideTabX) {
if (singletons::SettingManager::getInstance().hideTabX) {
this->resize(static_cast<int>((fontMetrics().width(qTitle) + 16) * scale),
static_cast<int>(24 * scale));
} else {
@@ -190,12 +190,12 @@ void NotebookTab::paintEvent(QPaintEvent *)
painter.setPen(fg);
float scale = this->getDpiMultiplier();
int rectW = (SettingsManager::getInstance().hideTabX ? 0 : static_cast<int>(16) * scale);
int rectW = (singletons::SettingManager::getInstance().hideTabX ? 0 : static_cast<int>(16) * scale);
QRect rect(0, 0, this->width() - rectW, this->height());
painter.drawText(rect, this->getTitle(), QTextOption(Qt::AlignCenter));
if (!SettingsManager::getInstance().hideTabX && (mouseOver || selected)) {
if (!singletons::SettingManager::getInstance().hideTabX && (mouseOver || selected)) {
QRect xRect = this->getXRect();
if (mouseOverX) {
painter.fillRect(xRect, QColor(0, 0, 0, 64));
@@ -237,7 +237,7 @@ void NotebookTab::mouseReleaseEvent(QMouseEvent *event)
this->notebook->removePage(this->page);
}
} else {
if (!SettingsManager::getInstance().hideTabX && this->mouseDownX &&
if (!singletons::SettingManager::getInstance().hideTabX && this->mouseDownX &&
this->getXRect().contains(event->pos())) {
this->mouseDownX = false;
@@ -270,7 +270,7 @@ void NotebookTab::dragEnterEvent(QDragEnterEvent *)
void NotebookTab::mouseMoveEvent(QMouseEvent *event)
{
if (!SettingsManager::getInstance().hideTabX) {
if (!singletons::SettingManager::getInstance().hideTabX) {
bool overX = this->getXRect().contains(event->pos());
if (overX != this->mouseOverX) {