Skip to content

Commit

Permalink
[GUI] Use an appropriate LCD skin based on the calc type
Browse files Browse the repository at this point in the history
  • Loading branch information
adriweb committed Jun 26, 2017
1 parent 229d4f7 commit fdd5937
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gui/qt/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ void MainWindow::started(bool success) {
guiEmuValid = success;
if (success) {
ui->lcdWidget->setLCD(&lcd);
setCalcSkinTopFromType();
setKeypadColor(settings->value(SETTING_KEYPAD_COLOR, get_device_type() ? KEYPAD_WHITE : KEYPAD_BLACK).toUInt());
} else {
QMessageBox::critical(this, MSG_ERROR, tr("Could not load ROM image. Please see console for more information."));
Expand All @@ -674,6 +675,7 @@ void MainWindow::restored(bool success) {
guiEmuValid = success;
if (success) {
ui->lcdWidget->setLCD(&lcd);
setCalcSkinTopFromType();
setKeypadColor(settings->value(SETTING_KEYPAD_COLOR, get_device_type() ? KEYPAD_WHITE : KEYPAD_BLACK).toUInt());
} else {
QMessageBox::critical(this, MSG_ERROR, tr("Resuming failed.\nPlease reload the ROM from the 'Calculator' menu."));
Expand Down
1 change: 1 addition & 0 deletions gui/qt/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ public slots:
void equatesRefresh();
void selectKeypadColor();
void setKeypadColor(unsigned int);
void setCalcSkinTopFromType();

// Speed
void setEmuSpeed(int);
Expand Down
1 change: 1 addition & 0 deletions gui/qt/resources.qrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<RCC>
<qresource prefix="/skin">
<file>resources/skin/ti84pce.png</file>
<file>resources/skin/ti83pce.png</file>
</qresource>
<qresource prefix="/setup">
<file>resources/setup/home.png</file>
Expand Down
Binary file added gui/qt/resources/skin/ti83pce.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gui/qt/resources/skin/ti84pce.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions gui/qt/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ void MainWindow::setKeypadColor(unsigned int color) {
settings->setValue(SETTING_KEYPAD_COLOR, color);
}

void MainWindow::setCalcSkinTopFromType() {
bool is83 = get_device_type() == TI83PCE;
ui->calcSkinTop->setStyleSheet(is83 ? ".QFrame { border-image: url(:/skin/resources/skin/ti83pce.png) 0 0 0 0 stretch stretch; }"
: ".QFrame { border-image: url(:/skin/resources/skin/ti84pce.png) 0 0 0 0 stretch stretch; }");
}

void MainWindow::setImagePath() {
QString saveImagePath = QFileDialog::getSaveFileName(this, tr("Set saved image to restore from"),
currDir.absolutePath(),
Expand Down

0 comments on commit fdd5937

Please sign in to comment.