mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
RDStyle is based on QCommonStyle
* This gives us a consistent baseline to start from and ensures that any things we don't customise and leave to defaults will still be the same wherever we are running.
This commit is contained in:
@@ -58,7 +58,7 @@ static const int ComboMargin = 2;
|
||||
static const int ComboArrowDim = 12;
|
||||
};
|
||||
|
||||
RDStyle::RDStyle(ColorScheme scheme) : RDTweakedNativeStyle()
|
||||
RDStyle::RDStyle(ColorScheme scheme) : RDTweakedNativeStyle(new QCommonStyle())
|
||||
{
|
||||
m_Scheme = scheme;
|
||||
}
|
||||
@@ -456,16 +456,6 @@ int RDStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QWid
|
||||
return 1;
|
||||
}
|
||||
|
||||
// use the common style for these
|
||||
if(metric == PM_LayoutLeftMargin || metric == PM_LayoutLeftMargin ||
|
||||
metric == PM_LayoutTopMargin || metric == PM_LayoutRightMargin ||
|
||||
metric == PM_LayoutBottomMargin || metric == PM_LayoutHorizontalSpacing ||
|
||||
metric == PM_LayoutVerticalSpacing || metric == PM_DefaultTopLevelMargin ||
|
||||
metric == PM_DefaultChildMargin || metric == PM_DefaultLayoutSpacing)
|
||||
{
|
||||
return QCommonStyle::pixelMetric(metric, opt, widget);
|
||||
}
|
||||
|
||||
if(metric == PM_ScrollBarExtent)
|
||||
return Constants::ScrollButtonDim + 2;
|
||||
|
||||
@@ -484,6 +474,9 @@ int RDStyle::styleHint(StyleHint stylehint, const QStyleOption *opt, const QWidg
|
||||
if(stylehint == QStyle::SH_ComboBox_Popup)
|
||||
return false;
|
||||
|
||||
if(stylehint == SH_ToolTipLabel_Opacity)
|
||||
return 255;
|
||||
|
||||
return RDTweakedNativeStyle::styleHint(stylehint, opt, widget, returnData);
|
||||
}
|
||||
|
||||
@@ -780,11 +773,6 @@ void RDStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *opt, Q
|
||||
// don't draw focus rects
|
||||
return;
|
||||
}
|
||||
else if(element == QStyle::PE_PanelItemViewRow || element == QStyle::PE_PanelItemViewItem)
|
||||
{
|
||||
// common style rendering is fine here
|
||||
return QCommonStyle::drawPrimitive(element, opt, p, widget);
|
||||
}
|
||||
|
||||
RDTweakedNativeStyle::drawPrimitive(element, opt, p, widget);
|
||||
}
|
||||
@@ -936,11 +924,6 @@ void RDStyle::drawControl(ControlElement control, const QStyleOption *opt, QPain
|
||||
// don't draw size grips
|
||||
return;
|
||||
}
|
||||
else if(control == CE_ItemViewItem || control == CE_ComboBoxLabel)
|
||||
{
|
||||
// common style rendering is fine for these
|
||||
return QCommonStyle::drawControl(control, opt, p, widget);
|
||||
}
|
||||
else if(control == CE_ShapedFrame)
|
||||
{
|
||||
const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt);
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <QPen>
|
||||
#include <QStyleOption>
|
||||
|
||||
RDTweakedNativeStyle::RDTweakedNativeStyle() : QProxyStyle()
|
||||
RDTweakedNativeStyle::RDTweakedNativeStyle(QStyle *parent) : QProxyStyle(parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class RDTweakedNativeStyle : public QProxyStyle
|
||||
private:
|
||||
Q_OBJECT
|
||||
public:
|
||||
RDTweakedNativeStyle();
|
||||
RDTweakedNativeStyle(QStyle *parent);
|
||||
~RDTweakedNativeStyle();
|
||||
|
||||
virtual QRect subElementRect(SubElement element, const QStyleOption *option,
|
||||
|
||||
Reference in New Issue
Block a user