]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/InsetParamsDialog.cpp
Few string fixes from Dan.
[lyx.git] / src / frontends / qt / InsetParamsDialog.cpp
index ebac60b721a5a40a0782a40c307dc77ac940bf6b..67cbfdd94e1f5182c5ad791a3c3f56f935fc17dd 100644 (file)
@@ -80,6 +80,8 @@ InsetParamsDialog::InsetParamsDialog(GuiView & lv, InsetParamsWidget * widget)
        widget->dialogTitle()), d(new Private)
 {
        setupUi(this);
+       // Remove margins since the widget is embedded in dialog which provides them
+       widget->layout()->setContentsMargins(0, 0, 0, 0);
        setInsetParamsWidget(widget);
        immediateApplyCB->setChecked(false);
        synchronizedCB->setChecked(true);
@@ -87,6 +89,8 @@ InsetParamsDialog::InsetParamsDialog(GuiView & lv, InsetParamsWidget * widget)
        setFocusProxy(widget);
        newPB = buttonBox->addButton(qt_("Ne&w Inset"),
                             QDialogButtonBox::ActionRole);
+       // fix height to minimum
+       setFixedHeight(sizeHint().height());
 }
 
 InsetParamsDialog::~InsetParamsDialog()
@@ -193,14 +197,16 @@ docstring InsetParamsDialog::checkWidgets(bool immediate)
                ? d->widget_->creationCode() : LFUN_INSET_MODIFY;
        bool const lfun_ok = lyx::getStatus(FuncRequest(code, argument)).enabled();
 
+       bool const changed_inset = ins && (ins != d->inset_ || d->changed_);
        buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!immediate && widget_ok
-                                                           && !read_only && valid_argument);
-       bool const can_be_restored = !immediate && !read_only
-                       && ins && (ins != d->inset_ || d->changed_);
+                                                           && !read_only && valid_argument
+                                                           && (!ins || changed_inset));
+       bool const can_be_restored = !immediate && !read_only && changed_inset;
        buttonBox->button(QDialogButtonBox::Reset)->setEnabled(can_be_restored);
-       buttonBox->button(QDialogButtonBox::Apply)->setEnabled(ins && !immediate
+       buttonBox->button(QDialogButtonBox::Apply)->setEnabled(!immediate
                                                               && lfun_ok && widget_ok
-                                                              && !read_only && valid_argument);
+                                                              && !read_only && valid_argument
+                                                              && changed_inset);
        immediateApplyCB->setEnabled(ins && !read_only);
        // This seems to be the only way to access custom buttons
        QList<QAbstractButton*> buttons = buttonBox->buttons();