[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/ktouch
From:       Håvard Frøiland <haavard () solveien ! net>
Date:       2007-04-01 13:57:19
Message-ID: 1175435839.271589.18994.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 648832 by haavard:

fix color settings for student and teacher text line. And some small changes to the \
config dialog.

 M  +3 -0      ChangeLog  
 M  +4 -4      src/ktouch.kcfg  
 M  +2 -2      src/ktouchkeyboardwidget.cpp  
 M  +32 -12    src/ktouchtextlinewidget.cpp  
 M  +1 -0      src/ktouchtextlinewidget.h  
 M  +49 -53    src/ui/ktouchprefcolorspage.ui  
 M  +49 -64    src/ui/ktouchprefkeyboardpage.ui  
 M  +2 -2      src/ui/ktouchpreftrainingpage.ui  


--- trunk/KDE/kdeedu/ktouch/ChangeLog #648831:648832
@@ -1,3 +1,6 @@
+2007-04-01 Håvard Frøiland <haavard@solveien.net>
+  * Fix color's for student and text line. (respect settings)
+
 2007-03-16 Håvard Frøiland <haavard@solveien.net>
   * Added config page for sound, and cleanup.
 
--- trunk/KDE/kdeedu/ktouch/src/ktouch.kcfg #648831:648832
@@ -23,7 +23,7 @@
     </entry>
     <entry type="Color" name="StudentBackgroundColor" >
       <label >The background color for the student's line.</label>
-      <default >#aoffao</default>
+      <default >#fff16b</default>
     </entry>
     <entry type="Color" name="StudentTextColor" >
       <label >The text color for the student's line</label>
@@ -85,9 +85,9 @@
       <label >Whether to use colors on the keys or not.</label>
       <default>true</default>
     </entry>
-    <entry type="Bool" name="HideKeyboard" >
-      <label >Whether to hide the keyboard display.</label>
-      <default>false</default>
+    <entry type="Bool" name="ShowKeyboard" >
+      <label >Whether to show the keyboard display.</label>
+      <default>true</default>
     </entry>
     <entry type="Bool" name="OverrideKeyboardFont" >
       <label >Whether to override the default/predefined keyboard fonts.</label>
--- trunk/KDE/kdeedu/ktouch/src/ktouchkeyboardwidget.cpp #648831:648832
@@ -71,7 +71,7 @@
 
 
 void KTouchKeyboardWidget::applyPreferences(QWidget * window, bool silent) {
-    setVisible(!Prefs::hideKeyboard());
+    setVisible(Prefs::showKeyboard());
 
     // let's check whether the keyboard layout has changed
     if (Prefs::currentKeyboardFile() != m_currentLayout) {
@@ -126,7 +126,7 @@
     // the finger key will be highlighted
     m_nextKey = nextChar;
 
-    if(Prefs::hideKeyboard())
+    if(!Prefs::showKeyboard())
         return;
 
     // first clean the markings on all keys
--- trunk/KDE/kdeedu/ktouch/src/ktouchtextlinewidget.cpp #648831:648832
@@ -68,10 +68,7 @@
     if (Prefs::overrideLectureFont())
         font = Prefs::font();
 
-    student->setBrush(QBrush(Prefs::studentTextColor()));
-    teacher->setBrush(QBrush(Prefs::teacherTextColor()));
-    teacherRect->setBrush(QBrush(Prefs::teacherBackgroundColor()));
-    studentRect->setBrush(QBrush(Prefs::studentBackgroundColor()));
+    updateColor();
 
     animationTimer->setInterval(100 - Prefs::slidingSpeed());
 
@@ -99,17 +96,40 @@
         student->setPos(teacherTextWidth - studentTextWidth, \
teacher->boundingRect().height() + 5);  }
 
-    if(teacher->text().startsWith(text)){
-        studentRect->setBrush(QBrush(Prefs::studentBackgroundColor()));
-        student->setBrush(QBrush(Prefs::studentTextColor()));
-    }
-    else{
-        studentRect->setBrush(QBrush(Prefs::errorBackgroundColor()));
-        student->setBrush(QBrush(Prefs::errorTextColor()));
-   }
+    updateColor();
     animationTimer->start();
 }
 
+void KTouchTextLineWidget::updateColor() {
+
+   if (Prefs::commonTypingLineColors()) {
+        teacher->setBrush(QBrush(Prefs::teacherTextColor()));
+        teacherRect->setBrush(QBrush(Prefs::teacherBackgroundColor()));
+
+        if(Prefs::colorOnError() && !teacher->text().startsWith(student->text())){
+            studentRect->setBrush(QBrush(Prefs::errorBackgroundColor()));
+            student->setBrush(QBrush(Prefs::errorTextColor()));
+        }
+        else{
+            studentRect->setBrush(QBrush(Prefs::studentBackgroundColor()));
+            student->setBrush(QBrush(Prefs::studentTextColor()));
+        }
+    }
+    else {
+        teacher->setBrush(QBrush(Qt::black));
+        teacherRect->setBrush(QBrush(Qt::white));
+
+        if(Prefs::colorOnError() && !teacher->text().startsWith(student->text())){
+            studentRect->setBrush(QBrush(Prefs::errorBackgroundColor()));
+            student->setBrush(QBrush(Prefs::errorTextColor()));
+        }
+        else{
+            studentRect->setBrush(QBrush(Qt::white));
+            student->setBrush(QBrush(Qt::blue));
+        }
+    }
+}
+
 void KTouchTextLineWidget::setFont(const QFont& f) {
     if (Prefs::overrideLectureFont())
         font = Prefs::font();
--- trunk/KDE/kdeedu/ktouch/src/ktouchtextlinewidget.h #648831:648832
@@ -39,6 +39,7 @@
         recalculateSize();
     }
     void recalculateSize();
+    void updateColor();
 
     QPainterPath roundedRectPathFactory(double x, double y, double width, double \
height, double rounded);  
--- trunk/KDE/kdeedu/ktouch/src/ui/ktouchprefcolorspage.ui #648831:648832
@@ -5,21 +5,15 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>413</width>
-    <height>276</height>
+    <width>410</width>
+    <height>253</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>Color Settings</string>
   </property>
-  <layout class="QVBoxLayout" >
-   <property name="margin" >
-    <number>9</number>
-   </property>
-   <property name="spacing" >
-    <number>6</number>
-   </property>
-   <item>
+  <layout class="QGridLayout" >
+   <item row="0" column="0" >
     <widget class="QGroupBox" name="kcfg_CommonTypingLineColors" >
      <property name="title" >
       <string>Use Custom color for typing line</string>
@@ -27,27 +21,31 @@
      <property name="checkable" >
       <bool>true</bool>
      </property>
-     <layout class="QVBoxLayout" >
-      <property name="margin" >
-       <number>9</number>
-      </property>
-      <property name="spacing" >
-       <number>6</number>
-      </property>
-      <item>
+     <layout class="QGridLayout" >
+      <item row="0" column="0" >
        <layout class="QGridLayout" >
-        <property name="margin" >
+        <property name="leftMargin" >
          <number>0</number>
         </property>
-        <property name="spacing" >
+        <property name="topMargin" >
+         <number>0</number>
+        </property>
+        <property name="rightMargin" >
+         <number>0</number>
+        </property>
+        <property name="bottomMargin" >
+         <number>0</number>
+        </property>
+        <property name="horizontalSpacing" >
          <number>6</number>
         </property>
+        <property name="verticalSpacing" >
+         <number>6</number>
+        </property>
         <item row="0" column="4" >
          <widget class="KColorButton" name="kcfg_TeacherTextColor" >
           <property name="sizePolicy" >
-           <sizepolicy>
-            <hsizetype>1</hsizetype>
-            <vsizetype>0</vsizetype>
+           <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
@@ -225,40 +223,38 @@
         </item>
        </layout>
       </item>
-      <item>
-       <spacer>
-        <property name="orientation" >
-         <enum>Qt::Vertical</enum>
+     </layout>
+    </widget>
+   </item>
+   <item row="1" column="0" >
+    <widget class="QGroupBox" name="kcfg_ColorOnError" >
+     <property name="title" >
+      <string>Use different color on miss typing</string>
+     </property>
+     <property name="checkable" >
+      <bool>true</bool>
+     </property>
+     <layout class="QGridLayout" >
+      <item row="0" column="0" >
+       <layout class="QGridLayout" >
+        <property name="leftMargin" >
+         <number>0</number>
         </property>
-        <property name="sizeType" >
-         <enum>QSizePolicy::Fixed</enum>
+        <property name="topMargin" >
+         <number>0</number>
         </property>
-        <property name="sizeHint" >
-         <size>
-          <width>20</width>
-          <height>16</height>
-         </size>
+        <property name="rightMargin" >
+         <number>0</number>
         </property>
-       </spacer>
-      </item>
-      <item>
-       <widget class="QCheckBox" name="kcfg_ColorOnError" >
-        <property name="toolTip" >
-         <string>If checked this shows your error using the colors below on the \
                typing line</string>
-        </property>
-        <property name="text" >
-         <string>Use different color on error in typing line</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <layout class="QGridLayout" >
-        <property name="margin" >
+        <property name="bottomMargin" >
          <number>0</number>
         </property>
-        <property name="spacing" >
+        <property name="horizontalSpacing" >
          <number>6</number>
         </property>
+        <property name="verticalSpacing" >
+         <number>6</number>
+        </property>
         <item row="0" column="0" >
          <spacer>
           <property name="orientation" >
@@ -354,15 +350,15 @@
      </layout>
     </widget>
    </item>
-   <item>
+   <item row="2" column="0" >
     <spacer>
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" >
       <size>
-       <width>351</width>
-       <height>51</height>
+       <width>20</width>
+       <height>40</height>
       </size>
      </property>
     </spacer>
--- trunk/KDE/kdeedu/ktouch/src/ui/ktouchprefkeyboardpage.ui #648831:648832
@@ -5,49 +5,37 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>570</width>
-    <height>323</height>
+    <width>396</width>
+    <height>217</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>Keyboard Settings</string>
   </property>
   <layout class="QGridLayout" >
-   <property name="margin" >
-    <number>9</number>
-   </property>
-   <property name="spacing" >
-    <number>6</number>
-   </property>
-   <item row="1" column="0" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>552</width>
-       <height>31</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
    <item row="0" column="0" >
-    <widget class="QGroupBox" name="groupBox1" >
+    <widget class="QGroupBox" name="kcfg_ShowKeyboard" >
      <property name="title" >
-      <string/>
+      <string>Show keyboard</string>
      </property>
+     <property name="checkable" >
+      <bool>true</bool>
+     </property>
      <layout class="QGridLayout" >
-      <property name="margin" >
-       <number>9</number>
-      </property>
-      <property name="spacing" >
-       <number>6</number>
-      </property>
-      <item row="2" column="0" >
+      <item row="0" column="0" >
+       <widget class="QCheckBox" name="kcfg_ShowAnimation" >
+        <property name="toolTip" >
+         <string>Show on the keyboards the keys you have to type</string>
+        </property>
+        <property name="whatsThis" >
+         <string>This highlights on the keyboard the key you have to type next. It \
is easier to type when this is checked.</string> +        </property>
+        <property name="text" >
+         <string>Highlight &amp;keys on keyboard</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0" >
        <widget class="QGroupBox" name="kcfg_OverrideKeyboardFont" >
         <property name="toolTip" >
          <string>If checked you can specify your own keyboard font instead of the \
predefined one of the keyboard layout.</string> @@ -62,12 +50,24 @@
          <bool>true</bool>
         </property>
         <layout class="QGridLayout" >
-         <property name="margin" >
+         <property name="leftMargin" >
           <number>9</number>
          </property>
-         <property name="spacing" >
+         <property name="topMargin" >
+          <number>9</number>
+         </property>
+         <property name="rightMargin" >
+          <number>9</number>
+         </property>
+         <property name="bottomMargin" >
+          <number>9</number>
+         </property>
+         <property name="horizontalSpacing" >
           <number>6</number>
          </property>
+         <property name="verticalSpacing" >
+          <number>6</number>
+         </property>
          <item row="0" column="0" >
           <widget class="QLabel" name="textLabel1" >
            <property name="text" >
@@ -78,9 +78,7 @@
          <item row="1" column="0" >
           <widget class="KFontRequester" name="kcfg_KeyboardFont" >
            <property name="sizePolicy" >
-            <sizepolicy>
-             <hsizetype>7</hsizetype>
-             <vsizetype>5</vsizetype>
+            <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
@@ -90,35 +88,22 @@
         </layout>
        </widget>
       </item>
-      <item row="1" column="0" >
-       <widget class="QCheckBox" name="kcfg_ShowAnimation" >
-        <property name="toolTip" >
-         <string>Show on the keyboards the keys you have to type</string>
-        </property>
-        <property name="whatsThis" >
-         <string>This highlights on the keyboard the key you have to type next. It \
                is easier to type when this is checked.</string>
-        </property>
-        <property name="text" >
-         <string>Highlight &amp;keys on keyboard</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="0" >
-       <widget class="QCheckBox" name="kcfg_HideKeyboard" >
-        <property name="toolTip" >
-         <string>Hide the keyboard</string>
-        </property>
-        <property name="whatsThis" >
-         <string>This will hide the keyboard</string>
-        </property>
-        <property name="text" >
-         <string>Hide keyboard</string>
-        </property>
-       </widget>
-      </item>
      </layout>
     </widget>
    </item>
+   <item row="1" column="0" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <layoutdefault spacing="6" margin="11" />
--- trunk/KDE/kdeedu/ktouch/src/ui/ktouchpreftrainingpage.ui #648831:648832
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>639</width>
-    <height>504</height>
+    <width>421</width>
+    <height>456</height>
    </rect>
   </property>
   <property name="windowTitle" >


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic