Use TabWidget in Notepad instead of splitter

The splitter layout did not really work for small screen
resolutions. And in general it is nicer to have a very wide
recipient selection layout.

So although this means an extra click for most users the
layout improvement is probably worth it.

GnuPG-Bug-Id: T3841
parent 621e4c24
......@@ -56,7 +56,7 @@
#include <QProgressBar>
#include <QPushButton>
#include <QRadioButton>
#include <QSplitter>
#include <QTabWidget>
#include <QTextEdit>
#include <QToolBar>
#include <QVBoxLayout>
......@@ -64,7 +64,6 @@
#include <KLocalizedString>
#include <KColorScheme>
#include <KMessageBox>
#include <KSplitterCollapserButton>
#include <KSharedConfig>
#include <KConfigGroup>
......@@ -130,23 +129,28 @@ public:
mStatusLay->addLayout(progLay);
vLay->addLayout(mStatusLay, 0.1);
auto splitter = new QSplitter;
vLay->addWidget(splitter, 1);
auto tabWidget = new QTabWidget;
vLay->addWidget(tabWidget, 1);
splitter->addWidget(mEdit);
tabWidget->addTab(mEdit, QIcon::fromTheme("edittext"), i18n("Notepad"));
// The recipients area
auto recipientsWidget = new QWidget;
auto recipientsVLay = new QVBoxLayout(recipientsWidget);
auto protocolSelectionLay = new QHBoxLayout;
recipientsVLay->addLayout(protocolSelectionLay);
protocolSelectionLay->addWidget(new QLabel(i18n("<h3>Recipients:</h3>")));
bool pgpOnly = KeyCache::instance()->pgpOnly();
if (!pgpOnly) {
recipientsVLay->addLayout(protocolSelectionLay);
}
protocolSelectionLay->addWidget(new QLabel(i18n("<h3>Protocol:</h3>")));
protocolSelectionLay->addStretch(-1);
// Once S/MIME is supported add radio for S/MIME here.
recipientsVLay->addWidget(mSigEncWidget);
splitter->addWidget(recipientsWidget);
new KSplitterCollapserButton(recipientsWidget, splitter);
tabWidget->addTab(recipientsWidget, QIcon::fromTheme("contact-new-symbolic"),
i18n("Recipients"));
mEdit->setPlaceholderText("Enter a message to encrypt or decrypt...");
......
Markdown is supported
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