From 90c518c2c2e69b7a545fb31506a81348e702ca34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Mon, 27 Jul 2009 16:09:50 +0000 Subject: [PATCH] Make sure the font size for the window labels does not grow beyond the system plain font size. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31816 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/WorkspacesView.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/servers/app/WorkspacesView.cpp b/src/servers/app/WorkspacesView.cpp index 36ceaeab08..83c7ff77d4 100644 --- a/src/servers/app/WorkspacesView.cpp +++ b/src/servers/app/WorkspacesView.cpp @@ -13,6 +13,7 @@ #include "AppServer.h" #include "Desktop.h" #include "DrawingEngine.h" +#include "ServerApp.h" #include "Window.h" #include "Workspace.h" @@ -302,8 +303,11 @@ WorkspacesView::_DrawWorkspace(DrawingEngine* drawingEngine, drawingEngine->ConstrainClippingRegion(&backgroundRegion); ServerFont font = fDrawState->Font(); - font.SetSize(ceilf(max_c(9.0, - min_c(Frame().Height(), Frame().Width()) / 15))); + font.SetSize(fWindow->ServerWindow()->App()->PlainFont().Size()); + float reducedSize = ceilf(max_c(8.0f, + min_c(Frame().Height(), Frame().Width()) / 15)); + if (font.Size() > reducedSize) + font.SetSize(reducedSize); fDrawState->SetFont(font); drawingEngine->SetFont(font);