No uses B_OP_OVER when drawing the arrows - this fixes the broken look

due to anti-aliasing. Have I mentioned that the arrows are very ugly
anyway right now, and don't match the rest of the look? :-)
Fixed a crashing bug in the "pressed button repeater" - it didn't lock
the looper when scrolling the view.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13191 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-06-16 21:30:34 +00:00
parent 5fcce1f54b
commit dec3c805d9
+10 -4
View File
@@ -1,5 +1,5 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Copyright (c) 2001-2002 OpenBeOS // Copyright (c) 2001-2005 Haiku
// //
// Permission is hereby granted, free of charge, to any person obtaining a // Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"), // copy of this software and associated documentation files (the "Software"),
@@ -151,15 +151,17 @@ BScrollBar::Private::ButtonRepeaterThread(void *data)
while (!exitval) { while (!exitval) {
oldframe = scrollBar->fPrivateData->fThumbFrame; oldframe = scrollBar->fPrivateData->fThumbFrame;
scrollBar->Window()->Lock();
returnval = scroll_by_value(scrollvalue, scrollBar); returnval = scroll_by_value(scrollvalue, scrollBar);
scrollBar->Window()->Unlock();
snooze(50000); snooze(50000);
scrollBar->Window()->Lock(); scrollBar->Window()->Lock();
exitval=scrollBar->fPrivateData->fExitRepeater; exitval = scrollBar->fPrivateData->fExitRepeater;
if (returnval == B_OK) { if (returnval == B_OK) {
scrollBar->CopyBits(oldframe,scrollBar->fPrivateData->fThumbFrame); scrollBar->CopyBits(oldframe, scrollBar->fPrivateData->fThumbFrame);
// TODO: Redraw the old area here // TODO: Redraw the old area here
@@ -805,6 +807,8 @@ BScrollBar::Draw(BRect updateRect)
SetHighColor(dark); SetHighColor(dark);
StrokeRect(Bounds()); StrokeRect(Bounds());
SetDrawingMode(B_OP_OVER);
// Draw arrows // Draw arrows
BPoint buttonpt(0,0); BPoint buttonpt(0,0);
if (fOrientation == B_HORIZONTAL) { if (fOrientation == B_HORIZONTAL) {
@@ -845,6 +849,8 @@ BScrollBar::Draw(BRect updateRect)
fPrivateData->fButtonDown == ARROW4); fPrivateData->fButtonDown == ARROW4);
} }
SetDrawingMode(B_OP_COPY);
// Draw scroll thumb // Draw scroll thumb
if (fPrivateData->fEnabled) { if (fPrivateData->fEnabled) {
@@ -1053,7 +1059,7 @@ control_scrollbar(scroll_bar_info *info, BScrollBar *bar)
if (bar->fPrivateData->fScrollBarInfo.double_arrows != info->double_arrows) { if (bar->fPrivateData->fScrollBarInfo.double_arrows != info->double_arrows) {
bar->fPrivateData->fScrollBarInfo.double_arrows = info->double_arrows; bar->fPrivateData->fScrollBarInfo.double_arrows = info->double_arrows;
int8 multiplier=(info->double_arrows) ? 1 : -1; int8 multiplier = (info->double_arrows) ? 1 : -1;
if (bar->fOrientation == B_VERTICAL) if (bar->fOrientation == B_VERTICAL)
bar->fPrivateData->fThumbFrame.OffsetBy(0, multiplier * B_H_SCROLL_BAR_HEIGHT); bar->fPrivateData->fThumbFrame.OffsetBy(0, multiplier * B_H_SCROLL_BAR_HEIGHT);