Simplication in Tracker Find Panel
If attribute mode and you select a mime type, Remove then add the rows first with the first items marked, then go through and re-mark the selected item.
This commit is contained in:
@@ -1132,6 +1132,7 @@ FindPanel::MessageReceived(BMessage* message)
|
|||||||
if (fMode == kByAttributeItem) {
|
if (fMode == kByAttributeItem) {
|
||||||
// the attributes for this type may be different
|
// the attributes for this type may be different
|
||||||
RemoveAttrViewItems(false);
|
RemoveAttrViewItems(false);
|
||||||
|
AddAttrRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
BMenuItem* item;
|
BMenuItem* item;
|
||||||
@@ -1143,9 +1144,6 @@ FindPanel::MessageReceived(BMessage* message)
|
|||||||
SetCurrentMimeType(item);
|
SetCurrentMimeType(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fMode == kByAttributeItem)
|
|
||||||
AddAttrRow();
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1672,7 +1670,7 @@ FindPanel::SetCurrentMimeType(BMenuItem* item)
|
|||||||
|
|
||||||
for (int32 j = submenu->CountItems(); j-- > 0;) {
|
for (int32 j = submenu->CountItems(); j-- > 0;) {
|
||||||
BMenuItem* sub = submenu->ItemAt(j);
|
BMenuItem* sub = submenu->ItemAt(j);
|
||||||
if (strcmp(item->Label(),sub->Label()) == 0) {
|
if (strcmp(item->Label(), sub->Label()) == 0) {
|
||||||
sub->SetMarked(true);
|
sub->SetMarked(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2509,11 +2507,9 @@ FindPanel::AddAttributeControls(int32 gridRow)
|
|||||||
B_TRANSLATE_NOCOLLECT(operatorLabels[i]), message));
|
B_TRANSLATE_NOCOLLECT(operatorLabels[i]), message));
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark first items if not marked
|
// mark first items initially
|
||||||
if (menu->FindMarked() == NULL)
|
menu->ItemAt(0)->SetMarked(true);
|
||||||
menu->ItemAt(0)->SetMarked(true);
|
submenu->ItemAt(0)->SetMarked(true);
|
||||||
if (submenu->FindMarked() == NULL)
|
|
||||||
submenu->ItemAt(0)->SetMarked(true);
|
|
||||||
|
|
||||||
// add SIZE attribute
|
// add SIZE attribute
|
||||||
submenu = new BMenu(B_TRANSLATE("Size"));
|
submenu = new BMenu(B_TRANSLATE("Size"));
|
||||||
|
|||||||
Reference in New Issue
Block a user