From 2faea5ed45fe9847fe754cd6702fb2d836005342 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 19 Jan 2009 17:53:20 -0500 Subject: Changed Fraction and Script to be GridLayouts --- sigmodr/ScriptWidget.cpp | 8 ++-- sigmodr/gui/fraction.ui | 109 ++++++++++++++++++++++++++++------------------- sigmodr/gui/script.ui | 47 +++++++------------- 3 files changed, 86 insertions(+), 78 deletions(-) diff --git a/sigmodr/ScriptWidget.cpp b/sigmodr/ScriptWidget.cpp index 9a944035..3399074d 100644 --- a/sigmodr/ScriptWidget.cpp +++ b/sigmodr/ScriptWidget.cpp @@ -70,7 +70,7 @@ Sigmodr::ScriptWidget::ScriptWidget(QWidget* parent, const Sigcore::Script& valu collection->action("edit_cut")->setVisible(false); collection->action("edit_copy")->setVisible(false); collection->action("edit_paste")->setVisible(false); - m_view->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); + m_view->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); m_view->setMinimumHeight(300); KXmlGuiWindow* topLevel = qobject_cast(KApplication::kApplication()->activeWindow()); if (topLevel) @@ -79,7 +79,7 @@ Sigmodr::ScriptWidget::ScriptWidget(QWidget* parent, const Sigcore::Script& valu if (menu) m_view->setContextMenu(menu); } - layoutScript->addWidget(m_view); + gridLayout->addWidget(m_view, 1, 1); connect(m_document, SIGNAL(textChanged(KTextEditor::Document*)), this, SLOT(scriptChanged())); connect(m_view, SIGNAL(focusIn(KTextEditor::View*)), this, SLOT(focused(KTextEditor::View*))); connect(m_view, SIGNAL(focusOut(KTextEditor::View*)), this, SLOT(unfocused(KTextEditor::View*))); @@ -88,9 +88,9 @@ Sigmodr::ScriptWidget::ScriptWidget(QWidget* parent, const Sigcore::Script& valu { KMessageBox::information(this, "A KDE text-editor component could not be found.\nPlease check your KDE installation.\n\nEnhanced editing will not be used.", "KDE editor component not found", "kte-component"); m_simpleEdit = new KTextEdit(m_value.script(), this); - m_simpleEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); + m_simpleEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); m_simpleEdit->setMinimumHeight(300); - layoutScript->addWidget(m_simpleEdit); + gridLayout->addWidget(m_simpleEdit, 1, 1); connect(m_simpleEdit, SIGNAL(textChanged()), this, SLOT(scriptChanged())); return; } diff --git a/sigmodr/gui/fraction.ui b/sigmodr/gui/fraction.ui index f0b70c2b..ccbc2dd1 100644 --- a/sigmodr/gui/fraction.ui +++ b/sigmodr/gui/fraction.ui @@ -1,51 +1,74 @@ formFraction - - - - - - - Numerator - - - Numerator of the fraction - - - Numerator of the fraction - - - Numerator of the fraction - - - 0 - - - - - - - Denominator - - - Denominator of the fraction - - - Denominator of the fraction - - - Denominator of the fraction - - - 1 - - - - + + + + + Numerator: + + + Qt::AlignRight|Qt::AlignVCenter + + + + + + + Numerator of the fraction + + + Numerator of the fraction + + + Numerator of the fraction + + + 0 + + + + + + + Denominator: + + + Qt::AlignRight|Qt::AlignVCenter + + - + + + + Denominator of the fraction + + + Denominator of the fraction + + + Denominator of the fraction + + + 1 + + + + + + + Value: + + + Qt::AlignRight|Qt::AlignVCenter + + + + + + Qt::AlignRight|Qt::AlignVCenter + true diff --git a/sigmodr/gui/script.ui b/sigmodr/gui/script.ui index 079f86e6..5086ce22 100644 --- a/sigmodr/gui/script.ui +++ b/sigmodr/gui/script.ui @@ -7,43 +7,28 @@ 0 - - - - - Interpreter + + + + + Interpreter: - - The language the script is written in + + Qt::AlignRight|Qt::AlignVCenter - - The language the script is written in - - - The language the script is written in - - - - - - - - - - Code - - - The code for the script - - - The code for the script + + + + + + + Script: - - The code for the script + + Qt::AlignRight|Qt::AlignTop - -- cgit