Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
KCalc
Commits
c4ae4fde
Commit
c4ae4fde
authored
Oct 11, 2021
by
Niklas Freund
Browse files
Make KCalcDisplay font size dependent on width AND height, not just height
parent
ee3594b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
kcalcdisplay.cpp
View file @
c4ae4fde
...
...
@@ -621,11 +621,11 @@ void KCalcDisplay::updateFont()
{
// Make a working copy of the font
QFont
*
newFont
=
new
QFont
(
baseFont
());
// Calculate ideal font size
// constant arbitrarily chosen, adjust/increase if scaling issues arise
newFont
->
setPointSizeF
(
qMax
(
double
(
baseFont
().
pointSize
()),
contentsRect
().
height
()
/
3
.6
));
// constant
s
arbitrarily chosen, adjust/increase if scaling issues arise
newFont
->
setPointSizeF
(
qMax
(
double
(
baseFont
().
pointSize
()),
qMin
(
contentsRect
().
height
()
/
4.5
,
contentsRect
().
width
()
/
24
.6
))
)
;
// Apply font
QFrame
::
setFont
(
*
newFont
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment