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:
@@ -57,14 +57,12 @@
|
|||||||
</key>
|
</key>
|
||||||
<key name="detail-tab" type="s">
|
<key name="detail-tab" type="s">
|
||||||
<choices>
|
<choices>
|
||||||
<choice value='overview'/>
|
<choice value='about'/>
|
||||||
<choice value='system'/>
|
<choice value='details'/>
|
||||||
<choice value='security'/>
|
|
||||||
<choice value='storage'/>
|
|
||||||
</choices>
|
</choices>
|
||||||
<default>'overview'</default>
|
<default>'about'</default>
|
||||||
<summary>Last detail view tab</summary>
|
<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>
|
||||||
<key name="auto-check-updates" type="b">
|
<key name="auto-check-updates" type="b">
|
||||||
<default>false</default>
|
<default>false</default>
|
||||||
|
|||||||
@@ -32,29 +32,35 @@ pub fn build_detail_page(record: &AppImageRecord, db: &Rc<Database>) -> adw::Nav
|
|||||||
view_stack.set_vhomogeneous(false);
|
view_stack.set_vhomogeneous(false);
|
||||||
view_stack.set_enable_transitions(false);
|
view_stack.set_enable_transitions(false);
|
||||||
|
|
||||||
// Build tab pages
|
// Build tab pages (2-tab layout: About + Details)
|
||||||
let overview_page = build_overview_tab(record, db);
|
let about_page = build_overview_tab(record, db);
|
||||||
view_stack.add_titled(&overview_page, Some("overview"), "Overview");
|
view_stack.add_titled(&about_page, Some("about"), "About");
|
||||||
view_stack.page(&overview_page).set_icon_name(Some("info-symbolic"));
|
view_stack.page(&about_page).set_icon_name(Some("info-symbolic"));
|
||||||
|
|
||||||
let system_page = build_system_tab(record, db, &toast_overlay);
|
// Details tab combines System + Security + Storage
|
||||||
view_stack.add_titled(&system_page, Some("system"), "System");
|
let system_content = build_system_tab(record, db, &toast_overlay);
|
||||||
view_stack.page(&system_page).set_icon_name(Some("system-run-symbolic"));
|
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);
|
let details_page = gtk::Box::builder()
|
||||||
view_stack.add_titled(&security_page, Some("security"), "Security");
|
.orientation(gtk::Orientation::Vertical)
|
||||||
view_stack.page(&security_page).set_icon_name(Some("security-medium-symbolic"));
|
.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(&details_page, Some("details"), "Details");
|
||||||
view_stack.add_titled(&storage_page, Some("storage"), "Storage");
|
view_stack.page(&details_page).set_icon_name(Some("applications-system-symbolic"));
|
||||||
view_stack.page(&storage_page).set_icon_name(Some("drive-harddisk-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 settings = gio::Settings::new(crate::config::APP_ID);
|
||||||
let saved_tab = settings.string("detail-tab");
|
let saved_tab = settings.string("detail-tab");
|
||||||
if view_stack.child_by_name(&saved_tab).is_some() {
|
let mapped_tab = match saved_tab.as_str() {
|
||||||
view_stack.set_visible_child_name(&saved_tab);
|
"overview" | "about" => "about",
|
||||||
}
|
"system" | "security" | "storage" | "details" => "details",
|
||||||
|
_ => "about",
|
||||||
|
};
|
||||||
|
view_stack.set_visible_child_name(mapped_tab);
|
||||||
|
|
||||||
// Persist tab choice on switch
|
// Persist tab choice on switch
|
||||||
view_stack.connect_visible_child_name_notify(move |stack| {
|
view_stack.connect_visible_child_name_notify(move |stack| {
|
||||||
|
|||||||
Reference in New Issue
Block a user