Make custom ChatView font disableable
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 4 Aug 2009 07:44:04 +0000 (09:44 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 6 Aug 2009 18:25:59 +0000 (20:25 +0200)
Add a checkbox for it, now that we can.

src/qtui/qtuistyle.cpp
src/qtui/settingspages/chatviewsettingspage.ui

index f37b85e..c3f405d 100644 (file)
@@ -59,8 +59,9 @@ void QtUiStyle::generateSettingsQss() const {
     desc += "normal ";
   desc += QString("%1pt \"%2\"").arg(font.pointSize()).arg(font.family());
 
     desc += "normal ";
   desc += QString("%1pt \"%2\"").arg(font.pointSize()).arg(font.family());
 
-  out << "// ChatView Font\n\n"
-      << "ChatLine { " << desc << "; }\n\n";
+  if(fs.value("UseCustomChatViewFont").toBool())
+    out << "// ChatView Font\n\n"
+        << "ChatLine { " << desc << "; }\n\n";
 
   QtUiStyleSettings s("Colors");
   if(s.value("UseChatViewColors").toBool()) {
 
   QtUiStyleSettings s("Colors");
   if(s.value("UseChatViewColors").toBool()) {
index 3b60b0a..1bbe072 100644 (file)
     </layout>
    </item>
    <item>
     </layout>
    </item>
    <item>
-    <widget class="FontSelector" name="chatViewFont" native="true">
-     <property name="text" stdset="0">
-      <string>Chat window font:</string>
-     </property>
-     <property name="settingsKey" stdset="0">
-      <string>/QtUiStyle/Fonts/ChatView</string>
-     </property>
-     <property name="defaultValue" stdset="0">
-      <font>
-       <family>Monospace</family>
-      </font>
-     </property>
-    </widget>
+    <layout class="QHBoxLayout" name="horizontalLayout_3">
+     <item>
+      <widget class="QCheckBox" name="customChatViewFont">
+       <property name="text">
+        <string>Custom chat window font:</string>
+       </property>
+       <property name="checked">
+        <bool>true</bool>
+       </property>
+       <property name="settingsKey" stdset="0">
+        <string>/QtUiStyle/Fonts/UseCustomChatViewFont</string>
+       </property>
+       <property name="defaultValue" stdset="0">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="FontSelector" name="chatViewFont" native="true">
+       <property name="settingsKey" stdset="0">
+        <string>/QtUiStyle/Fonts/ChatView</string>
+       </property>
+       <property name="defaultValue" stdset="0">
+        <font>
+         <family>Monospace</family>
+        </font>
+       </property>
+      </widget>
+     </item>
+    </layout>
    </item>
    <item>
     <widget class="QCheckBox" name="allowMircColors">
    </item>
    <item>
     <widget class="QCheckBox" name="allowMircColors">
   <tabstop>senderColorSelf</tabstop>
  </tabstops>
  <resources/>
   <tabstop>senderColorSelf</tabstop>
  </tabstops>
  <resources/>
- <connections/>
+ <connections>
+  <connection>
+   <sender>customChatViewFont</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>chatViewFont</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>205</x>
+     <y>48</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>304</x>
+     <y>50</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
 </ui>
 </ui>