Font of the Inputline is now configurable. Closing BR #121.
authorMarcus Eggenberger <egs@quassel-irc.org>
Fri, 21 Mar 2008 16:24:19 +0000 (16:24 +0000)
committerMarcus Eggenberger <egs@quassel-irc.org>
Fri, 21 Mar 2008 16:24:19 +0000 (16:24 +0000)
src/qtui/inputwidget.cpp
src/qtui/settingspages/fontssettingspage.cpp
src/qtui/settingspages/fontssettingspage.ui
version.inc

index 30530c9..53b64c8 100644 (file)
@@ -24,6 +24,7 @@
 #include "client.h"
 #include "networkmodel.h"
 #include "jumpkeyhandler.h"
 #include "client.h"
 #include "networkmodel.h"
 #include "jumpkeyhandler.h"
+#include "qtuisettings.h"
 
 
 InputWidget::InputWidget(QWidget *parent)
 
 
 InputWidget::InputWidget(QWidget *parent)
@@ -38,7 +39,13 @@ InputWidget::InputWidget(QWidget *parent)
 
   ui.ownNick->setSizeAdjustPolicy(QComboBox::AdjustToContents);
   ui.ownNick->installEventFilter(new MouseWheelFilter(this));
 
   ui.ownNick->setSizeAdjustPolicy(QComboBox::AdjustToContents);
   ui.ownNick->installEventFilter(new MouseWheelFilter(this));
