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:
Andrew Lindesay
2026-04-24 23:12:43 +00:00
parent 6aa675a630
commit 0a2766d6b0
2 changed files with 14 additions and 0 deletions
+7
View File
@@ -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 {
+7
View File
@@ -205,7 +205,14 @@ BTab::Deselect()
void
BTab::SetEnabled(bool enable)
{
if (fView == NULL)
return;
if (fEnabled == enable)
return;
fEnabled = enable;
fTabView->Invalidate();
}