HaikuDepot: featured tab enable
When the application updates data, the featured tab remains grayed out because it is not being invalidated. This will ensure it is redrawn as the state changes. Also the tab will be enabled as soon as a prominent packaged is seen rather than wait for the end of the bulk load process. Change-Id: I3fbc7d67e19c804b7ac065a8409469773f08f95a Reviewed-on: https://review.haiku-os.org/c/haiku/+/10844 Reviewed-by: waddlesplash <[email protected]> Haiku-Format: Haiku-format Bot <[email protected]>
This commit is contained in:
@@ -837,6 +837,8 @@ MainWindow::_HandlePackagesChanged(const BMessage* message)
|
||||
return;
|
||||
}
|
||||
|
||||
bool isFeaturedTabEnabled = fListTabs->TabAt(TAB_PROMINENT_PACKAGES)->IsEnabled();
|
||||
|
||||
HDTRACE("window processing %" B_PRIi32 " package changes", packageEvents.CountEvents());
|
||||
|
||||
// Transfer the package change events into package *info* change events so
|
||||
@@ -850,6 +852,11 @@ MainWindow::_HandlePackagesChanged(const BMessage* message)
|
||||
const PackageInfoRef packageInfo = fModel.PackageForName(packageEvent.PackageName());
|
||||
|
||||
if (packageInfo.IsSet()) {
|
||||
if (!isFeaturedTabEnabled && !PackageUtils::IsProminent(packageInfo)) {
|
||||
fListTabs->TabAt(TAB_PROMINENT_PACKAGES)->SetEnabled(true);
|
||||
isFeaturedTabEnabled = true;
|
||||
}
|
||||
|
||||
const PackageInfoChangeEvent packageInfoEvent(packageInfo, packageEvent.Changes());
|
||||
packageInfoEvents.push_back(packageInfoEvent);
|
||||
} else {
|
||||
|
||||
@@ -205,7 +205,14 @@ BTab::Deselect()
|
||||
void
|
||||
BTab::SetEnabled(bool enable)
|
||||
{
|
||||
if (fView == NULL)
|
||||
return;
|
||||
|
||||
if (fEnabled == enable)
|
||||
return;
|
||||
|
||||
fEnabled = enable;
|
||||
fTabView->Invalidate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user