]> git.lyx.org Git - features.git/commitdiff
* clean layout of font panel in document dialog
authorEdwin Leuven <e.leuven@gmail.com>
Tue, 21 Nov 2006 20:40:42 +0000 (20:40 +0000)
committerEdwin Leuven <e.leuven@gmail.com>
Tue, 21 Nov 2006 20:40:42 +0000 (20:40 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16007 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/QDocumentDialog.C
src/frontends/qt4/ui/FontUi.ui

index a4a555a5129c6fa1224a458b86c2c6f0451f4d7b..97948482dc5dc2941ebd66fe43c3108793e650ee 100644 (file)
@@ -560,18 +560,18 @@ void QDocumentDialog::romanChanged(int item)
 void QDocumentDialog::sansChanged(int item)
 {
        string const font = tex_fonts_sans[item];
-       
-       fontModule->scaleSansSB->setEnabled(
-               form_->controller().providesScale(font));
+       bool scaleable = form_->controller().providesScale(font);
+       fontModule->scaleSansSB->setEnabled(scaleable);
+       fontModule->scaleSansLA->setEnabled(scaleable);
 }
 
 
 void QDocumentDialog::ttChanged(int item)
 {
        string const font = tex_fonts_monospaced[item];
-       
-       fontModule->scaleTypewriterSB->setEnabled(
-               form_->controller().providesScale(font));
+       bool scaleable = form_->controller().providesScale(font);
+       fontModule->scaleTypewriterSB->setEnabled(scaleable);
+       fontModule->scaleTypewriterLA->setEnabled(scaleable);
 }
 
 
@@ -1085,30 +1085,27 @@ void QDocumentDialog::update(BufferParams const & params)
                        params.fontsize);
 
        int n = findToken(tex_fonts_roman, params.fontsRoman);
-       if (n >= 0)
+       if (n >= 0) {
                fontModule->fontsRomanCO->setCurrentIndex(n);
+               romanChanged(n);
+       }
 
        n = findToken(tex_fonts_sans, params.fontsSans);
-       if (n >= 0)
+       if (n >= 0)     {
                fontModule->fontsSansCO->setCurrentIndex(n);
+               sansChanged(n);
+       }
 
        n = findToken(tex_fonts_monospaced, params.fontsTypewriter);
-       if (n >= 0)
+       if (n >= 0) {
                fontModule->fontsTypewriterCO->setCurrentIndex(n);
+               ttChanged(n);
+       }
 
        fontModule->fontScCB->setChecked(params.fontsSC);
        fontModule->fontOsfCB->setChecked(params.fontsOSF);
-       fontModule->fontScCB->setEnabled(
-               form_->controller().providesSC(params.fontsRoman));
-       fontModule->fontOsfCB->setEnabled(
-               form_->controller().providesOSF(params.fontsRoman));
        fontModule->scaleSansSB->setValue(params.fontsSansScale);
-       fontModule->scaleTypewriterSB->setValue(
-               params.fontsTypewriterScale);
-       fontModule->scaleSansSB->setEnabled(
-               form_->controller().providesScale(params.fontsSans));
-       fontModule->scaleTypewriterSB->setEnabled(
-               form_->controller().providesScale(params.fontsTypewriter));
+       fontModule->scaleTypewriterSB->setValue(params.fontsTypewriterScale);
        n = findToken(ControlDocument::fontfamilies, params.fontsDefaultFamily);
        if (n >= 0)
                fontModule->fontsDefaultCO->setCurrentIndex(n);
index 9c8f8388da74a6ea6ba6a970a63897d3c41ef22b..a7ea9a2547ecc28eb2d56a5549091aa0c65e17cc 100644 (file)
@@ -8,8 +8,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>344</width>
-    <height>394</height>
+    <width>409</width>
+    <height>232</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <property name="spacing" >
     <number>6</number>
    </property>
-   <item row="3" column="0" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
+   <item row="0" column="1" >
+    <widget class="QComboBox" name="fontsDefaultCO" />
+   </item>
+   <item row="4" column="1" >
+    <widget class="QComboBox" name="fontsRomanCO" />
+   </item>
+   <item row="2" column="1" >
+    <widget class="QComboBox" name="fontsSansCO" />
+   </item>
+   <item row="3" column="2" >
+    <widget class="QLabel" name="scaleTypewriterLA" >
+     <property name="text" >
+      <string>Sc&amp;ale (%):</string>
      </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Expanding</enum>
