mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2025-12-30 02:37:51 -05:00
* Removing .qm files from Windows build as they are inbuilt as of a7adfe251
* Moving translation change code to the OpenRGBSettingsPage
* Adding a changeEvent() to applicable Widgets to facilitate language updates
* Workaround added to TabLabel to accomodate translation context origin
* Added zh_TW locale to OpenRGB.pro
* Updated all translations to include the latest untranslated strings
62 lines
1.3 KiB
C++
62 lines
1.3 KiB
C++
#include "OpenRGBZoneResizeDialog.h"
|
|
|
|
using namespace Ui;
|
|
|
|
OpenRGBZoneResizeDialog::OpenRGBZoneResizeDialog(int size_min, int size_max, int size_current, QWidget *parent) :
|
|
QDialog(parent),
|
|
ui(new Ui::OpenRGBZoneResizeDialogUi)
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
ui->ResizeSlider->setRange(size_min, size_max);
|
|
ui->ResizeBox->setRange(size_min, size_max);
|
|
|
|
ui->ResizeSlider->setValue(size_current);
|
|
ui->ResizeBox->setValue(size_current);
|
|
}
|
|
|
|
OpenRGBZoneResizeDialog::~OpenRGBZoneResizeDialog()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void OpenRGBZoneResizeDialog::changeEvent(QEvent *event)
|
|
{
|
|
if(event->type() == QEvent::LanguageChange)
|
|
{
|
|
ui->retranslateUi(this);
|
|
}
|
|
}
|
|
|
|
void Ui::OpenRGBZoneResizeDialog::on_ResizeSlider_valueChanged(int value)
|
|
{
|
|
ui->ResizeBox->blockSignals(true);
|
|
ui->ResizeBox->setValue(value);
|
|
ui->ResizeBox->blockSignals(false);
|
|
}
|
|
|
|
void Ui::OpenRGBZoneResizeDialog::on_ResizeBox_valueChanged(int value)
|
|
{
|
|
ui->ResizeSlider->blockSignals(true);
|
|
ui->ResizeSlider->setValue(value);
|
|
ui->ResizeSlider->blockSignals(false);
|
|
}
|
|
|
|
int Ui::OpenRGBZoneResizeDialog::show()
|
|
{
|
|
int ret_val = 0;
|
|
|
|
int result = this->exec();
|
|
|
|
if(result == QDialog::Rejected)
|
|
{
|
|
ret_val = -1;
|
|
}
|
|
else
|
|
{
|
|
ret_val = ui->ResizeBox->value();
|
|
}
|
|
|
|
return(ret_val);
|
|
}
|