Commit c6a84f9b authored by twanvl's avatar twanvl

Fixed: card box not resized when rotating cards

parent ed0c9281
......@@ -67,9 +67,9 @@ Rotation DataViewer::getRotation() const {
// ----------------------------------------------------------------------------- : Setting data
void DataViewer::setCard(const CardP& card) {
void DataViewer::setCard(const CardP& card, bool refresh) {
if (!card) return; // TODO: clear viewer?
if (this->card == card && this->stylesheet == set->stylesheetFor(card)) return; // already set
if (!refresh && this->card == card && this->stylesheet == set->stylesheetFor(card)) return; // already set
assert(set);
this->card = card;
stylesheet = set->stylesheetFor(card);
......@@ -124,7 +124,7 @@ ValueViewerP DataViewer::makeViewer(const StyleP& style) {
void DataViewer::onAction(const Action& action, bool undone) {
TYPE_CASE_(action, DisplayChangeAction) {
// refresh
setCard(card);
setCard(card, true);
return;
}
TYPE_CASE(action, ValueAction) {
......
......@@ -60,7 +60,8 @@ class DataViewer : public SetView {
// --------------------------------------------------- : Setting data
/// Display a card in this viewer
void setCard(const CardP& card);
/** \param refresh: Always refresh, even if this card is already shown */
void setCard(const CardP& card, bool refresh = false);
// --------------------------------------------------- : The viewers
protected:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment