优化布局

pull/24/head
大耳刮子 3 years ago
parent e4f867170f
commit ecd8512dc7

@ -20,10 +20,72 @@ MainWindow::~MainWindow()
void MainWindow::initUis(){
setBtnStyles();
/*
* init
*/
rock_widget = new JoyStick(ui->JoyStick_widget);
rock_widget->show();
}
void MainWindow::setBtnStyles(){
/*
* set PushButton state
*/
ui->btn_main->setIcon(QIcon("://images/up.png"));
ui->btn_main->setText("mainWidget");
ui->btn_main->setStyleSheet(
"QPushButton:hover{"
"background-color:rgb(186, 189, 182);"
"border-bottom:2px solid rgb(67, 154, 246);}"
"QPushButton:checked{"
"background-color:cyan;"
"border-bottom:2px solid white}"
"QPushButton:pressed{"
"background-color:rgb(67, 154, 246)}"
"QPushButton{"
"background-color:rgb(238, 238, 236);"
"border:none;"
"padding:0px 0px 0px 0px;"
"margin:0px 0px 0px 0px;}");
ui->btn_uav->setStyleSheet(
"QPushButton:hover{"
"background-color:rgb(186, 189, 182);"
"border-bottom:2px solid rgb(67, 154, 246);}"
"QPushButton:checked{"
"background-color:cyan;"
"border-bottom:2px solid white}"
"QPushButton:pressed{"
"background-color:rgb(67, 154, 246)}"
"QPushButton{"
"background-color:rgb(238, 238, 236);"
"border:none;"
"padding:0px 0px 0px 0px;"
"margin:0px 0px 0px 0px;}");
ui->btn_ugv->setStyleSheet(
"QPushButton:hover{"
"background-color:rgb(186, 189, 182);"
"border-bottom:2px solid rgb(67, 154, 246);}"
"QPushButton:checked{"
"background-color:cyan;"
"border-bottom:2px solid white}"
"QPushButton:pressed{"
"background-color:rgb(67, 154, 246)}"
"QPushButton{"
"background-color:rgb(238, 238, 236);"
"border:none;"
"padding:0px 0px 0px 0px;"
"margin:0px 0px 0px 0px;}");
// 8 -> Forward: ↑
ui->pushButton_Forward->setShortcut(Qt::Key_8);
ui->pushButton_Forward->setStyleSheet(
@ -88,15 +150,6 @@ void MainWindow::initUis(){
"QPushButton:pressed{border-image: url(://images/down_right_2.png)}");
ui->pushButton_Right_Back->setFlat(true);
/*
* init
*/
rock_widget = new JoyStick(ui->JoyStick_widget);
rock_widget->show();
}

@ -49,6 +49,7 @@ private:
JoyStick *rock_widget;
void initUis();
void setBtnStyles();
void connections();

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save