]> git.lyx.org Git - lyx.git/commitdiff
Port of Martin Vermeer's QNote work: fix of framed and shaded note.
authorAbdelrazak Younes <younes@lyx.org>
Wed, 16 Aug 2006 08:57:00 +0000 (08:57 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 16 Aug 2006 08:57:00 +0000 (08:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14696 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/QNote.C
src/frontends/qt4/QNoteDialog.C
src/frontends/qt4/ui/QNoteUi.ui

index 6d49ae2f4bae67b685dd6dbd4e590537dc4e3260..24118ad6d551913276534593fb3bc12757b6373a 100644 (file)
@@ -46,18 +46,9 @@ void QNote::build_dialog()
 
 void QNote::update_contents()
 {
-       // FIXME: This needs fixing. Framed and Shaded is not working.
        QRadioButton * rb = 0;
 
        switch (controller().params().type) {
-       case InsetNoteParams::Framed:
-               //rb = dialog_->framedRB;
-               rb = dialog_->greyedoutRB;
-               break;
-       case InsetNoteParams::Shaded:
-               //rb = dialog_->shadedRB;
-               rb = dialog_->greyedoutRB;
-               break;
        case InsetNoteParams::Note:
                rb = dialog_->noteRB;
                break;
@@ -67,6 +58,12 @@ void QNote::update_contents()
        case InsetNoteParams::Greyedout:
                rb = dialog_->greyedoutRB;
                break;
+       case InsetNoteParams::Framed:
+               rb = dialog_->framedRB;
+               break;
+       case InsetNoteParams::Shaded:
+               rb = dialog_->shadedRB;
+               break;
        }
 
        rb->setChecked(true);
@@ -81,6 +78,10 @@ void QNote::apply()
                type = InsetNoteParams::Greyedout;
        else if (dialog_->commentRB->isChecked())
                type = InsetNoteParams::Comment;
+       else if (dialog_->framedRB->isChecked())
+               type = InsetNoteParams::Framed;
+       else if (dialog_->shadedRB->isChecked())
+               type = InsetNoteParams::Shaded;
        else
                type = InsetNoteParams::Note;
 
index 948afceaee87bbb0064969b4c19cc81f0ef09104..74379167984d113361f5337c398be473d80f1067 100644 (file)
@@ -33,6 +33,8 @@ QNoteDialog::QNoteDialog(QNote * form)
     connect( noteRB, SIGNAL( toggled(bool) ), this, SLOT( change_adaptor() ) );
     connect( greyedoutRB, SIGNAL( toggled(bool) ), this, SLOT( change_adaptor() ) );
     connect( commentRB, SIGNAL( toggled(bool) ), this, SLOT( change_adaptor() ) );
+    connect( framedRB, SIGNAL( toggled(bool) ), this, SLOT( change_adaptor() ) );
+    connect( shadedRB, SIGNAL( toggled(bool) ), this, SLOT( change_adaptor() ) );
 }
 
 
index 644a8075ae118a0135e0fc99ec6b934580b65c35..e27678d676876a44854eb0fa05826d20f8e0b291 100644 (file)
         </property>
        </widget>
       </item>
+      <item>
+       <widget class="QRadioButton" name="framedRB" >
+        <property name="toolTip" >
+         <string>Framed in box</string>
+        </property>
+        <property name="text" >
+         <string>&amp;Framed</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QRadioButton" name="shadedRB" >
+        <property name="toolTip" >
+         <string>Box with shaded background</string>
+        </property>
+        <property name="text" >
+         <string>&amp;Shaded</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>