settingswidget.cpp 1023 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "gui\settingswidget.h"
  2. #include "ui_settingswidget.h"
  3. #include "legacyapp.h"
  4. #include <QDebug>
  5. SettingsWidget::SettingsWidget(LegacyApp *_app, QWidget *parent) :
  6. QWidget(parent),
  7. ui(new Ui::SettingsWidget),
  8. app(_app)
  9. {
  10. ui->setupUi(this);
  11. }
  12. SettingsWidget::~SettingsWidget()
  13. {
  14. delete ui;
  15. }
  16. void SettingsWidget::UpdateFolderPath()
  17. {
  18. // QString path =
  19. }
  20. void SettingsWidget::on_download_restrict_slider_valueChanged(int value)
  21. {
  22. if (value >= 1024) {
  23. double new_value = double(value) / 1024;
  24. ui->download_speed_label_common->setText(QString::number(new_value, 'g', 2) + " Мб/с");
  25. } else {
  26. ui->download_speed_label_common->setText(QString::number(value) + " Кб/с");
  27. }
  28. }
  29. void SettingsWidget::on_interface_scale_combobox_common_currentIndexChanged(const QString &arg1)
  30. {
  31. int value = arg1.left(arg1.length() - 1).toInt();
  32. app->window.changeFontSizeRecursive(value, &app->window);
  33. app->window.resize(900 * value / 100, 650 * value / 100);
  34. }