本文整理汇总了C++中DocumentPtr::triggerLayout方法的典型用法代码示例。如果您正苦于以下问题:C++ DocumentPtr::triggerLayout方法的具体用法?C++ DocumentPtr::triggerLayout怎么用?C++ DocumentPtr::triggerLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentPtr
的用法示例。
在下文中一共展示了DocumentPtr::triggerLayout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPropertyFromString
//.........这里部分代码省略.........
case Property::POSITION:
position_ = sp->getEnum<Position>();
break;
case Property::DIRECTION:
direction_ = sp->getEnum<Direction>();
break;
case Property::FLOAT:
float_ = sp->getEnum<Float>();
break;
case Property::CSS_OVERFLOW:
overflow_ = sp->getEnum<Overflow>();
break;
case Property::LINE_HEIGHT:
*line_height_ = *sp->asType<Length>();
break;
case Property::BACKGROUND_CLIP:
background_clip_ = sp->getEnum<BackgroundClip>();
break;
case Property::FILTER:
*filters_ = *sp->asType<FilterStyle>();
break;
case Property::COUNTER_INCREMENT:
case Property::COUNTER_RESET:
case Property::CURSOR:
case Property::FONT_FAMILY:
case Property::FONT_SIZE:
case Property::FONT_STYLE:
case Property::FONT_VARIANT:
case Property::FONT_WEIGHT:
case Property::LETTER_SPACING:
case Property::LIST_STYLE_IMAGE:
case Property::LIST_STYLE_POSITION:
case Property::LIST_STYLE_TYPE:
case Property::MARGIN_TOP:
case Property::MARGIN_LEFT:
case Property::MARGIN_BOTTOM:
case Property::MARGIN_RIGHT:
case Property::MAX_HEIGHT:
case Property::MAX_WIDTH:
case Property::MIN_HEIGHT:
case Property::MIN_WIDTH:
case Property::OUTLINE_WIDTH:
case Property::PADDING_TOP:
case Property::PADDING_LEFT:
case Property::PADDING_RIGHT:
case Property::PADDING_BOTTOM:
case Property::QUOTES:
case Property::TABLE_LAYOUT:
case Property::TEXT_ALIGN:
case Property::TEXT_DECORATION:
case Property::TEXT_INDENT:
case Property::TEXT_TRANSFORM:
case Property::UNICODE_BIDI:
case Property::VERTICAL_ALIGN:
case Property::VISIBILITY:
case Property::WHITE_SPACE:
case Property::WORD_SPACING:
case Property::Z_INDEX:
case Property::BOX_SHADOW:
case Property::TEXT_SHADOW:
case Property::TRANSITION_PROPERTY:
case Property::TRANSITION_DURATION:
case Property::TRANSITION_TIMING_FUNCTION:
case Property::TRANSITION_DELAY:
case Property::BORDER_TOP_LEFT_RADIUS:
case Property::BORDER_TOP_RIGHT_RADIUS:
case Property::BORDER_BOTTOM_LEFT_RADIUS:
case Property::BORDER_BOTTOM_RIGHT_RADIUS:
case Property::BORDER_SPACING:
case Property::OPACITY:
case Property::BORDER_IMAGE_SOURCE:
case Property::BORDER_IMAGE_SLICE:
case Property::BORDER_IMAGE_WIDTH:
case Property::BORDER_IMAGE_OUTSET:
case Property::BORDER_IMAGE_REPEAT:
LOG_ERROR("implement me");
break;
case Property::EMPTY_CELLS:
case Property::WIDOWS:
case Property::ORPHANS:
case Property::CAPTION_SIDE:
case Property::BORDER_COLLAPSE:
break;
default:
ASSERT_LOG(false, "Unrecognised property value: " << static_cast<int>(p));
break;
}
NodePtr node = node_.lock();
ASSERT_LOG(node != nullptr, "No node associated with this style node.");
DocumentPtr doc = node->getOwnerDoc();
ASSERT_LOG(doc != nullptr, "No owner document found.");
if(doc!= nullptr && (sp->requiresLayout(p) || force_layout)) {
//LOG_ERROR("Layout triggered from style.");
doc->triggerLayout();
} else if(doc!= nullptr && (sp->requiresRender(p) || force_render)) {
//LOG_ERROR("Render triggered from style.");
doc->triggerRender();
}
}