diff options
| author | 2009-12-13 13:30:09 +0000 | |
|---|---|---|
| committer | 2009-12-13 13:30:09 +0000 | |
| commit | 91d242c991462a3c79affe72fac6fab143cbc343 (patch) | |
| tree | 548dcf38102d47e46ff1be89bb58a49a8a4c3496 /src/modules/raweditor/raweditor.cpp | |
| parent | added missing shortcut (diff) | |
| download | KVIrc-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/raweditor/raweditor.cpp')
| -rw-r--r-- | src/modules/raweditor/raweditor.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/modules/raweditor/raweditor.cpp b/src/modules/raweditor/raweditor.cpp index 42bd2a487..67f5ad225 100644 --- a/src/modules/raweditor/raweditor.cpp +++ b/src/modules/raweditor/raweditor.cpp @@ -473,27 +473,29 @@ KviRawEditorWindow::KviRawEditorWindow(KviFrame * lpFrm) { g_pRawEditorWindow = this; - m_pEditor = new KviRawEditor(this); + QGridLayout * g = new QGridLayout(); - m_pBase = new QWidget(this); - QGridLayout * g = new QGridLayout(m_pBase); + m_pEditor = new KviRawEditor(this); + g->addWidget(m_pEditor,0,0,1,4); - 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); } KviRawEditorWindow::~KviRawEditorWindow() @@ -522,13 +524,6 @@ QPixmap * KviRawEditorWindow::myIconPtr() return g_pIconManager->getSmallIcon(KVI_SMALLICON_RAWEVENT); } -void KviRawEditorWindow::resizeEvent(QResizeEvent *) -{ - int hght = m_pBase->sizeHint().height(); - m_pEditor->setGeometry(0,0,width(),height()- hght); - m_pBase->setGeometry(0,height() - hght,width(),hght); -} - void KviRawEditorWindow::fillCaptionBuffers() { m_szPlainTextCaption = __tr2qs_ctx("Raw Editor","editor"); |
