# HG changeset patch # User sbr # Date 1375532564 -7200 # Sat Aug 03 14:22:44 2013 +0200 # Node ID 0d610b876a4c36415c0cec32abfcf199982707a3 # Parent c084b548bf88aed8721dae1ebe3263fa8008ff70 -Add: RTL relief support for Framerects. Relief is suggested by "illuminating" the top left corner of a framerect: the left and top border are lightened and the right and bottom borders are darkened. However in RTL mode, it's the top right corner that should be illuminated to render a proper impression of relief. DrawFrameRect now tests the text direction before lightening / darkening the borders. diff --git a/src/widget.cpp b/src/widget.cpp --- a/src/widget.cpp +++ b/src/widget.cpp @@ -186,17 +186,18 @@ void DrawFrameRect(int left, int top, in GfxFillRect(left, top, right, bottom, PALETTE_TO_TRANSPARENT, FILLRECT_RECOLOUR); } else { uint interior; + bool rtl = _current_text_dir == TD_RTL; if (flags & FR_LOWERED) { - GfxFillRect(left, top, left, bottom, dark); + GfxFillRect(left, top, left, bottom, rtl ? light : dark); GfxFillRect(left + WD_BEVEL_LEFT, top, right, top, dark); - GfxFillRect(right, top + WD_BEVEL_TOP, right, bottom - WD_BEVEL_BOTTOM, light); + GfxFillRect(right, top + WD_BEVEL_TOP, right, bottom - WD_BEVEL_BOTTOM, rtl ? dark : light); GfxFillRect(left + WD_BEVEL_LEFT, bottom, right, bottom, light); interior = (flags & FR_DARKENED ? medium_dark : medium_light); } else { - GfxFillRect(left, top, left, bottom - WD_BEVEL_BOTTOM, light); + GfxFillRect(left, top, left, bottom - WD_BEVEL_BOTTOM, rtl ? dark : light); GfxFillRect(left + WD_BEVEL_LEFT, top, right - WD_BEVEL_RIGHT, top, light); - GfxFillRect(right, top, right, bottom - WD_BEVEL_BOTTOM, dark); + GfxFillRect(right, top, right, bottom - WD_BEVEL_BOTTOM, rtl ? light : dark); GfxFillRect(left, bottom, right, bottom, dark); interior = medium_dark; }