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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//! Utility tools for quickly creating input fields.
//!
//! This module provides functions for grouping text and password inputs directly with
//! a labeled `Label` in a horizontal container.
/**
* create_entry.rs
*
* (C) Copyright 2026 AtlantisOS Project
* by @NachtsternBuild
*
* License: GNU GENERAL PUBLIC LICENSE Version 3
*/
use *;
use ;
/// Creates a text input field with a preceding label.
///
/// This function combines a `Label` and an `Entry` in a horizontal `GtkBox`.
/// The input field is configured to fill the available horizontal space.
///
/// # Return Value
/// Returns a tuple:
/// 1. `GtkBox`: The container that is inserted into the UI layout (e.g., a `VBox`).
/// 2. `Entry`: The actual input widget for connecting signals or retrieving text.
///
/// # Arguments
/// * `label_text` - The text displayed to the left of the field.
/// * `placeholder` - An optional placeholder text within the field.
///
/// # Usage:
///
/// ```rust
/// Usage:
/// // normal entry
/// let (username_row, username_entry) = create_entry(
/// "Username:",
/// Some("Enter your username: ")
/// );
/// vbox.append(&username_row);
/// let input = username_entry.text();
/// println!("Input: {}", input);
/// ```
/// Creates a password-protected input field with a label.
///
/// This function internally uses [create_entry], but configures the `Entry`
/// so that the input remains hidden (default character: `*`).
///
/// # Arguments
/// * `label_text` - The text for the label (e.g., "Password:").
/// * `placeholder` - Optional placeholder text (e.g., "••••••••").
///
/// ### Usage:
///
/// ```rust
/// Usage:
/// // password entry
/// let (password_row, password_entry) = create_password_entry(
/// "Password:",
/// Some("Enter your password:")
/// );
/// vbox.append(&password_row);
/// let input = username_entry.text();
/// println!("Input: {}", input);
/// ```