[haiku-commits] haiku: hrev49473 - src/kits/interface

  • From: stefano.ceccherini@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 29 Jul 2015 15:23:02 +0200 (CEST)

hrev49473 adds 1 changeset to branch 'master'
old head: 0cd38980a3c14b19926fdf28a808575a688470f4
new head: e716f4877826e8db64c57864a40e7b72ec559bd0
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=e716f4877826+%5E0cd38980a3c1

----------------------------------------------------------------------------

e716f4877826: ChannelSlider: don't check be_control_look for NULL
Also if0 the code that draws the old/dano look so it's more clear that
it's not called intentionally.

[ Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision: hrev49473
Commit: e716f4877826e8db64c57864a40e7b72ec559bd0
URL: http://cgit.haiku-os.org/haiku/commit/?id=e716f4877826
Author: Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx>
Date: Wed Jul 29 13:20:11 2015 UTC

----------------------------------------------------------------------------

1 file changed, 28 insertions(+), 30 deletions(-)
src/kits/interface/ChannelSlider.cpp | 58 +++++++++++++++-----------------

----------------------------------------------------------------------------

diff --git a/src/kits/interface/ChannelSlider.cpp
b/src/kits/interface/ChannelSlider.cpp
index 04d8ae5..46c3f1d 100644
--- a/src/kits/interface/ChannelSlider.cpp
+++ b/src/kits/interface/ChannelSlider.cpp
@@ -563,24 +563,24 @@ BChannelSlider::DrawGroove(BView* into, int32 channel,
BPoint leftTop,
ASSERT(into != NULL);
BRect rect(leftTop, bottomRight);

- if (be_control_look != NULL) {
- rect.InsetBy(-2.5, -2.5);
- rect.left = floorf(rect.left);
- rect.top = floorf(rect.top);
- rect.right = floorf(rect.right);
- rect.bottom = floorf(rect.bottom);
- rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
- rgb_color barColor = be_control_look->SliderBarColor(base);
- uint32 flags = 0;
- be_control_look->DrawSliderBar(into, rect, rect, base,
- barColor, flags, Orientation());
- return;
- }
-
+ rect.InsetBy(-2.5, -2.5);
+ rect.left = floorf(rect.left);
+ rect.top = floorf(rect.top);
+ rect.right = floorf(rect.right);
+ rect.bottom = floorf(rect.bottom);
+ rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
+ rgb_color barColor = be_control_look->SliderBarColor(base);
+ uint32 flags = 0;
+ be_control_look->DrawSliderBar(into, rect, rect, base,
+ barColor, flags, Orientation());
+
+#if 0
+ // Disabled original look
_DrawGrooveFrame(fBackingView, rect.InsetByCopy(-2.5, -2.5));

rect.InsetBy(-0.5, -0.5);
into->FillRect(rect, B_SOLID_HIGH);
+#endif
}


@@ -598,22 +598,19 @@ BChannelSlider::DrawThumb(BView* into, int32 channel,
BPoint where,
where.x -= bitmapBounds.right / 2.0;
where.y -= bitmapBounds.bottom / 2.0;

-
- if (be_control_look != NULL) {
- BRect rect(bitmapBounds.OffsetToCopy(where));
- rect.InsetBy(1, 1);
- rect.left = floorf(rect.left);
- rect.top = floorf(rect.top);
- rect.right = ceilf(rect.right + 0.5);
- rect.bottom = ceilf(rect.bottom + 0.5);
- rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
- uint32 flags = 0;
- be_control_look->DrawSliderThumb(into, rect, rect, base,
- flags, Orientation());
- return;
- }
-
-
+ BRect rect(bitmapBounds.OffsetToCopy(where));
+ rect.InsetBy(1, 1);
+ rect.left = floorf(rect.left);
+ rect.top = floorf(rect.top);
+ rect.right = ceilf(rect.right + 0.5);
+ rect.bottom = ceilf(rect.bottom + 0.5);
+ rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
+ uint32 flags = 0;
+ be_control_look->DrawSliderThumb(into, rect, rect, base,
+ flags, Orientation());
+
+#if 0
+ // Disabled original look which takes into account the pressed state
into->PushState();

into->SetDrawingMode(B_OP_OVER);
@@ -634,6 +631,7 @@ BChannelSlider::DrawThumb(BView* into, int32 channel,
BPoint where,
}

into->PopState();
+#endif
}




Other related posts: