Fix crashes and mismatched tabs in TabView.
* Default BTab uses view's name property as tab label, so SetLabel changes that value. However, view names are important for yab and this would cause inconsistencies in view lists yab stores for referencing them by name. Views attached to tabs would not be removed because there is no name "Tab1" in the index (there is "Test1", which is the view's original name). Later, when asking for view with the same name created later yab could get wrong view (if lucky) or crash (if unlucky). This commit fixes that by storing original name in YabView property, and using that for removing views from the hierarchy. * Fixes #5.
This commit is contained in:
@@ -48,6 +48,11 @@ YabView::YabView(BRect frame, const char *name, uint32 resizingMode, uint32 flag
|
||||
dropZone = false;
|
||||
pressedKeys.SetTo("");
|
||||
SetDrawingMode(B_OP_COPY);
|
||||
|
||||
// BTab uses view Name() as displayed label storage, so SetLabel changes it
|
||||
// this interferes with yab method of referencing views by name
|
||||
// to be removed
|
||||
nameWAForTabView = name;
|
||||
}
|
||||
|
||||
YabView::~YabView()
|
||||
|
||||
Reference in New Issue
Block a user