]> git.lyx.org Git - features.git/commitdiff
Change the paragraph settings dialog:
authorAbdelrazak Younes <younes@lyx.org>
Thu, 27 Sep 2007 08:56:18 +0000 (08:56 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 27 Sep 2007 08:56:18 +0000 (08:56 +0000)
- now floating by default
- re-layout horizontally for minimum mouse movement.
- allow key shortcuts.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20530 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/Dialogs.cpp
src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/ui/ParagraphUi.ui

index 217b1974af56d4055d461f0cf118397784759e45..be94ddecbb4b7f327c82cd2b4c3729ab0397980b 100644 (file)
@@ -172,13 +172,11 @@ Dialog * Dialogs::build(string const & name)
        } else if (name == "note") {
                dialog = new GuiNoteDialog(lyxview_);
        } else if (name == "paragraph") {
-#ifdef Q_WS_MACX
-               // On Mac show as a drawer at the right
-               dialog = new DockView<ControlParagraph, GuiParagraph>(guiview, name,
-                       Qt::RightDockWidgetArea, Qt::Drawer);
-#else
-               dialog = new DockView<ControlParagraph, GuiParagraph>(guiview, name);
-#endif
+               DockView<ControlParagraph, GuiParagraph> * dv =
+                       new DockView<ControlParagraph, GuiParagraph>(guiview,
+                       name, Qt::NoDockWidgetArea);
+               dv->setFloating(true);
+               dialog = dv;
        } else if (name == "prefs") {
                dialog = new GuiPrefsDialog(lyxview_);
        } else if (name == "print") {
index d1bec5c72f33a48500423ea3e48ffaac0a966ae3..b9d43faf04bd6699650b072decfbda0809de9de6 100644 (file)
@@ -289,7 +289,7 @@ bool GuiApplication::notify(QObject * receiver, QEvent * event)
                if (e.type_ == support::ErrorException) {
                        Alert::error(e.title_, e.details_);
                        LyX::cref().emergencyCleanup();
-                       ::exit(1);
+                       QApplication::exit(1);
                } else if (e.type_ == support::WarningException) {
                        Alert::warning(e.title_, e.details_);
                        return return_value;
@@ -298,12 +298,12 @@ bool GuiApplication::notify(QObject * receiver, QEvent * event)
        catch (std::exception  const & e) {
                lyxerr << "Caught \"normal\" exception: " << e.what() << endl;
                LyX::cref().emergencyCleanup();
-               ::exit(1);
+               QApplication::exit(1);
        }
        catch (...) {
                lyxerr << "Caught some really weird exception..." << endl;
                LyX::cref().emergencyCleanup();
-               ::exit(1);
+               QApplication::exit(1);
        }
 
        return return_value;
index 02b3906ca08b51b0e590bf45c043ae38a74dc3c1..bef20904e588abbc5f2a94b687b4a1c10e755dc8 100644 (file)
@@ -1,15 +1,12 @@
 <ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
  <class>ParagraphUi</class>
  <widget class="QWidget" name="ParagraphUi" >
   <property name="geometry" >
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>222</width>
-    <height>488</height>
+    <width>496</width>
+    <height>176</height>
    </rect>
   </property>
   <property name="sizePolicy" >
   <property name="windowTitle" >
    <string/>
   </property>
-  <widget class="QWidget" name="" >
-   <property name="geometry" >
-    <rect>
-     <x>10</x>
-     <y>440</y>
-     <width>201</width>
-     <height>26</height>
-    </rect>
-   </property>
-   <layout class="QHBoxLayout" >
-    <property name="margin" >
-     <number>0</number>
-    </property>
-    <property name="spacing" >
-     <number>6</number>
-    </property>
-    <item>
-     <widget class="QPushButton" name="restorePB" >
-      <property name="text" >
-       <string>Restore</string>
-      </property>
-      <property name="autoDefault" >
-       <bool>false</bool>
-      </property>
-     </widget>
-    </item>
-    <item>
-     <spacer>
-      <property name="orientation" >
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeType" >
-       <enum>QSizePolicy::Expanding</enum>
-      </property>
-      <property name="sizeHint" >
-       <size>
-        <width>20</width>
-        <height>20</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
-    <item>
-     <widget class="QPushButton" name="applyPB" >
-      <property name="text" >
-       <string>Apply</string>
-      </property>
-      <property name="autoDefault" >
-       <bool>false</bool>
-      </property>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QGroupBox" name="groupBox" >
-   <property name="geometry" >
-    <rect>
-     <x>11</x>
-     <y>11</y>
-     <width>201</width>
-     <height>51</height>
-    </rect>
+  <layout class="QGridLayout" >
+   <property name="margin" >
+    <number>9</number>
    </property>
-   <property name="title" >
-    <string>Line spacing</string>
+   <property name="spacing" >
+    <number>6</number>
    </property>
-   <widget class="QLineEdit" name="linespacingValue" >
-    <property name="enabled" >
-     <bool>false</bool>
-    </property>
-    <property name="geometry" >
-     <rect>
-      <x>80</x>
-      <y>20</y>
-      <width>111</width>
-      <height>22</height>
-     </rect>
-    </property>
-   </widget>
-   <widget class="QComboBox" name="linespacing" >
-    <property name="geometry" >
-     <rect>
-      <x>10</x>
-      <y>20</y>
-      <width>63</width>
-      <height>20</height>
-     </rect>
-    </property>
-    <item>
-     <property name="text" >
-      <string>Default</string>
-     </property>
-    </item>
-    <item>
-     <property name="text" >
-      <string>Single</string>
-     </property>
-    </item>
-    <item>
-     <property name="text" >
-      <string>1.5</string>
+   <item row="0" column="0" >
+    <layout class="QGridLayout" >
+     <property name="margin" >
+      <number>0</number>
      </property>
-    </item>
-    <item>
-     <property name="text" >
-      <string>Double</string>
+     <property name="spacing" >
+      <number>6</number>
      </property>
-    </item>
-    <item>
-     <property name="text" >
-      <string>Custom</string>
-     </property>
-    </item>
-   </widget>
-  </widget>
-  <widget class="QCheckBox" name="indentCB" >
-   <property name="geometry" >
-    <rect>
-     <x>10</x>
-     <y>250</y>
-     <width>201</width>
-     <height>19</height>
-    </rect>
-   </property>
-   <property name="text" >
-    <string>Indent Paragraph</string>
-   </property>
-  </widget>
-  <widget class="QGroupBox" name="aligmentGB" >
-   <property name="geometry" >
-    <rect>
-     <x>10</x>
-     <y>70</y>
-     <width>201</width>
-     <height>155</height>
-    </rect>
-   </property>
-   <property name="sizePolicy" >
-    <sizepolicy>
-     <hsizetype>3</hsizetype>
-     <vsizetype>5</vsizetype>
-     <horstretch>0</horstretch>
-     <verstretch>0</verstretch>
-    </sizepolicy>
-   </property>
-   <property name="title" >
-    <string>Alignment</string>
-   </property>
-   <layout class="QGridLayout" >
-    <property name="margin" >
-     <number>9</number>
-    </property>
-    <property name="spacing" >
-     <number>6</number>
-    </property>
-    <item row="4" column="0" >
-     <widget class="QRadioButton" name="alignRightRB" >
-      <property name="text" >
-       <string>Right</string>
-      </property>
-     </widget>
-    </item>
-    <item row="3" column="0" >
-     <widget class="QRadioButton" name="alignCenterRB" >
-      <property name="text" >
-       <string>Center</string>
-      </property>
-     </widget>
-    </item>
-    <item row="2" column="0" >
-     <widget class="QRadioButton" name="alignLeftRB" >
-      <property name="text" >
-       <string>Left</string>
-      </property>
-     </widget>
-    </item>
-    <item row="1" column="0" >
-     <widget class="QRadioButton" name="alignJustRB" >
-      <property name="text" >
-       <string>Justified</string>
-      </property>
-     </widget>
-    </item>
-    <item row="0" column="0" >
-     <widget class="QRadioButton" name="alignDefaultRB" >
-      <property name="font" >
-       <font>
-        <family>MS Shell Dlg 2</family>
-        <pointsize>8</pointsize>
-        <weight>50</weight>
-        <italic>false</italic>
-        <bold>false</bold>
-        <underline>false</underline>
-        <strikeout>false</strikeout>
-       </font>
-      </property>
-      <property name="toolTip" >
-       <string>Use the default alignment for this paragraph, whatever it is.</string>
-      </property>
-      <property name="text" >
-       <string>Paragraph's Default</string>
-      </property>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QGroupBox" name="labelwidthGB" >
-   <property name="enabled" >
-    <bool>false</bool>
-   </property>
-   <property name="geometry" >
-    <rect>
-     <x>10</x>
-     <y>280</y>
-     <width>201</width>
-     <height>107</height>
-    </rect>
-   </property>
-   <property name="sizePolicy" >
-    <sizepolicy>
-     <hsizetype>5</hsizetype>
-     <vsizetype>1</vsizetype>
-     <horstretch>0</horstretch>
-     <verstretch>0</verstretch>
-    </sizepolicy>
-   </property>
-   <property name="title" >
-    <string>Label Width</string>
-   </property>
-   <layout class="QGridLayout" >
-    <property name="margin" >
-     <number>9</number>
-    </property>
-    <property name="spacing" >
-     <number>6</number>
-    </property>
-    <item row="0" column="1" >
-     <widget class="QLineEdit" name="labelWidth" >
-      <property name="toolTip" >
-       <string>This text defines the width of the paragraph label</string>
-      </property>
-     </widget>
-    </item>
-    <item row="0" column="0" >
-     <widget class="QLabel" name="TextLabel2" >
-      <property name="toolTip" >
-       <string>This text defines the width of the paragraph label</string>
-      </property>
-      <property name="text" >
-       <string>&amp;Longest label</string>
-      </property>
-      <property name="buddy" >
-       <cstring>labelWidth</cstring>
-      </property>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QCheckBox" name="synchronizedViewCB" >
-   <property name="geometry" >
-    <rect>
-     <x>10</x>
-     <y>410</y>
-     <width>201</width>
-     <height>19</height>
-    </rect>
-   </property>
-   <property name="text" >
-    <string>Synchronized view</string>
-   </property>
-  </widget>
+     <item row="0" column="0" >
+      <widget class="QCheckBox" name="indentCB" >
+       <property name="sizePolicy" >
+        <sizepolicy>
+         <hsizetype>0</hsizetype>
+         <vsizetype>0</vsizetype>
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text" >
+        <string>&amp;Indent Paragraph</string>
+       </property>
+      </widget>
+     </item>
+     <item rowspan="3" row="0" column="1" >
+      <widget class="QGroupBox" name="aligmentGB" >
+       <property name="sizePolicy" >
+        <sizepolicy>
+         <hsizetype>0</hsizetype>
+         <vsizetype>0</vsizetype>
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="title" >
+        <string>Alignment</string>
+       </property>
+       <layout class="QGridLayout" >
+        <property name="margin" >
+         <number>9</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item row="4" column="0" >
+         <widget class="QRadioButton" name="alignRightRB" >
+          <property name="text" >
+           <string>&amp;Right</string>
+          </property>
+         </widget>
+        </item>
+        <item row="3" column="0" >
+         <widget class="QRadioButton" name="alignCenterRB" >
+          <property name="text" >
+           <string>&amp;Center</string>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="0" >
+         <widget class="QRadioButton" name="alignLeftRB" >
+          <property name="text" >
+           <string>&amp;Left</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0" >
+         <widget class="QRadioButton" name="alignJustRB" >
+          <property name="text" >
+           <string>&amp;Justified</string>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="0" >
+         <widget class="QRadioButton" name="alignDefaultRB" >
+          <property name="font" >
+           <font>
+            <family>MS Shell Dlg 2</family>
+            <pointsize>8</pointsize>
+            <weight>50</weight>
+            <italic>false</italic>
+            <bold>false</bold>
+            <underline>false</underline>
+            <strikeout>false</strikeout>
+           </font>
+          </property>
+          <property name="toolTip" >
+           <string>Use the default alignment for this paragraph, whatever it is.</string>
+          </property>
+          <property name="text" >
+           <string>Paragraph's &amp;Default</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+     </item>
+     <item row="2" column="0" >
+      <widget class="QGroupBox" name="labelwidthGB" >
+       <property name="enabled" >
+        <bool>false</bool>
+       </property>
+       <property name="sizePolicy" >
+        <sizepolicy>
+         <hsizetype>0</hsizetype>
+         <vsizetype>0</vsizetype>
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="title" >
+        <string>Label Width</string>
+       </property>
+       <layout class="QGridLayout" >
+        <property name="margin" >
+         <number>9</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item row="0" column="0" >
+         <widget class="QLabel" name="TextLabel2" >
+          <property name="toolTip" >
+           <string>This text defines the width of the paragraph label</string>
+          </property>
+          <property name="text" >
+           <string>&amp;Longest label</string>
+          </property>
+          <property name="buddy" >
+           <cstring>labelWidth</cstring>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="1" >
+         <widget class="QLineEdit" name="labelWidth" >
+          <property name="toolTip" >
+           <string>This text defines the width of the paragraph label</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+     </item>
+     <item row="1" column="0" >
+      <widget class="QGroupBox" name="groupBox" >
+       <property name="sizePolicy" >
+        <sizepolicy>
+         <hsizetype>0</hsizetype>
+         <vsizetype>0</vsizetype>
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="title" >
+        <string>Line &amp;spacing</string>
+       </property>
+       <layout class="QGridLayout" >
+        <property name="margin" >
+         <number>9</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item row="0" column="0" >
+         <widget class="QComboBox" name="linespacing" >
+          <item>
+           <property name="text" >
+            <string>Default</string>
+           </property>
+          </item>
+          <item>
+           <property name="text" >
+            <string>Single</string>
+           </property>
+          </item>
+          <item>
+           <property name="text" >
+            <string>1.5</string>
+           </property>
+          </item>
+          <item>
+           <property name="text" >
+            <string>Double</string>
+           </property>
+          </item>
+          <item>
+           <property name="text" >
+            <string>Custom</string>
+           </property>
+          </item>
+         </widget>
+        </item>
+        <item row="0" column="1" >
+         <widget class="QLineEdit" name="linespacingValue" >
+          <property name="enabled" >
+           <bool>false</bool>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+     </item>
+     <item rowspan="2" row="1" column="2" >
+      <layout class="QGridLayout" >
+       <property name="margin" >
+        <number>0</number>
+       </property>
+       <property name="spacing" >
+        <number>6</number>
+       </property>
+       <item row="0" column="0" >
+        <widget class="QCheckBox" name="synchronizedViewCB" >
+         <property name="sizePolicy" >
+          <sizepolicy>
+           <hsizetype>0</hsizetype>
+           <vsizetype>0</vsizetype>
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text" >
+          <string>I&amp;mmediate Apply</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="0" >
+        <widget class="QPushButton" name="applyPB" >
+         <property name="text" >
+          <string>&amp;Apply</string>
+         </property>
+         <property name="autoDefault" >
+          <bool>false</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0" >
+        <widget class="QPushButton" name="restorePB" >
+         <property name="text" >
+          <string>&amp;Restore</string>
+         </property>
+         <property name="autoDefault" >
+          <bool>false</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
  </widget>
- <pixmapfunction></pixmapfunction>
  <tabstops>
   <tabstop>linespacing</tabstop>
   <tabstop>linespacingValue</tabstop>