actions for changing styles

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@141 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-22 13:50:14 +00:00
parent b2fa273fe7
commit d33da0b765
2 changed files with 56 additions and 0 deletions
+24
View File
@@ -77,3 +77,27 @@ void ReorderCardsAction::perform(bool to_undo) {
assert(card_id2 < set.cards.size());
swap(set.cards[card_id1], set.cards[card_id2]);
}
// ----------------------------------------------------------------------------- : Change stylesheet
String ChangeCardStyleAction::getName(bool to_undo) const {
return _("Change style");
}
void ChangeCardStyleAction::perform(bool to_undo) {
swap(card->stylesheet, stylesheet);
}
String ChangeSetStyleAction::getName(bool to_undo) const {
return _("Change style (all cards)");
}
void ChangeSetStyleAction::perform(bool to_undo) {
if (!to_undo) {
stylesheet = set.stylesheet;
set.stylesheet = card->stylesheet;
card->stylesheet = StyleSheetP();
} else {
card->stylesheet = set.stylesheet;
set.stylesheet = stylesheet;
}
}