Bug 98865 - Konsole should use KGlobalSettings::fixedFont(); instead of "fixed"
Summary: Konsole should use KGlobalSettings::fixedFont(); instead of "fixed"
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-08 18:12 UTC by Heinrich Wendel
Modified: 2005-03-10 18:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heinrich Wendel 2005-02-08 18:12:13 UTC
Version:            (using KDE KDE 3.3.92)
Installed from:    Gentoo Packages

Konsole should use the global settings for fonts as default instead of "fixed" font, this makes kde more consistent.
Comment 1 Kurt Hindenburg 2005-02-08 19:01:08 UTC
Perhaps this is a bug?  I wonder if unicode should be changed...

Index: konsole.cpp
===================================================================
RCS file: /home/kde/kdebase/konsole/konsole/konsole.cpp,v
retrieving revision 1.505
diff -u -p -r1.505 konsole.cpp
--- konsole.cpp 2 Feb 2005 07:03:49 -0000       1.505
+++ konsole.cpp 8 Feb 2005 17:56:26 -0000
@@ -1534,9 +1534,7 @@ void Konsole::readProperties(KConfig* co
       // Options that should be applied to all sessions /////////////

       // (1) set menu items and Konsole members
-      QFont tmpFont("fixed");
-      tmpFont.setFixedPitch(true);
-      tmpFont.setStyleHint(QFont::TypeWriter);
+      QFont tmpFont = KGlobalSettings::fixedFont();
       defaultFont = config->readFontEntry("defaultfont", &tmpFont);

       //set the schema
@@ -1804,10 +1802,7 @@ void Konsole::setFont(int fontno)
   }
   else
   {
-    QFont f;
-    f.setFamily("fixed");
-    f.setFixedPitch(true);
-    f.setStyleHint(QFont::TypeWriter);
+    QFont f = KGlobalSettings::fixedFont();
     f.setPixelSize(QString(fonts[fontno]).toInt());
     te->setVTFont(f);
   }
Comment 2 Heinrich Wendel 2005-02-08 19:02:39 UTC
This patch works fine for the font. But what about the size. Maybe medium,small,big... should be relative to the default setting like in konqueror?
Comment 3 Kurt Hindenburg 2005-02-08 19:09:57 UTC
Ahh yea, I see what you mean.  Hmmm....  if the user had 'Cursor 15' as the Fixed font, the 15 is ignored by Konsole.
Comment 4 Heinrich Wendel 2005-02-08 19:34:56 UTC
I think removing the Font's submenu ("normal, tiny, ..., linux, unicode, custom") completly and opening the customs menu when clicking on Fonts would be the cleanest solution.
Comment 5 Heinrich Wendel 2005-02-08 19:36:11 UTC
and what about konsole_part.cpp?
Comment 6 Kurt Hindenburg 2005-02-09 06:51:37 UTC
The redesigning of the Font submenus will have to be KDE4.0 thing.  I agree that having a 'smaller' and 'larger' items make sense.

Should this above patch be applied for 3.4?  and also konsole_part?
Comment 7 Heinrich Wendel 2005-02-09 09:48:01 UTC
Yeah, the patch is fine for me. Redesigning the Font submenu (i.e. removing it) wouldn't require String changes, so maybe it's still possible.
Comment 8 Kurt Hindenburg 2005-02-10 07:04:24 UTC
CVS commit by hindenburg: 

Use KGlobalSettings::fixedFont(); note that the size is currently ignored.
CCBUGS: 98865


  M +3 -7      konsole.cpp   1.506
  M +3 -7      konsole_part.cpp   1.102


--- kdebase/konsole/konsole/konsole.cpp  #1.505:1.506
@@ -1535,7 +1535,6 @@ void Konsole::readProperties(KConfig* co
 
       // (1) set menu items and Konsole members
-      QFont tmpFont("fixed");
-      tmpFont.setFixedPitch(true);
-      tmpFont.setStyleHint(QFont::TypeWriter);
+      // TODO: Use font size in fixedFont()
+      QFont tmpFont = KGlobalSettings::fixedFont();
       defaultFont = config->readFontEntry("defaultfont", &tmpFont);
 
@@ -1805,8 +1804,5 @@ void Konsole::setFont(int fontno)
   else
   {
-    QFont f;
-    f.setFamily("fixed");
-    f.setFixedPitch(true);
-    f.setStyleHint(QFont::TypeWriter);
+    QFont f = KGlobalSettings::fixedFont();
     f.setPixelSize(QString(fonts[fontno]).toInt());
     te->setVTFont(f);

--- kdebase/konsole/konsole/konsole_part.cpp  #1.101:1.102
@@ -562,7 +562,6 @@ void konsolePart::readProperties()
   n_encoding = config->readNumEntry("encoding",0);
 
-  QFont tmpFont("fixed");
-  tmpFont.setFixedPitch(true);
-  tmpFont.setStyleHint(QFont::TypeWriter);
+  // TODO: Use font size in fixedFont()
+  QFont tmpFont = KGlobalSettings::fixedFont();
   defaultFont = config->readFontEntry("defaultfont", &tmpFont);
   setFont(QMIN(config->readUnsignedNumEntry("font",3),TOPFONT));
@@ -703,8 +702,5 @@ void konsolePart::setFont(int fontno)
   else
   {
-    QFont f;
-    f.setFamily("fixed");
-    f.setFixedPitch(true);
-    f.setStyleHint(QFont::TypeWriter);
+    QFont f = KGlobalSettings::fixedFont();
     f.setPixelSize(QString(fonts[fontno]).toInt());
     te->setVTFont(f);


Comment 9 Heinrich Wendel 2005-03-09 18:18:37 UTC
ok, after the big freeze...

What about my Proposal to remove the Font's SubmenuItems and just open the Custom dialog when clicking on it?
Comment 10 Kurt Hindenburg 2005-03-09 18:54:59 UTC
Check out http://bugs.kde.org/show_bug.cgi?id=100930.
Comment 11 Heinrich Wendel 2005-03-10 14:26:36 UTC
ok, please mark this one as duplicate then
Comment 12 Kurt Hindenburg 2005-03-10 18:24:49 UTC
Fixed as far as using fixedFont(). see #100930.