1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//! # Custom Dialog Module
//!
//! This module provides helper functions for displaying user interface dialogs
//! using `libadwaita` and `GTK4`.
//!
//! The focus is on providing flexible `AlertDialog` wrappers that
//! can accommodate custom content (`GtkBox`).
/**
* dialog_custom.rs
*
* (C) Copyright 2026 AtlantisOS Project
* by @NachtsternBuild
*
* License: GNU GENERAL PUBLIC LICENSE Version 3
*/
use *;
use ;
use ;
/// Displays an `AlertDialog` with a custom content area.
///
/// This function abstracts the boilerplate setup for a libadwaita dialog.
/// The caller is responsible for preparing the `GtkBox` with the desired widgets
/// (e.g., images, labels, or progress bars).
///
/// # Arguments
///
/// * `parent` - The parent widget (usually the main window) to which the dialog is docked.
/// * `title` - The bolded title of the dialog.
/// * `body` - A short descriptive text below the title.
/// * `button_label` - The text for the primary confirmation button.
/// * `content` - A reference to a `GtkBox` that is displayed as additional content (`extra_child`).
///
/// # Example
///
/// ```rust
/// use gtk::prelude::*;
/// use gtk::{Box as GtkBox, Orientation, Label};
///
/// // Preparing the content
/// let content_box = GtkBox::builder()
/// .orientation(Orientation::Vertical)
/// .spacing(10)
/// .build();
///
/// content_box.append(&Label::new(Some("Do you want to continue?")));
///
/// // Display the dialog
/// show_custom_content_dialog(
/// &window,
/// "System Update",
/// "A new update is available.",
/// "Install",
/// &content_box
/// );
/// ```