Commit 5e9c140e authored by Eugene Popov's avatar Eugene Popov 🇺🇦 Committed by Nate Graham
Browse files

Remove redundant close button at the bottom of the preview window

This commit removes a redundant close button that duplicates the close
button in the title bar. Also, the preview window can be closed using
the keyboard shortcuts Ctrl+W / Alt+f4 / Esc.

BUG: 434517
FIXED-IN: 21.12
parent 37fe1d86
Pipeline #84929 passed with stage
in 2 minutes and 35 seconds
......@@ -47,14 +47,11 @@ ArkViewer::ArkViewer()
{
setupUi(this);
m_buttonBox->button(QDialogButtonBox::Close)->setShortcut(Qt::Key_Escape);
// Bug 369390: This prevents the Enter key from closing the window.
m_buttonBox->button(QDialogButtonBox::Close)->setAutoDefault(false);
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QMainWindow::close);
KStandardAction::close(this, &QMainWindow::close, actionCollection());
QAction *closeAction = actionCollection()->addAction(QStringLiteral("close"), this, &ArkViewer::close);
closeAction->setShortcut(Qt::Key_Escape);
setXMLFile(QStringLiteral("ark_viewer.rc"));
setupGUI(ToolBar);
}
......@@ -197,7 +194,7 @@ bool ArkViewer::viewInInternalViewer(const KService::Ptr viewer, const QString&
}
// Insert the KPart into its placeholder.
centralWidget()->layout()->replaceWidget(m_partPlaceholder, m_part.data()->widget());
mainLayout->insertWidget(0, m_part->widget());
QAction* action = actionCollection()->addAction(QStringLiteral("help_about_kpart"));
const KPluginMetaData partMetaData = m_part->metaData();
......
......@@ -14,7 +14,7 @@
<string notr="true">MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="mainLayout">
<property name="spacing">
<number>0</number>
</property>
......@@ -30,9 +30,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="m_partPlaceholder" native="true"/>
</item>
<item>
<widget class="QWidget" name="m_mimeWidget" native="true">
<property name="sizePolicy">
......@@ -75,16 +72,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="m_buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment