feat: 添加了部分注释
This commit is contained in:
@@ -17,7 +17,7 @@ set(PROJECT_SOURCES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ElaWidgetTools.qrc
|
||||
)
|
||||
|
||||
option(ELAWIDGETTOOLS_BUILD_STATIC_LIB "Build static library." OFF)
|
||||
option(ELAWIDGETTOOLS_BUILD_STATIC_LIB "Build static library." ON)
|
||||
|
||||
if (ELAWIDGETTOOLS_BUILD_STATIC_LIB)
|
||||
set(LIB_TYPE "STATIC")
|
||||
|
||||
@@ -168,6 +168,7 @@ void ElaCentralStackedWidget::doWindowStackSwitch(ElaWindowType::StackSwitchMode
|
||||
|
||||
void ElaCentralStackedWidget::paintEvent(QPaintEvent *event) {
|
||||
QRect targetRect = this->rect();
|
||||
// ADDZY: 左上角向右下移动(1, 1),右下角向右下收缩(10, 10)
|
||||
targetRect.adjust(1, 1, 10, 10);
|
||||
QPainter painter(this);
|
||||
painter.save();
|
||||
|
||||
@@ -56,13 +56,14 @@ ElaNavigationBar::ElaNavigationBar(QWidget *parent) : QWidget{parent}, d_ptr(new
|
||||
userCardLayout->addLayout(d->_userButtonLayout);
|
||||
userCardLayout->addWidget(d->_userCard);
|
||||
|
||||
// 搜索栏和按钮组
|
||||
// ADDZY: 导航栏展开收缩按钮
|
||||
d->_navigationButton = new ElaToolButton(this);
|
||||
d->_navigationButton->setFixedSize(40, 38);
|
||||
d->_navigationButton->setElaIcon(ElaIconType::Bars);
|
||||
d->_navigationButton->setBorderRadius(8);
|
||||
connect(d->_navigationButton, &ElaToolButton::clicked, d, &ElaNavigationBarPrivate::onNavigationButtonClicked);
|
||||
|
||||
// 搜索栏
|
||||
d->_searchButton = new ElaToolButton(this);
|
||||
d->_searchButton->setFixedSize(40, 38);
|
||||
d->_searchButton->setElaIcon(ElaIconType::MagnifyingGlass);
|
||||
@@ -433,7 +434,7 @@ void ElaNavigationBar::navigation(QString pageKey, bool isLogClicked, bool isRou
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 调整导航栏样式的函数
|
||||
void ElaNavigationBar::setDisplayMode(ElaNavigationType::NavigationDisplayMode displayMode, bool isAnimation) {
|
||||
Q_D(ElaNavigationBar);
|
||||
if (d->_currentDisplayMode == displayMode || displayMode == ElaNavigationType::Auto) {
|
||||
|
||||
@@ -25,6 +25,7 @@ ElaNavigationBarPrivate::ElaNavigationBarPrivate(QObject *parent) : QObject{pare
|
||||
|
||||
ElaNavigationBarPrivate::~ElaNavigationBarPrivate() {}
|
||||
|
||||
// ADDZY: 导航栏内部展开收缩按钮被点击
|
||||
void ElaNavigationBarPrivate::onNavigationButtonClicked() {
|
||||
Q_Q(ElaNavigationBar);
|
||||
if (_currentDisplayMode == ElaNavigationType::Compact) {
|
||||
|
||||
@@ -16,6 +16,7 @@ ElaWindowPrivate::ElaWindowPrivate(QObject *parent) : QObject{parent} {}
|
||||
|
||||
ElaWindowPrivate::~ElaWindowPrivate() {}
|
||||
|
||||
// 隐藏/显示导航栏的槽函数
|
||||
void ElaWindowPrivate::onNavigationButtonClicked() {
|
||||
if (_isWMClickedAnimationFinished) {
|
||||
_isNavigationDisplayModeChanged = false;
|
||||
|
||||
@@ -30,7 +30,8 @@ MainWindow::~MainWindow() {}
|
||||
void MainWindow::initWindow() {
|
||||
qDebug() << "Window: Init the window.";
|
||||
qDebug() << "Window: Set to fixed size";
|
||||
setIsFixedSize(true);
|
||||
// setIsFixedSize(true);
|
||||
// TODO: Set the subtitle of user info card
|
||||
setUserInfoCardSubTitle("Nothing!");
|
||||
// resize(600,480);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user