Consolidate detail view from 4 tabs to 2 (About + Details)

Merge Overview into About tab, combine System + Security + Storage
into a single Details tab. Map old GSettings tab names to new ones
for backward compatibility.
This commit is contained in:
lashman
2026-02-28 01:42:35 +02:00
parent 80a81191ab
commit e311f6b230
2 changed files with 27 additions and 23 deletions

View File

@@ -57,14 +57,12 @@
</key>
<key name="detail-tab" type="s">
<choices>
<choice value='overview'/>
<choice value='system'/>
<choice value='security'/>
<choice value='storage'/>
<choice value='about'/>
<choice value='details'/>
</choices>
<default>'overview'</default>
<default>'about'</default>
<summary>Last detail view tab</summary>
<description>The last selected tab in the detail view (overview, system, security, storage).</description>
<description>The last selected tab in the detail view (about or details).</description>
</key>
<key name="auto-check-updates" type="b">
<default>false</default>

View File

@@ -32,29 +32,35 @@ pub fn build_detail_page(record: &AppImageRecord, db: &Rc<Database>) -> adw::Nav
view_stack.set_vhomogeneous(false);
view_stack.set_enable_transitions(false);
// Build tab pages
let overview_page = build_overview_tab(record, db);
view_stack.add_titled(&overview_page, Some("overview"), "Overview");
view_stack.page(&overview_page).set_icon_name(Some("info-symbolic"));
// Build tab pages (2-tab layout: About + Details)
let about_page = build_overview_tab(record, db);
view_stack.add_titled(&about_page, Some("about"), "About");
view_stack.page(&about_page).set_icon_name(Some("info-symbolic"));
let system_page = build_system_tab(record, db, &toast_overlay);
view_stack.add_titled(&system_page, Some("system"), "System");
view_stack.page(&system_page).set_icon_name(Some("system-run-symbolic"));
// Details tab combines System + Security + Storage
let system_content = build_system_tab(record, db, &toast_overlay);
let security_content = build_security_tab(record, db);
let storage_content = build_storage_tab(record, db, &toast_overlay);
let security_page = build_security_tab(record, db);
view_stack.add_titled(&security_page, Some("security"), "Security");
view_stack.page(&security_page).set_icon_name(Some("security-medium-symbolic"));
let details_page = gtk::Box::builder()
.orientation(gtk::Orientation::Vertical)
.build();
details_page.append(&system_content);
details_page.append(&security_content);
details_page.append(&storage_content);
let storage_page = build_storage_tab(record, db, &toast_overlay);
view_stack.add_titled(&storage_page, Some("storage"), "Storage");
view_stack.page(&storage_page).set_icon_name(Some("drive-harddisk-symbolic"));
view_stack.add_titled(&details_page, Some("details"), "Details");
view_stack.page(&details_page).set_icon_name(Some("applications-system-symbolic"));
// Restore last-used tab from GSettings
// Restore last-used tab from GSettings (map old tab names to new ones)
let settings = gio::Settings::new(crate::config::APP_ID);
let saved_tab = settings.string("detail-tab");
if view_stack.child_by_name(&saved_tab).is_some() {
view_stack.set_visible_child_name(&saved_tab);
}
let mapped_tab = match saved_tab.as_str() {
"overview" | "about" => "about",
"system" | "security" | "storage" | "details" => "details",
_ => "about",
};
view_stack.set_visible_child_name(mapped_tab);
// Persist tab choice on switch
view_stack.connect_visible_child_name_notify(move |stack| {