[haiku-commits] r38743 - haiku/trunk/src/apps/mediaplayer/interface

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 20 Sep 2010 17:16:10 +0200 (CEST)

Author: axeld
Date: 2010-09-20 17:16:10 +0200 (Mon, 20 Sep 2010)
New Revision: 38743
Changeset: http://dev.haiku-os.org/changeset/38743

Modified:
   haiku/trunk/src/apps/mediaplayer/interface/DurationView.cpp
Log:
* Only change the font size in case the interface is resized; ie. use the
  default plain font otherwise.


Modified: haiku/trunk/src/apps/mediaplayer/interface/DurationView.cpp
===================================================================
--- haiku/trunk/src/apps/mediaplayer/interface/DurationView.cpp 2010-09-20 
06:26:32 UTC (rev 38742)
+++ haiku/trunk/src/apps/mediaplayer/interface/DurationView.cpp 2010-09-20 
15:16:10 UTC (rev 38743)
@@ -11,7 +11,6 @@
 #include "DurationToString.h"
 
 
-// constructor
 DurationView::DurationView(const char* name)
        :
        BStringView(name, ""),
@@ -100,9 +99,13 @@
 void
 DurationView::SetSymbolScale(float scale)
 {
-       BFont font(be_bold_font);
-       font.SetSize(font.Size() * scale * 1.2);
-       SetFont(&font);
+       if (scale != 1.0f) {
+               BFont font(be_bold_font);
+               font.SetSize(font.Size() * scale * 1.2);
+               SetFont(&font);
+       } else
+               SetFont(be_plain_font);
+
        InvalidateLayout();
 }
 


Other related posts:

  • » [haiku-commits] r38743 - haiku/trunk/src/apps/mediaplayer/interface - axeld