ScreenSaver: Make preview relative to font size.

* This commit got somehow eaten by git rebase :-/
This commit is contained in:
Axel Dörfler
2015-09-14 20:54:26 +02:00
parent 64ee9242db
commit 268e4ea27d
+3 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2013 Haiku, Inc. All Rights Reserved.
* Copyright 2003-2015 Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -10,6 +10,7 @@
#include "PreviewView.h"
#include <algorithm>
#include <iostream>
#include <CardLayout.h>
@@ -137,7 +138,7 @@ PreviewView::AddPreview()
float aspectRatio = 4.0f / 3.0f;
// 4:3 monitor
float previewWidth = 120.0f;
float previewWidth = 120.0f * std::max(1.0f, be_plain_font->Size() / 12.0f);
float previewHeight = ceilf(previewWidth / aspectRatio);
fSaverView->SetExplicitSize(BSize(previewWidth, previewHeight));