Skip to content

Commit ee74c1b

Browse files
committed
Fix Dragger BackgroundColor
1 parent 11cc5df commit ee74c1b

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

DeskNoteView.cpp

+16-8
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ DeskNoteView::DeskNoteView(BRect rect)
2424
{
2525
BRect draggerRect = rect;
2626
BRect textViewRect = rect;
27-
BPopUpMenu *daggerPop;
27+
BPopUpMenu *draggerPop;
2828
BMenuItem *popupMenu;
2929
BMessage *popupMessage;
3030
ourSize = rect;
@@ -35,16 +35,16 @@ DeskNoteView::DeskNoteView(BRect rect)
3535
draggerRect.top = draggerRect.bottom - 7;
3636
draggerRect.right = draggerRect.left + 7;
3737

38-
BDragger *dw = new BDragger(draggerRect, this, B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
39-
AddChild(dw);
40-
daggerPop = dw -> PopUp();
38+
dragger = new BDragger(draggerRect, this, B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
39+
40+
draggerPop = dragger -> PopUp();
4141
popupMessage = new BMessage (DN_LAUNCH);
4242
popupMenu = new BMenuItem ("Launch DeskNotes", popupMessage);
43-
daggerPop -> AddItem (popupMenu, 1); // Add the launch menu item.
43+
draggerPop -> AddItem (popupMenu, 1); // Add the launch menu item.
4444

4545
popupMessage = new BMessage (DN_FNT_CLR);
4646
popupMenu = new BMenuItem ("Properties", popupMessage);
47-
daggerPop -> AddItem (popupMenu, 1); // Add the change font/colour menu item.
47+
draggerPop -> AddItem (popupMenu, 1); // Add the change font/colour menu item.
4848

4949

5050
textViewRect.bottom -= 8; // Don't collide with the widgets.
@@ -53,9 +53,11 @@ DeskNoteView::DeskNoteView(BRect rect)
5353
textViewRect, B_FOLLOW_ALL, B_WILL_DRAW | B_PULSE_NEEDED);
5454
textView -> SetText (defaultText, strlen (defaultText));
5555
AddChild (textView);
56-
SetViewColor (B_TRANSPARENT_COLOR);
56+
5757
background = kDefaultBackgroundColor;
5858
foreground = kDefaultForegroundColor;
59+
SetViewColor (background);
60+
AddChild(dragger);
5961
CascadeFontAndColour();
6062
propertiesWindow = NULL;
6163
}
@@ -68,7 +70,9 @@ DeskNoteView::DeskNoteView (BMessage *data) : BView (data)
6870

6971
propertiesWindow = NULL;
7072
WeAreAReplicant = true;
71-
textView = (DeskNoteTextView *)FindView ("TextView");
73+
textView = dynamic_cast<DeskNoteTextView *> (FindView ("TextView"));
74+
dragger = dynamic_cast<BDragger *> (FindView ("_dragger_"));
75+
7276
data -> FindData ("background_colour", B_RGB_COLOR_TYPE, (const void **)&bckgrnd, &size);
7377
data -> FindData ("foreground_colour", B_RGB_COLOR_TYPE, (const void **)&fregrnd, &size);
7478

@@ -279,6 +283,10 @@ void DeskNoteView::CascadeFontAndColour (void)
279283
textView -> SetViewColor (background);
280284
this -> Invalidate();
281285
textView -> Invalidate();
286+
SetViewColor(background);
287+
if (dragger != NULL)
288+
dragger -> Invalidate();
289+
282290
}
283291

284292

DeskNoteView.h

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class DeskNoteView : public BView
5757
BMessage *orginalSettings;
5858
BPopUpMenu *popupMenu;
5959
rgb_color background, foreground, widgetcolour;
60+
BDragger *dragger;
6061
};
6162

6263
#endif

0 commit comments

Comments
 (0)