Merge branch '1115' into 'dbus-interface'
bug#93787 页面间距问题 See merge request kylin-desktop/kylin-nm!436
This commit is contained in:
commit
b875afb578
|
@ -122,7 +122,7 @@ void MainWindow::initWindowProperties()
|
|||
this->setFixedSize(MAINWINDOW_WIDTH, MAINWINDOW_HEIGHT);
|
||||
// //绘制毛玻璃特效
|
||||
// this->setStyleSheet("background:transparent"); //透明
|
||||
// this->setAttribute(Qt::WA_TranslucentBackground, true); //半透明
|
||||
// this->setAttribute(Qt::WA_TranslucentBackground, true); //透明
|
||||
this->setWindowOpacity(0.8);
|
||||
|
||||
QPainterPath path;
|
||||
|
@ -131,6 +131,15 @@ void MainWindow::initWindowProperties()
|
|||
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon())); //背景模糊
|
||||
}
|
||||
|
||||
void MainWindow::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QPainter painter(this);
|
||||
painter.setRenderHint(QPainter::Antialiasing); // 反锯齿;
|
||||
painter.setPen(Qt::transparent);
|
||||
auto rect = this->rect();
|
||||
painter.drawRoundedRect(rect, 6, 6); //窗口圆角
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MainWindow::initUI 初始化窗口内控件
|
||||
*/
|
||||
|
@ -139,6 +148,7 @@ void MainWindow::initUI()
|
|||
m_centralWidget = new QTabWidget(this);
|
||||
this->setCentralWidget(m_centralWidget);
|
||||
m_centralWidget->tabBar()->setFixedWidth(this->width());
|
||||
m_centralWidget->tabBar()->setStyleSheet("QTabBar::tab{min-height:40px}");
|
||||
m_lanWidget = new LanPage(m_centralWidget);
|
||||
m_wlanWidget = new WlanPage(m_centralWidget);
|
||||
connect(this, &MainWindow::mainWindowVisibleChanged, m_wlanWidget, &WlanPage::onMainWindowVisibleChanged);
|
||||
|
@ -157,6 +167,7 @@ void MainWindow::initUI()
|
|||
m_tabBarLayout->addWidget(m_wlanLabel);
|
||||
m_centralWidget->tabBar()->setLayout(m_tabBarLayout);
|
||||
connect(m_centralWidget, &QTabWidget::currentChanged, m_wlanWidget, &WlanPage::onWlanPageVisibleChanged);
|
||||
// m_centralWidget->hide();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -96,6 +96,7 @@ public slots:
|
|||
protected:
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
void paintEvent(QPaintEvent *event);
|
||||
|
||||
private:
|
||||
void firstlyStart(); //一级启动
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#define MAIN_LAYOUT_MARGINS 0,0,0,0
|
||||
#define MAIN_LAYOUT_SPACING 0
|
||||
#define TITLE_FRAME_HEIGHT 52
|
||||
#define TITLE_FRAME_HEIGHT 50 //TabWidget的tab和widget有间隙,和设计稿看起来一致就不能设为设计稿里的高度
|
||||
#define TITLE_LAYOUT_MARGINS 24,0,24,0
|
||||
#define DEVICE_LAYOUT_MARGINS 24,0,24,8
|
||||
#define DEVICE_COMBOBOX_WIDTH 150
|
||||
|
|
Loading…
Reference in New Issue