aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/popupeditor/popupeditor.cpp
diff options
context:
space:
mode:
authorGravatar Fabio Bas2009-12-13 13:30:09 +0000
committerGravatar Fabio Bas2009-12-13 13:30:09 +0000
commit91d242c991462a3c79affe72fac6fab143cbc343 (patch)
tree548dcf38102d47e46ff1be89bb58a49a8a4c3496 /src/modules/popupeditor/popupeditor.cpp
parentadded missing shortcut (diff)
downloadKVIrc-91d242c991462a3c79affe72fac6fab143cbc343.tar.gz
KVIrc-91d242c991462a3c79affe72fac6fab143cbc343.tar.bz2
KVIrc-91d242c991462a3c79affe72fac6fab143cbc343.zip
{alias,action,event,raw,popup}editor: don't use a supplementary widget to handle layout and resize events (should fix #642)
input editor: code cleaning git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3694 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/popupeditor/popupeditor.cpp')
-rw-r--r--src/modules/popupeditor/popupeditor.cpp31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/modules/popupeditor/popupeditor.cpp b/src/modules/popupeditor/popupeditor.cpp
index 7a48627b6..6dda5fe8e 100644
--- a/src/modules/popupeditor/popupeditor.cpp
+++ b/src/modules/popupeditor/popupeditor.cpp
@@ -1303,27 +1303,28 @@ KviPopupEditorWindow::KviPopupEditorWindow(KviFrame * lpFrm)
{
g_pPopupEditorWindow = this;
+ QGridLayout * g = new QGridLayout();
m_pEditor = new KviPopupEditor(this);
+ g->addWidget(m_pEditor,0,0,1,4);
- m_pBase = new QWidget(this);
- QGridLayout * g = new QGridLayout(m_pBase);
-
- QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),m_pBase);
+ QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),this);
connect(btn,SIGNAL(clicked()),this,SLOT(okClicked()));
btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT)));
- g->addWidget(btn,0,1);
+ g->addWidget(btn,1,1);
- btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),m_pBase);
+ btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),this);
connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked()));
btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT)));
- g->addWidget(btn,0,2);
+ g->addWidget(btn,1,2);
- btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),m_pBase);
+ btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this);
connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked()));
btn->setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DISCARD)));
- g->addWidget(btn,0,3);
+ g->addWidget(btn,1,3);
+ g->setRowStretch(0,1);
g->setColumnStretch(0,1);
+ setLayout(g);
}
KviPopupEditorWindow::~KviPopupEditorWindow()
@@ -1352,23 +1353,11 @@ QPixmap * KviPopupEditorWindow::myIconPtr()
return g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUP);
}
-void KviPopupEditorWindow::resizeEvent(QResizeEvent *)
-{
- if(m_pBase)
- {
- int hght = m_pBase->sizeHint().height();
- if(m_pEditor)
- m_pEditor->setGeometry(0,0,width(),height() - hght);
- m_pBase->setGeometry(0, height() - hght, width(), hght);
- }
-}
-
void KviPopupEditorWindow::fillCaptionBuffers()
{
m_szPlainTextCaption = __tr2qs_ctx("Popup Editor","editor");
}
-
void KviPopupEditorWindow::getConfigGroupName(QString &szName)
{
szName = "popupeditor";