refactor(notebook): merge top/bottom and left/right layout code (#6215)

This commit is contained in:
nerix
2025-05-18 12:17:13 +02:00
committed by GitHub
parent 6b968a199c
commit 67956ef2c6
3 changed files with 314 additions and 381 deletions
+21
View File
@@ -10,6 +10,7 @@
#include <QWidget>
#include <functional>
#include <span>
namespace chatterino {
@@ -170,6 +171,26 @@ protected:
private:
void performLayout(bool animate = false);
struct LayoutContext {
int left = 0;
int right = 0;
int bottom = 0;
float scale = 0;
int tabHeight = 0;
int minimumTabAreaSpace = 0;
int addButtonWidth = 0;
int lineThickness = 0;
int tabSpacer = 0;
int buttonWidth = 0;
int buttonHeight = 0;
std::span<Item> items;
};
void performHorizontalLayout(const LayoutContext &ctx, bool animated);
void performVerticalLayout(const LayoutContext &ctx, bool animated);
/**
* @brief Show a popup informing the user of some big tab visibility changes
**/