started working on a custom window frame

This commit is contained in:
fourtf
2018-01-15 01:35:35 +01:00
parent 177cd734ab
commit c50e6d7809
11 changed files with 335 additions and 67 deletions
+6 -3
View File
@@ -24,6 +24,7 @@ namespace widgets {
Notebook::Notebook(Window *parent, bool _showButtons, const std::string &settingPrefix)
: BaseWidget(parent)
, parentWindow(parent)
, settingRoot(fS("{}/notebook", settingPrefix))
, addButton(this)
, settingsButton(this)
@@ -196,14 +197,15 @@ void Notebook::performLayout(bool animated)
int x = 0, y = 0;
float scale = this->getDpiMultiplier();
bool customFrame = this->parentWindow->hasCustomWindowFrame();
if (!showButtons || settings.hidePreferencesButton) {
if (!this->showButtons || settings.hidePreferencesButton || customFrame) {
this->settingsButton.hide();
} else {
this->settingsButton.show();
x += settingsButton.width();
}
if (!showButtons || settings.hideUserButton) {
if (!this->showButtons || settings.hideUserButton || customFrame) {
this->userButton.hide();
} else {
this->userButton.move(x, 0);
@@ -211,7 +213,8 @@ void Notebook::performLayout(bool animated)
x += userButton.width();
}
if (!showButtons || (settings.hideUserButton && settings.hidePreferencesButton)) {
if (customFrame || !this->showButtons ||
(settings.hideUserButton && settings.hidePreferencesButton)) {
x += (int)(scale * 2);
}