Skip to content

Commit

Permalink
fix: Fixed the Compact Mode issue (#42)
Browse files Browse the repository at this point in the history
Fixed the Compact Mode issue

Bug: https://pms.uniontech.com/bug-view-202377.html
Log: Fixed the Compact Mode issue
  • Loading branch information
pengfeixx authored Oct 23, 2024
1 parent 111df39 commit 7301c49
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/mainwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,29 @@ void MainWidget::setupUi(QWidget *Widget)
connect(m_plainTextEdit, &QPlainTextEdit::redoAvailable, redoBtn, &QPushButton::setEnabled);
redoBtn->setEnabled(false);

if (DGuiApplicationHelper::instance()->sizeMode() == DGuiApplicationHelper::CompactMode) {
languageSelectBox->setFixedSize(160, 24);
m_copyBtn->setMaximumSize(QSize(24, 24));
m_exportBtn->setMaximumSize(QSize(24, 24));
undoBtn->setMaximumSize(24, 24);
redoBtn->setMaximumSize(24, 24);
}
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, [=](DGuiApplicationHelper::SizeMode sizeMode) {
if (sizeMode == DGuiApplicationHelper::NormalMode) {
languageSelectBox->setFixedSize(160, 36);
m_copyBtn->setMaximumSize(QSize(36, 36));
m_exportBtn->setMaximumSize(QSize(36, 36));
undoBtn->setMaximumSize(36, 36);
redoBtn->setMaximumSize(36, 36);
} else {
languageSelectBox->setFixedSize(160, 24);
m_copyBtn->setMaximumSize(QSize(24, 24));
m_exportBtn->setMaximumSize(QSize(24, 24));
undoBtn->setMaximumSize(24, 24);
redoBtn->setMaximumSize(24, 24);
}
});

//占位用空白控件
m_emptyWidget = new QWidget;
m_emptyWidget->setMinimumSize(36 * 2, 36 * 2);
Expand Down

0 comments on commit 7301c49

Please sign in to comment.