aboutwidget.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #include "ui_aboutwidget.h"
  2. #include "models/patchlist.h"
  3. #include "models/settings.h"
  4. #include "constants.h"
  5. #include "widgets/aboutwidget.h"
  6. #include <QDesktopServices>
  7. AboutWidget::AboutWidget(PatchList *legacy_patches, QWidget *parent)
  8. : QWidget(parent)
  9. , ui(new Ui::AboutWidget)
  10. , legacy_patches_(legacy_patches)
  11. {
  12. ui->setupUi(this);
  13. }
  14. AboutWidget::~AboutWidget()
  15. {
  16. delete ui;
  17. }
  18. void AboutWidget::updateFontsSizes()
  19. {
  20. ui->widget_name_label->setFont(trajan_9pt);
  21. ui->goto_bugs->setFont(trajan_8pt);
  22. ui->goto_donate->setFont(trajan_8pt);
  23. ui->goto_forum->setFont(trajan_8pt);
  24. ui->goto_site->setFont(trajan_8pt);
  25. ui->powered_by->setFont(trajan_10pt);
  26. ui->server_size->setFont(trajan_8pt);
  27. ui->client_side->setFont(trajan_8pt);
  28. }
  29. void AboutWidget::resizeEvent(QResizeEvent *)
  30. {
  31. double coefficient = window_width / default_window_width;
  32. ui->left_panel->move(QPoint(40, 75) * coefficient);
  33. ui->left_panel->resize(QSize(240, 440) * coefficient);
  34. ui->widget_name_label->move(QPoint(45, 33)* coefficient);
  35. ui->widget_name_label->resize(QSize(180, 21) * coefficient);
  36. ui->endevir_icon->setMinimumSize({int(50.0 * coefficient), int(50.0 * coefficient)});
  37. ui->coder_icon->setMinimumSize({int(50.0 * coefficient), int(50.0 * coefficient)});
  38. updateFontsSizes();
  39. }
  40. void AboutWidget::on_goto_site_clicked()
  41. {
  42. QDesktopServices::openUrl(Settings::getValue("Network/site_url").toUrl());
  43. }
  44. void AboutWidget::on_goto_forum_clicked()
  45. {
  46. QDesktopServices::openUrl(Settings::getValue("Network/forum_url").toUrl());
  47. }
  48. void AboutWidget::on_goto_bugs_clicked()
  49. {
  50. QDesktopServices::openUrl(Settings::getValue("Network/add_report_url").toUrl());
  51. }
  52. void AboutWidget::on_goto_donate_clicked()
  53. {
  54. QDesktopServices::openUrl(Settings::getValue("Network/donate_url").toUrl());
  55. }