@@ -24,7 +24,7 @@ DeskNoteView::DeskNoteView(BRect rect)
24
24
{
25
25
BRect draggerRect = rect;
26
26
BRect textViewRect = rect;
27
- BPopUpMenu *daggerPop ;
27
+ BPopUpMenu *draggerPop ;
28
28
BMenuItem *popupMenu;
29
29
BMessage *popupMessage;
30
30
ourSize = rect;
@@ -35,16 +35,16 @@ DeskNoteView::DeskNoteView(BRect rect)
35
35
draggerRect.top = draggerRect.bottom - 7 ;
36
36
draggerRect.right = draggerRect.left + 7 ;
37
37
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 ();
41
41
popupMessage = new BMessage (DN_LAUNCH);
42
42
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.
44
44
45
45
popupMessage = new BMessage (DN_FNT_CLR);
46
46
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.
48
48
49
49
50
50
textViewRect.bottom -= 8 ; // Don't collide with the widgets.
@@ -53,9 +53,11 @@ DeskNoteView::DeskNoteView(BRect rect)
53
53
textViewRect, B_FOLLOW_ALL, B_WILL_DRAW | B_PULSE_NEEDED);
54
54
textView -> SetText (defaultText, strlen (defaultText));
55
55
AddChild (textView);
56
- SetViewColor (B_TRANSPARENT_COLOR);
56
+
57
57
background = kDefaultBackgroundColor ;
58
58
foreground = kDefaultForegroundColor ;
59
+ SetViewColor (background);
60
+ AddChild (dragger);
59
61
CascadeFontAndColour ();
60
62
propertiesWindow = NULL ;
61
63
}
@@ -68,7 +70,9 @@ DeskNoteView::DeskNoteView (BMessage *data) : BView (data)
68
70
69
71
propertiesWindow = NULL ;
70
72
WeAreAReplicant = true ;
71
- textView = (DeskNoteTextView *)FindView (" TextView" );
73
+ textView = dynamic_cast <DeskNoteTextView *> (FindView (" TextView" ));
74
+ dragger = dynamic_cast <BDragger *> (FindView (" _dragger_" ));
75
+
72
76
data -> FindData (" background_colour" , B_RGB_COLOR_TYPE, (const void **)&bckgrnd, &size);
73
77
data -> FindData (" foreground_colour" , B_RGB_COLOR_TYPE, (const void **)&fregrnd, &size);
74
78
@@ -279,6 +283,10 @@ void DeskNoteView::CascadeFontAndColour (void)
279
283
textView -> SetViewColor (background);
280
284
this -> Invalidate ();
281
285
textView -> Invalidate ();
286
+ SetViewColor (background);
287
+ if (dragger != NULL )
288
+ dragger -> Invalidate ();
289
+
282
290
}
283
291
284
292
0 commit comments