added slight offset when notebook has no button

This commit is contained in:
fourtf 2018-01-05 23:55:41 +01:00
parent 3bf3490aa3
commit a4656f3ab5
2 changed files with 9 additions and 3 deletions

View file

@ -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"

View file

@ -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<int>(24 * scale);
bool first = true;