From 967f24a83b0a66643329ddd79808c3fb0580a41e Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 3 Oct 2015 05:07:38 -0400 Subject: [PATCH] Fix dialog frames not using the inset style The framestyle format parameter now does nothing. This is temporary. --- src/dialogxml/control.cpp | 10 +++++----- src/pcedit/pc.graphics.cpp | 18 +++++++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/dialogxml/control.cpp b/src/dialogxml/control.cpp index be36797e..2b3dcef8 100644 --- a/src/dialogxml/control.cpp +++ b/src/dialogxml/control.cpp @@ -276,19 +276,19 @@ bool cControl::triggerFocusHandler(cDialog&, std::string, bool){ return true; } -void cControl::drawFrame(short amt, bool med_or_lt){ +void cControl::drawFrame(short amt, bool){ // dk_gray had a 0..65535 component of 12287, and med_gray had a 0..65535 component of 24574 - static sf::Color lt_gray = {224,224,224},dk_gray = {48,48,48},med_gray = {96,96,96}; + static sf::Color lt_gray = {224,224,224},dk_gray = {48,48,48}; rectangle rect = frame, ul_rect; inWindow->setActive(); rect.inset(-amt,-amt); ul_rect = rect; - ul_rect.left -= 1; - ul_rect.top -= 1; + ul_rect.right -= 1; + ul_rect.bottom -= 1; - frame_rect(*inWindow, rect, med_or_lt ? med_gray : lt_gray); + frame_rect(*inWindow, rect, lt_gray); clip_rect(*inWindow, ul_rect); frame_rect(*inWindow, rect, dk_gray); undo_clip(*inWindow); diff --git a/src/pcedit/pc.graphics.cpp b/src/pcedit/pc.graphics.cpp index 95aad096..19aa28cf 100644 --- a/src/pcedit/pc.graphics.cpp +++ b/src/pcedit/pc.graphics.cpp @@ -218,11 +218,19 @@ void redraw_screen() { } static void frame_dlog_rect(sf::RenderWindow& target, rectangle rect) { - cTextMsg text(target); - text.setFormat(TXT_FRAME, true); - text.setFormat(TXT_FRAMESTYLE, 1); - text.setBounds(rect); - text.draw(); + // dk_gray had a 0..65535 component of 12287, and med_gray had a 0..65535 component of 24574 + static sf::Color dk_gray = {48,48,48},med_gray = {96,96,96}; + rectangle ul_rect = rect; + + rect.inset(-2,-2); + ul_rect = rect; + ul_rect.right -= 1; + ul_rect.bottom -= 1; + + frame_rect(target, rect, med_gray); + clip_rect(target, ul_rect); + frame_rect(target, rect, dk_gray); + undo_clip(target); } void draw_main_screen() {