+     <property name="buddy" >
+      <cstring>scaleTypewriterSB</cstring>
      </property>
-     <property name="sizeHint" >
-      <size>
-       <width>326</width>
-       <height>16</height>
-      </size>
+    </widget>
+   </item>
+   <item row="2" column="2" >
+    <widget class="QLabel" name="scaleSansLA" >
+     <property name="text" >
+      <string>S&amp;cale (%):</string>
      </property>
-    </spacer>
+     <property name="buddy" >
+      <cstring>scaleSansSB</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2" >
+    <widget class="QLabel" name="TextLabel2_2" >
+     <property name="text" >
+      <string>&amp;Base Size:</string>
+     </property>
+     <property name="buddy" >
+      <cstring>fontsizeCO</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="3" >
+    <widget class="QSpinBox" name="scaleSansSB" >
+     <property name="maximum" >
+      <number>200</number>
+     </property>
+     <property name="minimum" >
+      <number>10</number>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="3" >
+    <widget class="QComboBox" name="fontsizeCO" />
    </item>
    <item row="2" column="0" >
-    <widget class="QGroupBox" name="fontAdvancedGB" >
-     <property name="title" >
-      <string>Advanced Options</string>
+    <widget class="QLabel" name="fontsSansLA" >
+     <property name="text" >
+      <string>&amp;Sans Serif:</string>
+     </property>
+     <property name="buddy" >
+      <cstring>fontsSansCO</cstring>
      </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="QCheckBox" name="fontScCB" >
-        <property name="text" >
-         <string>Use true S&amp;mall Caps</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0" >
-       <widget class="QCheckBox" name="fontOsfCB" >
-        <property name="text" >
-         <string>Use &amp;Old Style Figures</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
     </widget>
    </item>
-   <item row="1" column="0" >
-    <widget class="QGroupBox" name="fontSizesGB" >
-     <property name="title" >
-      <string>Sizes</string>
+   <item row="3" column="0" >
+    <widget class="QLabel" name="fontsTypewriterLA" >
+     <property name="text" >
+      <string>&amp;Typewriter:</string>
+     </property>
+     <property name="buddy" >
+      <cstring>fontsTypewriterCO</cstring>
      </property>
-     <layout class="QGridLayout" >
-      <property name="margin" >
-       <number>9</number>
-      </property>
-      <property name="spacing" >
-       <number>6</number>
-      </property>
-      <item row="0" column="1" colspan="2" >
-       <widget class="QComboBox" name="fontsizeCO" >
-        <property name="sizePolicy" >
-         <sizepolicy>
-          <hsizetype>5</hsizetype>
-          <vsizetype>0</vsizetype>
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="0" >
-       <widget class="QLabel" name="TextLabel2_2" >
-        <property name="text" >
-         <string>&amp;Base Size:</string>
-        </property>
-        <property name="buddy" >
-         <cstring>fontsizeCO</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="0" colspan="2" >
-       <widget class="QLabel" name="scaleTypewriterLA" >
-        <property name="text" >
-         <string>Sc&amp;ale Typewriter %:</string>
-        </property>
-        <property name="buddy" >
-         <cstring>scaleTypewriterSB</cstring>
-        </property>
-       </widget>
-      </item>
-      <item rowspan="2" row="2" column="2" >
-       <widget class="QSpinBox" name="scaleTypewriterSB" >
-        <property name="maximum" >
-         <number>200</number>
-        </property>
-        <property name="minimum" >
-         <number>10</number>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="2" >
-       <widget class="QSpinBox" name="scaleSansSB" >
-        <property name="maximum" >
-         <number>200</number>
-        </property>
-        <property name="minimum" >
-         <number>10</number>
-        </property>
-       </widget>
-      </item>
-      <item rowspan="2" row="1" column="0" colspan="2" >
-       <widget class="QLabel" name="scaleSansLA" >
-        <property name="text" >
-         <string>S&amp;cale Sans Serif %:</string>
-        </property>
-        <property name="buddy" >
-         <cstring>scaleSansSB</cstring>
-        </property>
-       </widget>
-      </item>
-     </layout>
     </widget>
    </item>
    <item row="0" column="0" >
