diff --git a/3rdparty/QHexView/qhexview.cpp b/3rdparty/QHexView/qhexview.cpp index b5adb87..a8cdd58 100644 --- a/3rdparty/QHexView/qhexview.cpp +++ b/3rdparty/QHexView/qhexview.cpp @@ -171,7 +171,8 @@ QHexView::QHexView(QWidget *parent) f.setStyleHint(QFont::TypeWriter); } - m_fontSize = f.pointSizeF(); + m_fontSize = qApp->font().pointSizeF(); + f.setPointSizeF(m_fontSize); m_cursor = new QHexCursor(this); this->setFont(f); @@ -554,7 +555,7 @@ bool QHexView::copy(bool hex) { qreal QHexView::fontSize() const { return m_fontSize; } void QHexView::setScaleRate(qreal rate) { - if (rate >= 0.2 && rate < 2.01) { + if (rate >= 0.2 && rate < 3.01) { m_scaleRate = rate; setFontSize(fontSize()); emit scaleRateChanged(); @@ -576,7 +577,6 @@ void QHexView::setFontSize(qreal size) { auto font = this->font(); font.setPointSizeF(size * m_scaleRate); this->setFont(font); - m_fontSize = size; } QColor QHexView::selectionColor() const { return m_renderer->selectionColor(); } diff --git a/lang/zh_CN/winghex_zh_CN.ts b/lang/zh_CN/winghex_zh_CN.ts index a5f71b6..369206c 100644 --- a/lang/zh_CN/winghex_zh_CN.ts +++ b/lang/zh_CN/winghex_zh_CN.ts @@ -410,72 +410,72 @@ EditorView - + Cut 剪切 - + CutHex 剪切(十六进制) - + Copy 复制 - + CopyHex 复制(十六进制) - + Paste 粘贴 - + PasteHex 粘贴(十六进制) - + Delete 删除 - + Find 查找 - + Goto 跳转 - + Fill 填充 - + MetaData 标注 - + BookMark 书签 - + Untitled 未命名 - + Not allowed operation in non-UI thread 该操作在非 UI 线程非法 @@ -2617,17 +2617,17 @@ QHexView - + Foreground: 前景色: - + Background: 背景色: - + Comment: 说明: diff --git a/lang/zh_TW/winghex_zh_TW.ts b/lang/zh_TW/winghex_zh_TW.ts index ebe5793..52cf632 100644 --- a/lang/zh_TW/winghex_zh_TW.ts +++ b/lang/zh_TW/winghex_zh_TW.ts @@ -410,72 +410,72 @@ EditorView - + Cut 剪切 - + CutHex 剪切(十六進制) - + Copy 複製 - + CopyHex 複製(十六進制) - + Paste 粘貼 - + PasteHex 粘貼(十六進制) - + Delete 刪除 - + Find 查找 - + Goto 跳轉 - + Fill 填充 - + MetaData 標注 - + BookMark 書簽 - + Untitled 未命名 - + Not allowed operation in non-UI thread 該操作在非 UI 線程非法 @@ -2617,17 +2617,17 @@ QHexView - + Foreground: 前景色: - + Background: 背景色: - + Comment: 說明: diff --git a/main.cpp b/main.cpp index 959928e..e867d33 100644 --- a/main.cpp +++ b/main.cpp @@ -20,6 +20,18 @@ int main(int argc, char *argv[]) { QApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); +#ifdef Q_OS_LINUX + // fix wayland issue (a workaround): floating dock not work + // reference: + // https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/ + // issues/714#issuecomment-2802752677 + auto denv = qgetenv("XDG_SESSION_TYPE"); + if (denv.isEmpty() || + denv.compare(QByteArrayLiteral("wayland"), Qt::CaseInsensitive) == 0) { + qputenv("QT_QPA_PLATFORM", "xcb"); + } +#endif + QApplication::setApplicationName(APP_NAME); QApplication::setOrganizationName(APP_ORG); QApplication::setApplicationVersion(WINGHEX_VERSION); diff --git a/src/control/editorview.cpp b/src/control/editorview.cpp index 3abbda0..ff72f3d 100644 --- a/src/control/editorview.cpp +++ b/src/control/editorview.cpp @@ -63,7 +63,8 @@ EditorView::EditorView(QWidget *parent) auto hexLayout = new QVBoxLayout(m_hexContainer); hexLayout->setSpacing(0); hexLayout->setContentsMargins(0, 0, 0, 0); - m_hex = new QHexView; + m_hex = new QHexView(this); + hexLayout->addWidget(m_hex, 1); m_goto = new GotoWidget(this); connect(m_goto, &GotoWidget::jumpToLine, this,