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