mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
kdeplasma-addons: adjust calculator applet to KLocale changes
requires ee10c1a6c3a2037421df7b4b0f4b190aecee9ed2 from kde-workspace Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
f9ca9dd0f9
commit
fff806fa8c
1 changed files with 4 additions and 6 deletions
|
@ -38,7 +38,7 @@ Item {
|
||||||
property bool hasResult: false;
|
property bool hasResult: false;
|
||||||
property bool showingInput: true;
|
property bool showingInput: true;
|
||||||
property bool showingResult: false;
|
property bool showingResult: false;
|
||||||
property string operator: undefined;
|
property string operator: "";
|
||||||
property real operand: 0;
|
property real operand: 0;
|
||||||
property bool commaPressed: false;
|
property bool commaPressed: false;
|
||||||
property int decimals: 0;
|
property int decimals: 0;
|
||||||
|
@ -134,8 +134,7 @@ Item {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
display.text = algarismCount(result * Math.pow(10, decimals)) > maxInputLength?
|
display.text = algarismCount(result * Math.pow(10, decimals)) > maxInputLength ? "E" : result;
|
||||||
"E" : result;
|
|
||||||
showingInput = false;
|
showingInput = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,8 +178,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function algarismCount(number) {
|
function algarismCount(number) {
|
||||||
return number == 0? 1 :
|
return number == 0 ? 1 : Math.floor(Math.log(Math.abs(number))/Math.log(10)) + 1;
|
||||||
Math.floor(Math.log(Math.abs(number))/Math.log(10)) + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Locale.Locale {
|
Locale.Locale {
|
||||||
|
@ -360,7 +358,7 @@ Item {
|
||||||
PlasmaComponents.Button {
|
PlasmaComponents.Button {
|
||||||
width: buttonWidth;
|
width: buttonWidth;
|
||||||
height: buttonHeight;
|
height: buttonHeight;
|
||||||
text: locale.decimalSymbol;
|
text: locale.toLocale().decimalPoint;
|
||||||
onClicked: decimalClicked();
|
onClicked: decimalClicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue