Change the paragraph settings dialog:

- 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
This commit is contained in:
Abdelrazak Younes 2007-09-27 08:56:18 +00:00
parent 15b8abe4b8
commit 097ca4b228
3 changed files with 261 additions and 283 deletions

View 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") {

View 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;

View 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" >
@ -32,279 +29,262 @@
<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>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</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>
<property name="spacing" >
<number>6</number>
</property>
<property name="title" >
<string>Line spacing</string>
</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>
<item row="0" column="0" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
</item>
<item>
<property name="text" >
<string>Single</string>
<property name="spacing" >
<number>6</number>
</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>
</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>