先提交下

This commit is contained in:
Mike Solar
2023-07-30 18:57:41 +08:00
parent 442feb1283
commit e3c650dbfd
13 changed files with 1735 additions and 1244 deletions

View File

@ -26,16 +26,17 @@ NavBar::NavBar(ConfigResponse *configResponse,QWidget *parent) :
else {
getLogoFromLocal();
}
this->setLayout(nullptr);
int n = buttonStructs.length();
int x = (width() - height()*n) / 2;
for (auto buttonStruct : buttonStructs) {
MyButton *myButton = new MyButton(buttonStruct, height(), height(), &buttons);
MyButton *myButton = new MyButton(buttonStruct, height(), height(), &buttons,this);
myButton->setGeometry(x, 0, height(), height());
myButton->show();
connect(myButton, &MyButton::clicked1, mainWindowLayout, &MainWindowLayout::clickButton);
x += height();
buttons << myButton;
}
this->setLayout(nullptr);
}
NavBar::~NavBar() {
@ -63,7 +64,7 @@ void NavBar::paintEvent(QPaintEvent *event) {
}
void NavBar::resizeEvent(QResizeEvent *event) {
QWidget::resizeEvent(event);
QWidget::resizeEvent(event);
int n = buttonStructs.length();
int x = (width() - height()*n) / 2;
for(auto button:buttons){