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

List:       kde-commits
Subject:    branches/KDE/4.3/kdeplasma-addons/applets/notes
From:       Darío Andrés Rodríguez <andresbajotierra () gmail ! co
Date:       2009-08-22 18:49:00
Message-ID: 1250966940.848130.11603.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1014400 by darioandres:

Backport to 4.3branch of:
- Set the font family on init, as the config file could have been edited from the outside.

- Only recalculate the default/initial font size (when there is no text) if the font size setting is 
  based on scales. (m_autoFont is true)

- Remove the "m_font.setPointSize(fontSize())" calls on "configAccepted". If any of the font size 
  settings changed, "updateTextGeometry" will be called anyways.



 M  +9 -7      notes.cpp  


--- branches/KDE/4.3/kdeplasma-addons/applets/notes/notes.cpp #1014399:1014400
@@ -343,6 +343,12 @@
     }
 
     m_font = cg.readEntry("font", KGlobalSettings::generalFont());
+    //Set the font family on init, it may have changed from the outside
+    QTextCursor oldCursor = m_textEdit->nativeWidget()->textCursor();
+    m_textEdit->nativeWidget()->selectAll();
+    m_textEdit->nativeWidget()->setFontFamily(m_font.family());
+    m_textEdit->nativeWidget()->setTextCursor(oldCursor);
+    
     m_customFontSize = cg.readEntry("customFontSize", m_font.pointSize());
     m_autoFont = cg.readEntry("autoFont", true);
     m_autoFontPercent = cg.readEntry("autoFontPercent", 4);
@@ -422,7 +428,9 @@
         m_textEdit->nativeWidget()->setFontPointSize(m_font.pointSize());
         m_textEdit->nativeWidget()->setTextCursor(oldTextCursor);
         
-        lineChanged();
+        if (m_autoFont) {
+            lineChanged();
+        }
     }
 }
 
@@ -589,7 +597,6 @@
         changed = true;
         cg.writeEntry("font", newFont);
         m_font = newFont;
-        m_font.setPointSize(fontSize());
         
         //Apply font size
         QTextCursor oldCursor = m_textEdit->nativeWidget()->textCursor();
@@ -602,23 +609,18 @@
         changed = true;
         m_customFontSize = ui.customFontSizeSpinBox->value();
         cg.writeEntry("customFontSize", m_customFontSize);
-        m_font.setPointSize(fontSize());
     }
 
     if (m_autoFont != ui.autoFont->isChecked()) {
         changed = true;
         m_autoFont = ui.autoFont->isChecked();
         cg.writeEntry("autoFont", m_autoFont);
-        m_font.setPointSize(fontSize());
     }
 
     if (m_autoFontPercent != ui.autoFontPercent->value()) {
         changed = true;
         m_autoFontPercent = (ui.autoFontPercent->value());
         cg.writeEntry("autoFontPercent", m_autoFontPercent);
-        if (m_autoFont) {
-            m_font.setPointSize(fontSize());
-        }
     }
 
     //TODO
[prev in list] [next in list] [prev in thread] [next in thread] 

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