Card preview on style panel is refreshed when styling changes

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@492 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-07-05 17:33:53 +00:00
parent ec1a7c82cd
commit 5a619e4ee7
3 changed files with 20 additions and 0 deletions
+14
View File
@@ -16,6 +16,9 @@
#include <data/card.hpp>
#include <data/stylesheet.hpp>
#include <data/action/set.hpp>
#include <data/action/value.hpp>
DECLARE_TYPEOF_COLLECTION(FieldP);
// ----------------------------------------------------------------------------- : StylePanel
@@ -68,6 +71,17 @@ void StylePanel::onAction(const Action& action, bool undone) {
editor->showCard(card);
}
}
TYPE_CASE(action, ValueAction) {
// is it a styling action?
const StyleSheet& s = set->stylesheetFor(card);
FOR_EACH_CONST(f, s.styling_fields) {
if (action.valueP->fieldP == f) {
// refresh the viewer
preview->redraw();
return;
}
}
}
use_for_all->Enable(card && card->stylesheet);
use_custom_options->Enable(card);
use_custom_options->SetValue(card->has_styling);