mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed icon scale in settings dialog
This commit is contained in:
parent
34775094f6
commit
e518cff06e
2 changed files with 7 additions and 4 deletions
|
@ -10,7 +10,8 @@ namespace widgets {
|
||||||
|
|
||||||
SettingsDialogTab::SettingsDialogTab(SettingsDialog *_dialog, settingspages::SettingsPage *_page,
|
SettingsDialogTab::SettingsDialogTab(SettingsDialog *_dialog, settingspages::SettingsPage *_page,
|
||||||
QString imageFileName)
|
QString imageFileName)
|
||||||
: dialog(_dialog)
|
: BaseWidget(_dialog)
|
||||||
|
, dialog(_dialog)
|
||||||
, page(_page)
|
, page(_page)
|
||||||
{
|
{
|
||||||
this->ui.labelText = page->getName();
|
this->ui.labelText = page->getName();
|
||||||
|
@ -47,8 +48,8 @@ void SettingsDialogTab::paintEvent(QPaintEvent *)
|
||||||
|
|
||||||
this->style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
|
this->style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
|
||||||
|
|
||||||
int a = (this->height() - 20) / 2;
|
int a = (this->height() - (20 * this->getScale())) / 2;
|
||||||
QPixmap pixmap = this->ui.icon.pixmap(QSize(20, 20));
|
QPixmap pixmap = this->ui.icon.pixmap(QSize(this->height() - a * 2, this->height() - a * 2));
|
||||||
|
|
||||||
painter.drawPixmap(a, a, pixmap);
|
painter.drawPixmap(a, a, pixmap);
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#include <QPaintEvent>
|
#include <QPaintEvent>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include "widgets/basewidget.hpp"
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
namespace widgets {
|
namespace widgets {
|
||||||
namespace settingspages {
|
namespace settingspages {
|
||||||
|
@ -12,7 +14,7 @@ class SettingsPage;
|
||||||
|
|
||||||
class SettingsDialog;
|
class SettingsDialog;
|
||||||
|
|
||||||
class SettingsDialogTab : public QWidget
|
class SettingsDialogTab : public BaseWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue