From a4656f3ab548d31dce02563f1c4ddf160c4db0eb Mon Sep 17 00:00:00 2001 From: fourtf Date: Fri, 5 Jan 2018 23:55:41 +0100 Subject: [PATCH] added slight offset when notebook has no button --- src/widgets/helper/notebooktab.cpp | 2 +- src/widgets/notebook.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/widgets/helper/notebooktab.cpp b/src/widgets/helper/notebooktab.cpp index 7bfba1bf4..3de2674de 100644 --- a/src/widgets/helper/notebooktab.cpp +++ b/src/widgets/helper/notebooktab.cpp @@ -1,4 +1,4 @@ -#include "widgets/helper/notebooktab.hpp" +//#include "widgets/helper/notebooktab.hpp" #include "common.hpp" #include "debug/log.hpp" #include "singletons/settingsmanager.hpp" diff --git a/src/widgets/notebook.cpp b/src/widgets/notebook.cpp index 30c774f51..d1196d9ef 100644 --- a/src/widgets/notebook.cpp +++ b/src/widgets/notebook.cpp @@ -174,16 +174,18 @@ void Notebook::previousTab() void Notebook::performLayout(bool animated) { + singletons::SettingManager &settings = singletons::SettingManager::getInstance(); + int x = 0, y = 0; float scale = this->getDpiMultiplier(); - if (!showButtons || singletons::SettingManager::getInstance().hidePreferencesButton) { + if (!showButtons || settings.hidePreferencesButton) { this->settingsButton.hide(); } else { this->settingsButton.show(); x += settingsButton.width(); } - if (!showButtons || singletons::SettingManager::getInstance().hideUserButton) { + if (!showButtons || settings.hideUserButton) { this->userButton.hide(); } else { this->userButton.move(x, 0); @@ -191,6 +193,10 @@ void Notebook::performLayout(bool animated) x += userButton.width(); } + if (!showButtons || (settings.hideUserButton && settings.hidePreferencesButton)) { + x += (int)(scale * 2); + } + int tabHeight = static_cast(24 * scale); bool first = true;