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
207ba5ff
Commit
207ba5ff
authored
Sep 04, 2021
by
Niklas Freund
Browse files
Enabled window resizing
parent
3f2dfcd2
Changes
2
Hide whitespace changes
Inline
Side-by-side
kcalc.cpp
View file @
207ba5ff
...
...
@@ -112,8 +112,6 @@ KCalculator::KCalculator(QWidget *parent)
updateGeometry
();
layout
()
->
setSizeConstraint
(
QLayout
::
SetFixedSize
);
updateDisplay
(
UPDATE_FROM_CORE
);
// clear history, otherwise we have a leading "0" in it
calc_history
->
clearHistory
();
...
...
@@ -688,7 +686,7 @@ void KCalculator::updateGeometry()
const
auto
leftPadList
=
leftPad
->
children
();
for
(
QObject
*
obj
:
leftPadList
)
{
if
(
auto
const
button
=
qobject_cast
<
KCalcButton
*>
(
obj
))
{
button
->
set
Fixed
Width
(
em
.
width
()
*
4
+
margin
*
2
);
button
->
set
Minimum
Width
(
em
.
width
()
*
4
+
margin
*
2
);
button
->
installEventFilter
(
this
);
}
}
...
...
@@ -699,7 +697,7 @@ void KCalculator::updateGeometry()
auto
const
button
=
qobject_cast
<
KCalcButton
*>
(
obj
);
// let Shift expand freely
if
(
button
&&
button
!=
pbShift
)
{
button
->
set
Fixed
Width
(
em
.
width
()
*
3
+
margin
*
2
);
button
->
set
Minimum
Width
(
em
.
width
()
*
3
+
margin
*
2
);
button
->
installEventFilter
(
this
);
}
}
...
...
@@ -710,7 +708,7 @@ void KCalculator::updateGeometry()
if
(
auto
const
button
=
qobject_cast
<
KCalcButton
*>
(
obj
))
{
// let pb0 expand freely
if
(
button
!=
pb0
)
{
button
->
set
Fixed
Width
(
em
.
width
()
*
3
+
margin
*
2
);
button
->
set
Minimum
Width
(
em
.
width
()
*
3
+
margin
*
2
);
}
button
->
installEventFilter
(
this
);
}
...
...
kcalc.ui
View file @
207ba5ff
...
...
@@ -28,7 +28,7 @@
<item>
<widget
class=
"KCalcDisplay"
name=
"calc_display"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"MinimumExpanding"
vsizetype=
"
MinimumExpanding
"
>
<sizepolicy
hsizetype=
"MinimumExpanding"
vsizetype=
"
Fixed
"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
...
...
@@ -47,7 +47,7 @@
<item>
<widget
class=
"KCalcBitset"
name=
"mBitset"
native=
"true"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"MinimumExpanding"
vsizetype=
"
MinimumExpanding
"
>
<sizepolicy
hsizetype=
"MinimumExpanding"
vsizetype=
"
Fixed
"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
...
...
@@ -80,19 +80,6 @@
</property>
</widget>
</item>
<item>
<spacer>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
stretch=
"0,0"
>
<property
name=
"leftMargin"
>
...
...
Write
Preview
Markdown
is supported
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