GRAPHICS: GUI: Take tab shadow size from theme

This commit is contained in:
Eugene Sandulenko 2021-04-13 08:08:49 +02:00
parent 05ea21c94d
commit c27ad28ab2
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
3 changed files with 13 additions and 12 deletions

View File

@ -239,8 +239,9 @@ public:
* @param w Width of the tab
* @param h Height of the tab
* @param r Radius of the corners of the tab (0 for squared tabs).
* @param s Shadow size
*/
virtual void drawTab(int x, int y, int r, int w, int h) = 0;
virtual void drawTab(int x, int y, int r, int w, int h, int s) = 0;
/**
* Simple helper function to draw a cross.
@ -451,7 +452,7 @@ public:
void drawCallback_TAB(const Common::Rect &area, const DrawStep &step) {
uint16 x, y, w, h;
stepGetPositions(step, area, x, y, w, h);
drawTab(x, y, stepGetRadius(step, area), w, h);
drawTab(x, y, stepGetRadius(step, area), w, h, step.shadow);
}
void drawCallback_BITMAP(const Common::Rect &area, const DrawStep &step) {

View File

@ -1237,7 +1237,7 @@ drawRoundedSquare(int x, int y, int r, int w, int h) {
template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawTab(int x, int y, int r, int w, int h) {
drawTab(int x, int y, int r, int w, int h, int s) {
if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h ||
w <= 0 || h <= 0 || x < 0 || y < 0 || r > w || r > h)
return;
@ -1267,12 +1267,12 @@ drawTab(int x, int y, int r, int w, int h) {
// See the rounded rect alg for how to fix it. (The border should
// be drawn before the interior, both inside drawTabAlg.)
if (useClippingVersions) {
drawTabShadowClip(x, y, w - 2, h, r);
drawTabShadowClip(x, y, w - 2, h, r, s);
drawTabAlgClip(x, y, w - 2, h, r, _bgColor, Base::_fillMode);
if (Base::_strokeWidth)
drawTabAlgClip(x, y, w, h, r, _fgColor, kFillDisabled, (Base::_dynamicData >> 16), (Base::_dynamicData & 0xFFFF));
} else {
drawTabShadow(x, y, w - 2, h, r);
drawTabShadow(x, y, w - 2, h, r, s);
drawTabAlg(x, y, w - 2, h, r, _bgColor, Base::_fillMode);
if (Base::_strokeWidth)
drawTabAlg(x, y, w, h, r, _fgColor, kFillDisabled, (Base::_dynamicData >> 16), (Base::_dynamicData & 0xFFFF));
@ -1598,8 +1598,8 @@ drawTabAlgClip(int x1, int y1, int w, int h, int r, PixelType color, VectorRende
template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawTabShadow(int x1, int y1, int w, int h, int r) {
int offset = 3;
drawTabShadow(int x1, int y1, int w, int h, int r, int s) {
int offset = s;
int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
// "Harder" shadows when having lower BPP, since we will have artifacts (greenish tint on the modern theme)
@ -1659,8 +1659,8 @@ drawTabShadow(int x1, int y1, int w, int h, int r) {
template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawTabShadowClip(int x1, int y1, int w, int h, int r) {
int offset = 3;
drawTabShadowClip(int x1, int y1, int w, int h, int r, int s) {
int offset = s;
int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
// "Harder" shadows when having lower BPP, since we will have artifacts (greenish tint on the modern theme)

View File

@ -64,7 +64,7 @@ public:
void drawSquare(int x, int y, int w, int h) override;
void drawRoundedSquare(int x, int y, int r, int w, int h) override;
void drawTriangle(int x, int y, int base, int height, TriangleOrientation orient) override;
void drawTab(int x, int y, int r, int w, int h) override;
void drawTab(int x, int y, int r, int w, int h, int s) override;
void drawBeveledSquare(int x, int y, int w, int h) override {
bool useClippingVersions = !_clippingArea.contains(Common::Rect(x, y, x + w, y + h));
@ -226,9 +226,9 @@ protected:
PixelType color, VectorRenderer::FillMode fill_m,
int baseLeft = 0, int baseRight = 0);
virtual void drawTabShadow(int x, int y, int w, int h, int r);
virtual void drawTabShadow(int x, int y, int w, int h, int r, int s);
virtual void drawTabShadowClip(int x, int y, int w, int h, int r);
virtual void drawTabShadowClip(int x, int y, int w, int h, int r, int s);
virtual void drawBevelTabAlg(int x, int y, int w, int h,
int bevel, PixelType topColor, PixelType bottomColor,