void Viewport::setScene(Scene *scene) { m_scene = scene; scene->setParentItem(this); setContentWidth(scene->width()); setContentHeight(scene->height()); setVisible(true); updateMaxOffsets(); }
void HexView::recalcWidth() { int sizeOfOffsets = (2 + offsetLen()) * asciiSpacer(); int spacers = 0; if (showOffsets()) { spacers += spacer() + sizeOfOffsets; } if (showHex()) { spacers += spacer() + (bytesPerRow() * hexSpacer()); } if (showAscii()) { spacers += bytesPerRow() * asciiSpacer(); } setContentWidth( spacers ); }
void LineBox::handleLayout(LayoutEngine& eng, const Dimensions& containing) { calculateHorzMPB(containing.content_.width); calculateVertMPB(containing.content_.height); int child_height = 0; FixedPoint width = 0; for(auto& child : getChildren()) { if(!child->isFloat()) { //child_height += child->getMBPHeight() + child->getHeight(); child_height = std::max(child_height, child->getTop() + child->getMBPBottom() + child->getHeight()); width = std::max(width, child->getLeft() + child->getWidth() + child->getMBPWidth()); } } setContentHeight(child_height); setContentWidth(width); }
void Windowiki::setContentSize(int width, int height) { setContentWidth(width); setContentHeight(height); }