From 4a6c7d6ffc448d9febe67efce30f8278f3dea1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 1 Mar 2004 12:57:15 +0000 Subject: [PATCH] R5 obviously doesn't have B_SHINE_COLOR, B_SHADOW_COLOR, and B_HIGHLIGHTED_CONTROL_COLOR. Set the shell variable COMPILE_FOR_R5 to 1 when compiling DiskProbe for R5; it will use default values for the colors in this case. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6843 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/diskprobe/Jamfile | 12 ++++++++++++ src/apps/diskprobe/ProbeView.cpp | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/apps/diskprobe/Jamfile b/src/apps/diskprobe/Jamfile index fe993b4b22..a3bcd3cf21 100644 --- a/src/apps/diskprobe/Jamfile +++ b/src/apps/diskprobe/Jamfile @@ -4,6 +4,18 @@ UsePrivateHeaders shared ; AddResources DiskProbe : DiskProbe.rdef ; +# set some additional defines for R5 compatibility +{ + local defines = ; + + if $(COMPILE_FOR_R5) { + defines += COMPILE_FOR_R5 ; + } + + defines = [ FDefines $(defines) ] ; + SubDirC++Flags $(defines) -Wall -Wno-multichar ; +} + App DiskProbe : DiskProbe.cpp DataEditor.cpp diff --git a/src/apps/diskprobe/ProbeView.cpp b/src/apps/diskprobe/ProbeView.cpp index 5b3e117736..40fc022f01 100644 --- a/src/apps/diskprobe/ProbeView.cpp +++ b/src/apps/diskprobe/ProbeView.cpp @@ -301,8 +301,15 @@ PositionSlider::DrawBar() frame.top++; frame.left++; frame.right = ThumbFrame().left + ThumbFrame().Width() / 2; +#ifdef COMPILE_FOR_R5 + if (IsEnabled()) + view->SetHighColor(102, 152, 203); + else + view->SetHighColor(92, 102, 160); +#else view->SetHighColor(IsEnabled() ? ui_color(B_CONTROL_HIGHLIGHT_COLOR) : tint_color(ui_color(B_CONTROL_HIGHLIGHT_COLOR), B_DARKEN_1_TINT)); +#endif view->FillRect(frame); frame.left = frame.right + 1; @@ -312,8 +319,13 @@ PositionSlider::DrawBar() rgb_color cornerColor = tint_color(ViewColor(), B_DARKEN_1_TINT); rgb_color darkColor = tint_color(ViewColor(), B_DARKEN_3_TINT); +#ifdef COMPILE_FOR_R5 + rgb_color shineColor = {255, 255, 255}; + rgb_color shadowColor = {0, 0, 0}; +#else rgb_color shineColor = ui_color(B_SHINE_COLOR); rgb_color shadowColor = ui_color(B_SHADOW_COLOR); +#endif if (!IsEnabled()) { darkColor = tint_color(ViewColor(), B_DARKEN_1_TINT); shineColor = tint_color(shineColor, B_DARKEN_2_TINT); @@ -577,7 +589,11 @@ HeaderView::Draw(BRect updateRect) { BRect rect = Bounds(); +#ifdef COMPILE_FOR_R5 + SetHighColor(255, 255, 255); +#else SetHighColor(ui_color(B_SHINE_COLOR)); +#endif StrokeLine(rect.LeftTop(), rect.LeftBottom()); StrokeLine(rect.LeftTop(), rect.RightTop());