| 223 | |
| 224 | |
| 225 | void ByteView::adjustSize(int width, int height) |
| 226 | { |
| 227 | m_render.setFont(getFont()); |
| 228 | |
| 229 | m_addrWidth = QString::number(m_data->GetEnd(), 16).size(); |
| 230 | if (m_addrWidth < 8) |
| 231 | m_addrWidth = 8; |
| 232 | int cols = ((width - 4) / m_render.getFontWidth()) - ((int)m_addrWidth + 2); |
| 233 | if (cols < 1) |
| 234 | cols = 1; |
| 235 | if ((size_t)cols != m_cols) |
| 236 | { |
| 237 | m_cols = (size_t)cols; |
| 238 | if (m_topLine < m_lines.size()) |
| 239 | setTopToAddress(m_lines[m_topLine].address); |
| 240 | else |
| 241 | setTopToAddress(m_cursorAddr); |
| 242 | refreshLines(); |
| 243 | } |
| 244 | m_visibleRows = (size_t)((height - 4) / m_render.getFontHeight()); |
| 245 | verticalScrollBar()->setPageStep((int)(m_visibleRows * m_cols / m_scrollBarMultiplier)); |
| 246 | refreshAtCurrentLocation(); |
| 247 | viewport()->update(); |
| 248 | } |
| 249 | |
| 250 | |
| 251 | uint64_t ByteView::getContiguousOffsetForAddress(uint64_t addr) |