-    <widget class="QGroupBox" name="fontsGB" >
-     <property name="title" >
-      <string>Families</string>
+    <widget class="QLabel" name="fontsDefaultLA" >
+     <property name="text" >
+      <string>&amp;Default Family:</string>
+     </property>
+     <property name="buddy" >
+      <cstring>fontsDefaultCO</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="0" >
+    <widget class="QLabel" name="fontsRomanLA" >
+     <property name="text" >
+      <string>&amp;Roman:</string>
+     </property>
+     <property name="buddy" >
+      <cstring>fontsRomanCO</cstring>
      </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="QComboBox" name="fontsRomanCO" >
-        <property name="sizePolicy" >
-         <sizepolicy>
-          <hsizetype>5</hsizetype>
-          <vsizetype>0</vsizetype>
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1" >
-       <widget class="QComboBox" name="fontsSansCO" >
-        <property name="sizePolicy" >
-         <sizepolicy>
-          <hsizetype>5</hsizetype>
-          <vsizetype>0</vsizetype>
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="1" >
-       <widget class="QComboBox" name="fontsDefaultCO" >
-        <property name="sizePolicy" >
-         <sizepolicy>
-          <hsizetype>5</hsizetype>
-          <vsizetype>0</vsizetype>
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="1" >
-       <widget class="QComboBox" name="fontsTypewriterCO" >
-        <property name="sizePolicy" >
-         <sizepolicy>
-          <hsizetype>5</hsizetype>
-          <vsizetype>0</vsizetype>
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="0" >
-       <widget class="QLabel" name="fontsDefaultLA" >
-        <property name="text" >
-         <string>&amp;Default Family:</string>
-        </property>
-        <property name="buddy" >
-         <cstring>fontsDefaultCO</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="0" >
-       <widget class="QLabel" name="fontsTypewriterLA" >
-        <property name="text" >
-         <string>&amp;Typewriter:</string>
-        </property>
-        <property name="buddy" >
-         <cstring>fontsRomanCO</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0" >
-       <widget class="QLabel" name="fontsSansLA" >
-        <property name="text" >
-         <string>&amp;Sans Serif:</string>
-        </property>
-        <property name="buddy" >
-         <cstring>fontsRomanCO</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="0" >
-       <widget class="QLabel" name="fontsRomanLA" >
-        <property name="text" >
-         <string>&amp;Roman:</string>
-        </property>
-        <property name="buddy" >
-         <cstring>fontsRomanCO</cstring>
-        </property>
-       </widget>
-      </item>
-     </layout>
     </widget>
    </item>
+   <item row="5" column="1" >
+    <widget class="QCheckBox" name="fontScCB" >
+     <property name="text" >
+      <string>Use true S&amp;mall Caps</string>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="1" >
+    <widget class="QCheckBox" name="fontOsfCB" >
+     <property name="text" >
+      <string>Use &amp;Old Style Figures</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="3" >
+    <widget class="QSpinBox" name="scaleTypewriterSB" >
+     <property name="maximum" >
+      <number>200</number>
+     </property>
+     <property name="minimum" >
+      <number>10</number>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1" >
+    <widget class="QComboBox" name="fontsTypewriterCO" />
+   </item>
+   <item row="1" column="1" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>182</width>
+       <height>16</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="7" column="0" colspan="4" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeType" >
+      <enum>QSizePolicy::Expanding</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>391</width>
+       <height>21</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <layoutdefault spacing="6" margin="11" />
  <pixmapfunction></pixmapfunction>
- <includes>
-  <include location="local" >qt_helpers.h</include>
- </includes>
  <tabstops>
-  <tabstop>fontsRomanCO</tabstop>
+  <tabstop>fontsDefaultCO</tabstop>
   <tabstop>fontsizeCO</tabstop>
+  <tabstop>fontsSansCO</tabstop>
+  <tabstop>scaleSansSB</tabstop>
+  <tabstop>fontsTypewriterCO</tabstop>
+  <tabstop>scaleTypewriterSB</tabstop>
+  <tabstop>fontsRomanCO</tabstop>
+  <tabstop>fontScCB</tabstop>
+  <tabstop>fontOsfCB</tabstop>
  </tabstops>
+ <includes>
+  <include location="local" >qt_helpers.h</include>
+ </includes>
  <resources/>
  <connections/>
 </ui>