From dbbf8119939d69c76a2a8b063c7e335d3cd7805a Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sat, 28 Jan 2017 23:20:38 +0100 Subject: [PATCH] Better monochrome support in scrollview example --- src/fscrollview.cpp | 6 ++++++ test/scrollview.cpp | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index 7d66f244..6c0094ed 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -327,6 +327,9 @@ void FScrollView::draw() { use_own_print_area = true; + if ( isMonochron() ) + setReverse(true); + if ( FWidget* p = getParentWidget() ) setColor (p->getForegroundColor(), p->getBackgroundColor()); else @@ -337,6 +340,9 @@ void FScrollView::draw() else drawBorder(); + if ( isMonochron() ) + setReverse(false); + use_own_print_area = false; copy2area(); redrawVBar(); diff --git a/test/scrollview.cpp b/test/scrollview.cpp index c85ceca9..f221916d 100644 --- a/test/scrollview.cpp +++ b/test/scrollview.cpp @@ -107,7 +107,10 @@ void scrollview::setScrollSize (int width, int height) //---------------------------------------------------------------------- void scrollview::draw() { - setColor (wc.dialog_fg, wc.dialog_bg); + if ( isMonochron() ) + setReverse(true); + + setColor (wc.label_inactive_fg, wc.dialog_bg); clearArea(); for (int y=0; y < getScrollHeight(); y++) @@ -118,6 +121,9 @@ void scrollview::draw() print (32 + ((x + y) % 0x5f)); } + if ( isMonochron() ) + setReverse(false); + FScrollView::draw(); }