Skip to content
GitLab
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
8d861b83
Commit
8d861b83
authored
Sep 04, 2021
by
Niklas Freund
Browse files
Fixed leftPad buttons not scaling correctly
parent
012be435
Changes
2
Hide whitespace changes
Inline
Side-by-side
kcalc.cpp
View file @
8d861b83
...
...
@@ -697,9 +697,7 @@ void KCalculator::updateGeometry()
// right pad
const
auto
rightPadList
=
rightPad
->
children
();
for
(
QObject
*
obj
:
rightPadList
)
{
auto
const
button
=
qobject_cast
<
KCalcButton
*>
(
obj
);
// let Shift expand freely
if
(
button
&&
button
!=
pbShift
)
{
if
(
auto
const
button
=
qobject_cast
<
KCalcButton
*>
(
obj
))
{
button
->
setMinimumWidth
(
em
.
width
()
*
3
+
margin
*
2
);
button
->
installEventFilter
(
this
);
}
...
...
kcalc_button.cpp
View file @
8d861b83
...
...
@@ -191,15 +191,8 @@ void KCalcButton::calcSizeHint()
// want narrow margin than normal
margin
=
qMax
(
margin
/
2
,
3
);
// approximation because metrics doesn't account for richtext
size_
=
fontMetrics
().
size
(
0
,
mode_
[
ModeNormal
].
label
);
if
(
mode_
.
contains
(
ModeShift
))
{
size_
=
size_
.
expandedTo
(
fontMetrics
().
size
(
0
,
mode_
[
ModeShift
].
label
));
}
if
(
mode_
.
contains
(
ModeHyperbolic
))
{
size_
=
size_
.
expandedTo
(
fontMetrics
().
size
(
0
,
mode_
[
ModeHyperbolic
].
label
));
}
// simply use font size of a single letter
size_
=
fontMetrics
().
size
(
0
,
QStringLiteral
(
"M"
));
size_
+=
QSize
(
margin
*
2
,
margin
*
2
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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