Added optional card scaling setting
+ Users can now enable/disable the mouse over card scaling.
This commit is contained in:
parent
b1231e6442
commit
441cb4447a
5 changed files with 18 additions and 2 deletions
|
@ -191,7 +191,7 @@ void AbstractCardItem::setHovered(bool _hovered)
|
|||
processHoverEvent();
|
||||
isHovered = _hovered;
|
||||
setZValue(_hovered ? 2000000004 : realZValue);
|
||||
setScale(_hovered ? 1.1 : 1);
|
||||
setScale(_hovered && settingsCache->getScaleCards() ? 1.1 : 1);
|
||||
setTransformOriginPoint(_hovered ? CARD_WIDTH / 2 : 0, _hovered ? CARD_HEIGHT / 2 : 0);
|
||||
update();
|
||||
}
|
||||
|
|
|
@ -300,8 +300,12 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
displayCardNamesCheckBox.setChecked(settingsCache->getDisplayCardNames());
|
||||
connect(&displayCardNamesCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setDisplayCardNames(int)));
|
||||
|
||||
cardScalingCheckBox.setChecked(settingsCache->getScaleCards());
|
||||
connect(&cardScalingCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setCardScaling(int)));
|
||||
|
||||
QGridLayout *cardsGrid = new QGridLayout;
|
||||
cardsGrid->addWidget(&displayCardNamesCheckBox, 0, 0, 1, 2);
|
||||
cardsGrid->addWidget(&cardScalingCheckBox, 1, 0, 1, 2);
|
||||
|
||||
cardsGroupBox = new QGroupBox;
|
||||
cardsGroupBox->setLayout(cardsGrid);
|
||||
|
@ -351,6 +355,7 @@ void AppearanceSettingsPage::retranslateUi()
|
|||
|
||||
cardsGroupBox->setTitle(tr("Card rendering"));
|
||||
displayCardNamesCheckBox.setText(tr("Display card names on cards having a picture"));
|
||||
cardScalingCheckBox.setText(tr("Scale cards on mouse over"));
|
||||
|
||||
handGroupBox->setTitle(tr("Hand layout"));
|
||||
horizontalHandCheckBox.setText(tr("Display hand horizontally (wastes space)"));
|
||||
|
|
|
@ -98,6 +98,7 @@ private:
|
|||
QLineEdit *playerAreaBgEdit;
|
||||
QLineEdit *cardBackPicturePathEdit;
|
||||
QCheckBox displayCardNamesCheckBox;
|
||||
QCheckBox cardScalingCheckBox;
|
||||
QCheckBox horizontalHandCheckBox;
|
||||
QCheckBox invertVerticalCoordinateCheckBox;
|
||||
QGroupBox *zoneBgGroupBox;
|
||||
|
|
|
@ -73,6 +73,13 @@ SettingsCache::SettingsCache()
|
|||
ignoreUnregisteredUserMessages = settings->value("chat/ignore_unregistered_messages", false).toBool();
|
||||
|
||||
attemptAutoConnect = settings->value("server/auto_connect", 0).toBool();
|
||||
|
||||
scaleCards = settings->value("cards/scaleCards", true).toBool();
|
||||
}
|
||||
|
||||
void SettingsCache::setCardScaling(const int _scaleCards) {
|
||||
scaleCards = _scaleCards;
|
||||
settings->setValue("cards/scaleCards", scaleCards);
|
||||
}
|
||||
|
||||
void SettingsCache::setLang(const QString &_lang)
|
||||
|
|
|
@ -74,6 +74,7 @@ private:
|
|||
QString picUrlHqFallback;
|
||||
bool attemptAutoConnect;
|
||||
int pixmapCacheSize;
|
||||
bool scaleCards;
|
||||
public:
|
||||
SettingsCache();
|
||||
const QByteArray &getMainWindowGeometry() const { return mainWindowGeometry; }
|
||||
|
@ -125,6 +126,7 @@ public:
|
|||
void copyPath(const QString &src, const QString &dst);
|
||||
bool getAutoConnect() const { return attemptAutoConnect; }
|
||||
int getPixmapCacheSize() const { return pixmapCacheSize; }
|
||||
bool getScaleCards() const { return scaleCards; }
|
||||
public slots:
|
||||
void setMainWindowGeometry(const QByteArray &_mainWindowGeometry);
|
||||
void setLang(const QString &_lang);
|
||||
|
@ -169,6 +171,7 @@ public slots:
|
|||
void setPicUrlHqFallback(const QString &_picUrlHqFallback);
|
||||
void setAutoConnect(const bool &_autoConnect);
|
||||
void setPixmapCacheSize(const int _pixmapCacheSize);
|
||||
void setCardScaling(const int _scaleCards);
|
||||
};
|
||||
|
||||
extern SettingsCache *settingsCache;
|
||||
|
|
Loading…
Reference in a new issue