mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
Renamed file + reduced window size + resfresh on change
This commit is contained in:
parent
d3d6f70496
commit
c6aba5a6d0
22 changed files with 463 additions and 470 deletions
|
|
@ -18,6 +18,8 @@ AbstractCounter::AbstractCounter(Player *_player, int _id, const QString &_name,
|
|||
setAcceptHoverEvents(true);
|
||||
#endif
|
||||
|
||||
shortcutActive = false;
|
||||
|
||||
if (player->getLocal()) {
|
||||
menu = new QMenu(name);
|
||||
aSet = new QAction(this);
|
||||
|
|
@ -40,6 +42,8 @@ AbstractCounter::AbstractCounter(Player *_player, int _id, const QString &_name,
|
|||
} else
|
||||
menu = 0;
|
||||
|
||||
connect(&settingsCache->shortcuts(), SIGNAL(shortCutchanged()),this,SLOT(refreshShortcuts()));
|
||||
refreshShortcuts();
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
|
|
@ -66,6 +70,7 @@ void AbstractCounter::retranslateUi()
|
|||
void AbstractCounter::setShortcutsActive()
|
||||
{
|
||||
if (name == "life") {
|
||||
shortcutActive = true;
|
||||
aSet->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aSet"));
|
||||
aDec->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aDec"));
|
||||
aInc->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aInc"));
|
||||
|
|
@ -74,6 +79,7 @@ void AbstractCounter::setShortcutsActive()
|
|||
|
||||
void AbstractCounter::setShortcutsInactive()
|
||||
{
|
||||
shortcutActive = false;
|
||||
if (name == "life") {
|
||||
aSet->setShortcut(QKeySequence());
|
||||
aDec->setShortcut(QKeySequence());
|
||||
|
|
@ -81,6 +87,12 @@ void AbstractCounter::setShortcutsInactive()
|
|||
}
|
||||
}
|
||||
|
||||
void AbstractCounter::refreshShortcuts()
|
||||
{
|
||||
if(shortcutActive)
|
||||
setShortcutsActive();
|
||||
}
|
||||
|
||||
void AbstractCounter::setValue(int _value)
|
||||
{
|
||||
value = _value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue