Skip to content

Commit 9baba9f

Browse files
committed
fix: v2.3.1 最后微调整;
1 parent 4c7dc30 commit 9baba9f

8 files changed

Lines changed: 873 additions & 859 deletions

File tree

lang/en_US/winghex_en_US.ts

Lines changed: 283 additions & 283 deletions
Large diffs are not rendered by default.

lang/zh_CN/winghex_zh_CN.ts

Lines changed: 283 additions & 283 deletions
Large diffs are not rendered by default.

lang/zh_TW/winghex_zh_TW.ts

Lines changed: 283 additions & 283 deletions
Large diffs are not rendered by default.

screenshot.png

604 KB
Loading

src/dialog/mainwindow.cpp

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ MainWindow::MainWindow(SplashDialog *splash) : FramelessMainWindow() {
112112
auto font = _editArea->font();
113113
auto fm = QFontMetrics(font);
114114
_editArea->setAlignment(Qt::AlignCenter);
115-
_editArea->setFixedWidth(fm.horizontalAdvance('A') * 5); // ASCII or HEX
116-
_editArea->setEnabled(false);
115+
// ASCII or HEX or NONE
116+
_editArea->setFixedWidth(fm.horizontalAdvance('A') * 5);
117117
m_status->addWidget(_editArea);
118118

119119
auto separator = new QFrame(m_status);
@@ -768,7 +768,6 @@ MainWindow::buildUpFindResultDock(ads::CDockManager *dock,
768768
});
769769

770770
auto header = m_findresult->horizontalHeader();
771-
header->setSectionResizeMode(QHeaderView::Interactive);
772771
header->setSectionResizeMode(3, QHeaderView::Stretch);
773772
header->setSectionResizeMode(4, QHeaderView::Stretch);
774773
auto dw = buildDockWidget(dock, QStringLiteral("FindResult"),
@@ -2928,7 +2927,6 @@ void MainWindow::on_editableAreaClicked(int area) {
29282927
} else {
29292928
_editArea->setText(QStringLiteral("HEX"));
29302929
}
2931-
_editArea->setEnabled(currentEditor() != nullptr);
29322930
}
29332931

29342932
void MainWindow::on_viewtxt() {
@@ -4417,11 +4415,27 @@ void MainWindow::closeEvent(QCloseEvent *event) {
44174415

44184416
void MainWindow::showEvent(QShowEvent *event) {
44194417
FramelessMainWindow::showEvent(event);
4420-
if (_showEvents) {
4421-
_showEvents();
4418+
static bool firstInit = true;
4419+
if (firstInit) {
4420+
if (_showEvents) {
4421+
_showEvents();
4422+
_showEvents = {};
4423+
}
4424+
4425+
connect(
4426+
m_findresult->horizontalHeader(), &QHeaderView::sectionResized,
4427+
this,
4428+
[this]() {
4429+
QTimer::singleShot(0, [this]() {
4430+
auto header = m_findresult->horizontalHeader();
4431+
header->setSectionResizeMode(QHeaderView::Interactive);
4432+
});
4433+
},
4434+
Qt::SingleShotConnection);
4435+
44224436
PluginSystem::instance().dispatchEvent(
44234437
IWingPlugin::RegisteredEvent::AppReady, {});
4424-
_showEvents = {};
4438+
firstInit = false;
44254439
}
44264440
}
44274441

src/dialog/mainwindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ private slots:
286286

287287
protected:
288288
virtual void closeEvent(QCloseEvent *event) override;
289-
void showEvent(QShowEvent *event) override;
289+
virtual void showEvent(QShowEvent *event) override;
290290
virtual bool eventFilter(QObject *watched, QEvent *event) override;
291291

292292
private:

0 commit comments

Comments
 (0)