fix: 修复在 wayland 下 dock 无法使用的问题;
This commit is contained in:
parent
f299b75198
commit
2c039597f0
|
@ -410,72 +410,72 @@
|
|||
<context>
|
||||
<name>EditorView</name>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="82"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="83"/>
|
||||
<source>Cut</source>
|
||||
<translation>剪切</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="84"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="85"/>
|
||||
<source>CutHex</source>
|
||||
<translation>剪切(十六进制)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="86"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="87"/>
|
||||
<source>Copy</source>
|
||||
<translation>复制</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="88"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="89"/>
|
||||
<source>CopyHex</source>
|
||||
<translation>复制(十六进制)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="90"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="91"/>
|
||||
<source>Paste</source>
|
||||
<translation>粘贴</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="92"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="93"/>
|
||||
<source>PasteHex</source>
|
||||
<translation>粘贴(十六进制)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="94"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="95"/>
|
||||
<source>Delete</source>
|
||||
<translation>删除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="97"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="98"/>
|
||||
<source>Find</source>
|
||||
<translation>查找</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="99"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="100"/>
|
||||
<source>Goto</source>
|
||||
<translation>跳转</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="101"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="102"/>
|
||||
<source>Fill</source>
|
||||
<translation>填充</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="103"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="104"/>
|
||||
<source>MetaData</source>
|
||||
<translation>标注</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="105"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="106"/>
|
||||
<source>BookMark</source>
|
||||
<translation>书签</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="294"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="295"/>
|
||||
<source>Untitled</source>
|
||||
<translation>未命名</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="878"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="879"/>
|
||||
<source>Not allowed operation in non-UI thread</source>
|
||||
<translation>该操作在非 UI 线程非法</translation>
|
||||
</message>
|
||||
|
|
|
@ -410,72 +410,72 @@
|
|||
<context>
|
||||
<name>EditorView</name>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="82"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="83"/>
|
||||
<source>Cut</source>
|
||||
<translation>剪切</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="84"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="85"/>
|
||||
<source>CutHex</source>
|
||||
<translation>剪切(十六進制)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="86"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="87"/>
|
||||
<source>Copy</source>
|
||||
<translation>複製</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="88"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="89"/>
|
||||
<source>CopyHex</source>
|
||||
<translation>複製(十六進制)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="90"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="91"/>
|
||||
<source>Paste</source>
|
||||
<translation>粘貼</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="92"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="93"/>
|
||||
<source>PasteHex</source>
|
||||
<translation>粘貼(十六進制)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="94"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="95"/>
|
||||
<source>Delete</source>
|
||||
<translation>刪除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="97"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="98"/>
|
||||
<source>Find</source>
|
||||
<translation>查找</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="99"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="100"/>
|
||||
<source>Goto</source>
|
||||
<translation>跳轉</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="101"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="102"/>
|
||||
<source>Fill</source>
|
||||
<translation>填充</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="103"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="104"/>
|
||||
<source>MetaData</source>
|
||||
<translation>標注</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="105"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="106"/>
|
||||
<source>BookMark</source>
|
||||
<translation>書簽</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="294"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="295"/>
|
||||
<source>Untitled</source>
|
||||
<translation>未命名</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/control/editorview.cpp" line="878"/>
|
||||
<location filename="../../src/control/editorview.cpp" line="879"/>
|
||||
<source>Not allowed operation in non-UI thread</source>
|
||||
<translation>該操作在非 UI 線程非法</translation>
|
||||
</message>
|
||||
|
|
11
main.cpp
11
main.cpp
|
@ -20,6 +20,17 @@ 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
|
||||
if (qgetenv("XDG_SESSION_TYPE")
|
||||
.compare(QByteArrayLiteral("wayland"), Qt::CaseInsensitive) == 0) {
|
||||
qputenv("QT_QPA_PLATFORM", "xcb");
|
||||
}
|
||||
#endif
|
||||
|
||||
QApplication::setApplicationName(APP_NAME);
|
||||
QApplication::setOrganizationName(APP_ORG);
|
||||
QApplication::setApplicationVersion(WINGHEX_VERSION);
|
||||
|
|
|
@ -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);
|
||||
m_hex->setScaleRate(1);
|
||||
hexLayout->addWidget(m_hex, 1);
|
||||
m_goto = new GotoWidget(this);
|
||||
connect(m_goto, &GotoWidget::jumpToLine, this,
|
||||
|
|
Loading…
Reference in New Issue