mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Change margins to be a minimum instead of adding them
* The style itself may have added some margins and we don't want to add extra margins, just set a minimum.
This commit is contained in:
@@ -53,9 +53,9 @@ QSize RDTreeViewDelegate::sizeHint(const QStyleOptionViewItem &option, const QMo
|
||||
ret.setHeight(ret.height() + 1);
|
||||
}
|
||||
|
||||
// expand by the margins
|
||||
ret.setWidth(ret.width() + m_View->m_HorizMargin);
|
||||
ret.setHeight(ret.height() + m_View->m_VertMargin);
|
||||
// ensure we have at least the margin on top of font size. If the style applied more, don't add to
|
||||
// it.
|
||||
ret.setHeight(qMax(ret.height(), option.fontMetrics.height() + m_View->m_VertMargin));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -51,12 +51,7 @@ public:
|
||||
void hideBranches() { m_VisibleBranches = false; }
|
||||
void showGridLines() { m_VisibleGridLines = true; }
|
||||
void hideGridLines() { m_VisibleGridLines = false; }
|
||||
void setItemMargins(int horizontal, int vertical)
|
||||
{
|
||||
m_HorizMargin = horizontal;
|
||||
m_VertMargin = vertical;
|
||||
}
|
||||
int horizontalItemMargin() { return m_HorizMargin; }
|
||||
void setItemVerticalMargin(int vertical) { m_VertMargin = vertical; }
|
||||
int verticalItemMargin() { return m_VertMargin; }
|
||||
protected:
|
||||
void drawRow(QPainter *painter, const QStyleOptionViewItem &options,
|
||||
@@ -67,7 +62,7 @@ private:
|
||||
bool m_VisibleBranches = true;
|
||||
bool m_VisibleGridLines = true;
|
||||
|
||||
int m_HorizMargin = 3, m_VertMargin = 3;
|
||||
int m_VertMargin = 6;
|
||||
|
||||
friend class RDTreeViewDelegate;
|
||||
};
|
||||
|
||||
@@ -85,6 +85,8 @@ EventBrowser::EventBrowser(ICaptureContext &ctx, QWidget *parent)
|
||||
// becomes quickly infuriating to rearrange, just disable until that can be fixed.
|
||||
ui->events->header()->setSectionsMovable(false);
|
||||
|
||||
ui->events->setItemVerticalMargin(3);
|
||||
|
||||
UpdateDurationColumn();
|
||||
|
||||
m_FindHighlight = new QTimer(this);
|
||||
|
||||
Reference in New Issue
Block a user