-  ui.inputEdit->installEventFilter(new JumpKeyHandler(this));  
+  ui.inputEdit->installEventFilter(new JumpKeyHandler(this));
+
+  QtUiSettings s;
+  bool useInputLineFont = s.value("UseInputLineFont", QVariant(false)).toBool();
+  if(useInputLineFont) {
+    ui.inputEdit->setFont(s.value("InputLineFont").value<QFont>());
+  }
 }
 
 InputWidget::~InputWidget() {
 }
 
 InputWidget::~InputWidget() {
index 38c149c..f8ba23b 100644 (file)
@@ -21,6 +21,7 @@
 #include "fontssettingspage.h"
 
 #include "qtui.h"
 #include "fontssettingspage.h"
 
 #include "qtui.h"
+#include "qtuisettings.h"
 
 #include <QFontDialog>
 
 
 #include <QFontDialog>
 
@@ -31,26 +32,29 @@ FontsSettingsPage::FontsSettingsPage(QWidget *parent)
   mapper = new QSignalMapper(this);
   connect(ui.chooseGeneral, SIGNAL(clicked()), mapper, SLOT(map()));
   connect(ui.chooseTopic, SIGNAL(clicked()), mapper, SLOT(map()));
   mapper = new QSignalMapper(this);
   connect(ui.chooseGeneral, SIGNAL(clicked()), mapper, SLOT(map()));
   connect(ui.chooseTopic, SIGNAL(clicked()), mapper, SLOT(map()));
-  connect(ui.chooseNickList, SIGNAL(clicked()), mapper, SLOT(map()));
   connect(ui.chooseBufferView, SIGNAL(clicked()), mapper, SLOT(map()));
   connect(ui.chooseBufferView, SIGNAL(clicked()), mapper, SLOT(map()));
+  connect(ui.chooseNickList, SIGNAL(clicked()), mapper, SLOT(map()));
+  connect(ui.chooseInputLine, SIGNAL(clicked()), mapper, SLOT(map()));
   connect(ui.chooseChatMessages, SIGNAL(clicked()), mapper, SLOT(map()));
   connect(ui.chooseNicks, SIGNAL(clicked()), mapper, SLOT(map()));
   connect(ui.chooseTimestamp, SIGNAL(clicked()), mapper, SLOT(map()));
 
   mapper->setMapping(ui.chooseGeneral, ui.demoGeneral);
   mapper->setMapping(ui.chooseTopic, ui.demoTopic);
   connect(ui.chooseChatMessages, SIGNAL(clicked()), mapper, SLOT(map()));
   connect(ui.chooseNicks, SIGNAL(clicked()), mapper, SLOT(map()));
   connect(ui.chooseTimestamp, SIGNAL(clicked()), mapper, SLOT(map()));
 
   mapper->setMapping(ui.chooseGeneral, ui.demoGeneral);
   mapper->setMapping(ui.chooseTopic, ui.demoTopic);
-  mapper->setMapping(ui.chooseNickList, ui.demoNickList);
   mapper->setMapping(ui.chooseBufferView, ui.demoBufferView);
   mapper->setMapping(ui.chooseBufferView, ui.demoBufferView);
+  mapper->setMapping(ui.chooseNickList, ui.demoNickList);
+  mapper->setMapping(ui.chooseInputLine, ui.demoInputLine);
   mapper->setMapping(ui.chooseChatMessages, ui.demoChatMessages);
   mapper->setMapping(ui.chooseNicks, ui.demoNicks);
   mapper->setMapping(ui.chooseTimestamp, ui.demoTimestamp);
 
   connect(mapper, SIGNAL(mapped(QWidget *)), this, SLOT(chooseFont(QWidget *)));
   mapper->setMapping(ui.chooseChatMessages, ui.demoChatMessages);
   mapper->setMapping(ui.chooseNicks, ui.demoNicks);
   mapper->setMapping(ui.chooseTimestamp, ui.demoTimestamp);
 
   connect(mapper, SIGNAL(mapped(QWidget *)), this, SLOT(chooseFont(QWidget *)));
-
-  connect(ui.customAppFonts, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
+  
+  //connect(ui.customAppFonts, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
   connect(ui.checkTopic, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
   connect(ui.checkTopic, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
-  connect(ui.checkNickList, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
   connect(ui.checkBufferView, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
   connect(ui.checkBufferView, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
+  connect(ui.checkNickList, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
+  connect(ui.checkInputLine, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
   connect(ui.checkNicks, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
   connect(ui.checkTimestamp, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
 
   connect(ui.checkNicks, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
   connect(ui.checkTimestamp, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
 
@@ -73,6 +77,17 @@ void FontsSettingsPage::load() {
 }
 
 void FontsSettingsPage::load(Settings::Mode mode) {
 }
 
 void FontsSettingsPage::load(Settings::Mode mode) {
+  QtUiSettings s;
+  bool useInputLineFont = s.value("UseInputLineFont", QVariant(false)).toBool();
+  QFont inputLineFont;
+  if(useInputLineFont) {
+    ui.checkInputLine->setChecked(true);
+    inputLineFont = s.value("InputLineFont").value<QFont>();
+  } else {
+    inputLineFont = qApp->font();
+  }
+  initLabel(ui.demoInputLine, inputLineFont);
+  
   QTextCharFormat chatFormat = QtUi::style()->format(UiStyle::None, mode);
   initLabel(ui.demoChatMessages, chatFormat.font());
   QTextCharFormat nicksFormat = QtUi::style()->format(UiStyle::Sender, mode);
   QTextCharFormat chatFormat = QtUi::style()->format(UiStyle::None, mode);
   initLabel(ui.demoChatMessages, chatFormat.font());
   QTextCharFormat nicksFormat = QtUi::style()->format(UiStyle::Sender, mode);
@@ -96,6 +111,10 @@ void FontsSettingsPage::load(Settings::Mode mode) {
 }
 
 void FontsSettingsPage::save() {
 }
 
 void FontsSettingsPage::save() {
+  QtUiSettings s;
+  s.setValue("UseInputLineFont", (ui.checkInputLine->checkState() == Qt::Checked));
+  s.setValue("InputLineFont", ui.demoInputLine->font());
+  
   QTextCharFormat chatFormat = QtUi::style()->format(UiStyle::None);
   chatFormat.setFont(ui.demoChatMessages->font());
   QtUi::style()->setFormat(UiStyle::None, chatFormat, Settings::Custom);
   QTextCharFormat chatFormat = QtUi::style()->format(UiStyle::None);
   chatFormat.setFont(ui.demoChatMessages->font());
   QtUi::style()->setFormat(UiStyle::None, chatFormat, Settings::Custom);
index d76004f..c261c45 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>475</width>
-    <height>366</height>
+    <width>588</width>
+    <height>558</height>
    </rect>
   </property>
   <property name="windowTitle" >
    </rect>
   </property>
   <property name="windowTitle" >
      <item>
       <widget class="QGroupBox" name="customAppFonts" >
        <property name="enabled" >
      <item>
       <widget class="QGroupBox" name="customAppFonts" >
        <property name="enabled" >
-        <bool>false</bool>
+        <bool>true</bool>
        </property>
        <property name="title" >
         <string>Custom Application Fonts</string>
        </property>
        <property name="checkable" >
        </property>
        <property name="title" >
         <string>Custom Application Fonts</string>
        </property>
        <property name="checkable" >
-        <bool>true</bool>
+        <bool>false</bool>
        </property>
        <property name="checked" >
         <bool>false</bool>
        </property>
        <property name="checked" >
         <bool>false</bool>
        <layout class="QVBoxLayout" >
         <item>
          <layout class="QGridLayout" >
        <layout class="QVBoxLayout" >
         <item>
          <layout class="QGridLayout" >
-          <item row="0" column="0" >
-           <widget class="QLabel" name="label" >
-            <property name="text" >
-             <string>General:</string>
-            </property>
-           </widget>
-          </item>
           <item row="0" column="1" >
            <widget class="QLabel" name="demoGeneral" >
           <item row="0" column="1" >
            <widget class="QLabel" name="demoGeneral" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
               <horstretch>0</horstretch>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
               <horstretch>0</horstretch>
@@ -63,6 +59,9 @@
           </item>
           <item row="0" column="2" >
            <widget class="QPushButton" name="chooseGeneral" >
           </item>
           <item row="0" column="2" >
            <widget class="QPushButton" name="chooseGeneral" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
               <horstretch>0</horstretch>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
               <horstretch>0</horstretch>
@@ -76,6 +75,9 @@
           </item>
           <item row="1" column="0" >
            <widget class="QCheckBox" name="checkTopic" >
           </item>
           <item row="1" column="0" >
            <widget class="QCheckBox" name="checkTopic" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
             <property name="text" >
              <string>Topic:</string>
             </property>
             <property name="text" >
              <string>Topic:</string>
             </property>
@@ -83,6 +85,9 @@
           </item>
           <item row="1" column="1" >
            <widget class="QLabel" name="demoTopic" >
           </item>
           <item row="1" column="1" >
            <widget class="QLabel" name="demoTopic" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
               <horstretch>0</horstretch>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
               <horstretch>0</horstretch>
           </item>
           <item row="1" column="2" >
            <widget class="QPushButton" name="chooseTopic" >
           </item>
           <item row="1" column="2" >
            <widget class="QPushButton" name="chooseTopic" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
               <horstretch>0</horstretch>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
               <horstretch>0</horstretch>
           </item>
           <item row="2" column="0" >
            <widget class="QCheckBox" name="checkBufferView" >
           </item>
           <item row="2" column="0" >
            <widget class="QCheckBox" name="checkBufferView" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
             <property name="text" >
              <string>Buffer Views:</string>
             </property>
             <property name="checked" >
             <property name="text" >
              <string>Buffer Views:</string>
             </property>
             <property name="checked" >
-             <bool>true</bool>
+             <bool>false</bool>
             </property>
            </widget>
           </item>
           <item row="2" column="1" >
            <widget class="QLabel" name="demoBufferView" >
             </property>
            </widget>
           </item>
           <item row="2" column="1" >
            <widget class="QLabel" name="demoBufferView" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
               <horstretch>0</horstretch>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
               <horstretch>0</horstretch>
           </item>
           <item row="2" column="2" >
            <widget class="QPushButton" name="chooseBufferView" >
           </item>
           <item row="2" column="2" >
            <widget class="QPushButton" name="chooseBufferView" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
               <horstretch>0</horstretch>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
               <horstretch>0</horstretch>
           </item>
           <item row="3" column="0" >
            <widget class="QCheckBox" name="checkNickList" >
           </item>
           <item row="3" column="0" >
            <widget class="QCheckBox" name="checkNickList" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
             <property name="text" >
              <string>Nick List:</string>
             </property>
             <property name="checked" >
             <property name="text" >
              <string>Nick List:</string>
             </property>
             <property name="checked" >
-             <bool>true</bool>
+             <bool>false</bool>
             </property>
            </widget>
           </item>
           <item row="3" column="1" >
            <widget class="QLabel" name="demoNickList" >
             </property>
            </widget>
           </item>
           <item row="3" column="1" >
            <widget class="QLabel" name="demoNickList" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
               <horstretch>0</horstretch>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
               <horstretch>0</horstretch>
           </item>
           <item row="3" column="2" >
            <widget class="QPushButton" name="chooseNickList" >
           </item>
           <item row="3" column="2" >
            <widget class="QPushButton" name="chooseNickList" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
+            <property name="sizePolicy" >
+             <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text" >
+             <string>Choose...</string>
+            </property>
+           </widget>
+          </item>
+          <item row="4" column="0" >
+           <widget class="QCheckBox" name="checkInputLine" >
+            <property name="text" >
+             <string>Inputline:</string>
+            </property>
+           </widget>
+          </item>
+          <item row="4" column="1" >
+           <widget class="QLabel" name="demoInputLine" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
+            <property name="frameShape" >
+             <enum>QFrame::StyledPanel</enum>
+            </property>
+            <property name="frameShadow" >
+             <enum>QFrame::Sunken</enum>
+            </property>
+            <property name="text" >
+             <string>Font</string>
+            </property>
+            <property name="alignment" >
+             <set>Qt::AlignCenter</set>
+            </property>
+           </widget>
+          </item>
+          <item row="4" column="2" >
+           <widget class="QPushButton" name="chooseInputLine" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
               <horstretch>0</horstretch>
             <property name="sizePolicy" >
              <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
               <horstretch>0</horstretch>
             </property>
            </widget>
           </item>
             </property>
            </widget>
           </item>
+          <item row="0" column="0" >
+           <widget class="QLabel" name="generalApp" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
+            <property name="text" >
+             <string>General:</string>
+            </property>
+           </widget>
+          </item>
          </layout>
         </item>
        </layout>
          </layout>
         </item>
        </layout>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>46</x>
-     <y>292</y>
+     <x>74</x>
+     <y>349</y>
     </hint>
     <hint type="destinationlabel" >
     </hint>
     <hint type="destinationlabel" >
-     <x>183</x>
-     <y>290</y>
+     <x>310</x>
+     <y>349</y>
     </hint>
    </hints>
   </connection>
     </hint>
    </hints>
   </connection>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>96</x>
-     <y>288</y>
+     <x>124</x>
+     <y>349</y>
     </hint>
     <hint type="destinationlabel" >
     </hint>
     <hint type="destinationlabel" >
-     <x>452</x>
-     <y>293</y>
+     <x>559</x>
+     <y>356</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>checkNicks</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>demoNicks</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>68</x>
+     <y>317</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>338</x>
+     <y>317</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>checkNicks</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>chooseNicks</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>117</x>
+     <y>317</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>559</x>
+     <y>324</y>
     </hint>
    </hints>
   </connection>
     </hint>
    </hints>
   </connection>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>86</x>
-     <y>113</y>
+     <x>114</x>
+     <y>135</y>
     </hint>
     <hint type="destinationlabel" >
     </hint>
     <hint type="destinationlabel" >
-     <x>451</x>
-     <y>118</y>
+     <x>559</x>
+     <y>142</y>
     </hint>
    </hints>
   </connection>
     </hint>
    </hints>
   </connection>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>78</x>
-     <y>145</y>
+     <x>106</x>
+     <y>167</y>
     </hint>
     <hint type="destinationlabel" >
     </hint>
     <hint type="destinationlabel" >
-     <x>455</x>
-     <y>151</y>
+     <x>559</x>
+     <y>174</y>
     </hint>
    </hints>
   </connection>
     </hint>
    </hints>
   </connection>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>34</x>
-     <y>81</y>
+     <x>62</x>
+     <y>103</y>
     </hint>
     <hint type="destinationlabel" >
      <x>190</x>
     </hint>
     <hint type="destinationlabel" >
      <x>190</x>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>101</x>
-     <y>81</y>
+     <x>129</x>
+     <y>103</y>
     </hint>
     <hint type="destinationlabel" >
     </hint>
     <hint type="destinationlabel" >
-     <x>451</x>
-     <y>82</y>
+     <x>559</x>
+     <y>110</y>
     </hint>
    </hints>
   </connection>
   <connection>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>checkNicks</sender>
+   <sender>checkInputLine</sender>
    <signal>toggled(bool)</signal>
    <signal>toggled(bool)</signal>
-   <receiver>demoNicks</receiver>
+   <receiver>demoInputLine</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>40</x>
-     <y>255</y>
+     <x>82</x>
+     <y>194</y>
     </hint>
     <hint type="destinationlabel" >
     </hint>
     <hint type="destinationlabel" >
-     <x>211</x>
-     <y>257</y>
+     <x>221</x>
+     <y>197</y>
     </hint>
    </hints>
   </connection>
   <connection>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>checkNicks</sender>
+   <sender>checkInputLine</sender>
    <signal>toggled(bool)</signal>
    <signal>toggled(bool)</signal>
-   <receiver>chooseNicks</receiver>
+   <receiver>chooseInputLine</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
    <slot>setEnabled(bool)</slot>
    <hints>
     <hint type="sourcelabel" >
-     <x>89</x>
-     <y>257</y>
+     <x>83</x>
+     <y>185</y>
     </hint>
     <hint type="destinationlabel" >
     </hint>
     <hint type="destinationlabel" >
-     <x>447</x>
-     <y>258</y>
+     <x>506</x>
+     <y>194</y>
     </hint>
    </hints>
   </connection>
     </hint>
    </hints>
   </connection>
index dd60c4a..278e4be 100644 (file)
@@ -4,8 +4,8 @@
 { using namespace Global;
 
   quasselVersion = "0.2.0-alpha4-pre";
 { using namespace Global;
 
   quasselVersion = "0.2.0-alpha4-pre";
-  quasselDate = "2008-03-20";
-  quasselBuild = 653;
+  quasselDate = "2008-03-21";
+  quasselBuild = 655;
 
   //! Minimum client build number the core needs
   clientBuildNeeded = 642;
 
   //! Minimum client build number the core needs
   clientBuildNeeded = 642;