diff options
author | Ken Moore <ken@ixsystems.com> | 2016-10-20 13:10:27 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2016-10-20 13:10:27 -0400 |
commit | b7ee5390b1dc9cdc3135e0468ffe200b7c436a2b (patch) | |
tree | bb65ce163b22bb0afb16919d50fc49c72169773a /src-qt5/desktop-utils/lumina-calculator/mainUI.cpp | |
parent | Add the app registration for lumina-calculator. (diff) | |
download | lumina-b7ee5390b1dc9cdc3135e0468ffe200b7c436a2b.tar.gz lumina-b7ee5390b1dc9cdc3135e0468ffe200b7c436a2b.tar.bz2 lumina-b7ee5390b1dc9cdc3135e0468ffe200b7c436a2b.zip |
Hook up the Lumina theme engine into lumina-calculator for icon changes, as well as the translation loading mechanisms.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-calculator/mainUI.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-calculator/mainUI.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp b/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp index 539fbb8e..3db2e028 100644 --- a/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp +++ b/src-qt5/desktop-utils/lumina-calculator/mainUI.cpp @@ -37,18 +37,22 @@ mainUI::mainUI() : QMainWindow(), ui(new Ui::mainUI()){ connect(ui->button_Equal, SIGNAL (clicked()), this, SLOT (start_calc())); this->setWindowTitle(tr("Calculator")); - this->setWindowIcon( LXDG::findIcon("accessories-calculator","") ); + updateIcons(); ui->line_eq->setFocus(); } mainUI::~mainUI(){ } +void mainUI::updateIcons(){ + this->setWindowIcon( LXDG::findIcon("accessories-calculator","") ); +} + void mainUI::start_calc(){ if(ui->line_eq->text().isEmpty()){ return; } //nothing to do double result = strToNumber(ui->line_eq->text()); if(result!=result){ return; } //bad calculation - NaN's values are special in that they don't equal itself - QString res = "%1 \t(%2)"; + QString res = "%1 \t= [ %2 ]"; ui->list_results->addItem(res.arg(QString::number(result), ui->line_eq->text())); ui->list_results->scrollToItem( ui->list_results->item( ui->list_results->count()-1) ); ui->line_eq->clear(); |