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 { ...@@ -67,9 +67,9 @@ Rotation DataViewer::getRotation() const {
// ----------------------------------------------------------------------------- : Setting data // ----------------------------------------------------------------------------- : Setting data
void DataViewer::setCard(const CardP& card) { void DataViewer::setCard(const CardP& card, bool refresh) {
if (!card) return; // TODO: clear viewer? 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); assert(set);
this->card = card; this->card = card;
stylesheet = set->stylesheetFor(card); stylesheet = set->stylesheetFor(card);
...@@ -124,7 +124,7 @@ ValueViewerP DataViewer::makeViewer(const StyleP& style) { ...@@ -124,7 +124,7 @@ ValueViewerP DataViewer::makeViewer(const StyleP& style) {
void DataViewer::onAction(const Action& action, bool undone) { void DataViewer::onAction(const Action& action, bool undone) {
TYPE_CASE_(action, DisplayChangeAction) { TYPE_CASE_(action, DisplayChangeAction) {
// refresh // refresh
setCard(card); setCard(card, true);
return; return;
} }
TYPE_CASE(action, ValueAction) { TYPE_CASE(action, ValueAction) {
......
...@@ -60,7 +60,8 @@ class DataViewer : public SetView { ...@@ -60,7 +60,8 @@ class DataViewer : public SetView {
// --------------------------------------------------- : Setting data // --------------------------------------------------- : Setting data
/// Display a card in this viewer /// 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 // --------------------------------------------------- : The viewers
protected: 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