Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

egui egui::TextEdit::singleline long text will make ui.horizontal invalid #5597

Open
januwA opened this issue Jan 11, 2025 · 1 comment
Open
Labels
bug Something is broken

Comments

@januwA
Copy link

januwA commented Jan 11, 2025

Describe the bug
GIF 2025-1-11 13-14-10

To Reproduce
Steps to reproduce the behavior:

Expected behavior
The width of singleline has not changed. Horizontal should use the width of singleline instead of the length of the text.

Screenshots

Desktop (please complete the following information):

  • OS: win11
  • Browser
  • Version

Smartphone (please complete the following information):

  • Device:
  • OS:
  • Browser
  • Version

Additional context

 cargo --version
cargo 1.84.0 (66221abde 2024-11-19)
[dependencies]
eframe = { version = "0.30.0", default-features = false, features = ["accesskit", "glow", "persistence"]}
egui_extras = { version = "0.30", features = ["image"] }
ui.horizontal(|ui| {
                    egui::TextEdit::singleline(&mut httpConfig.name)
                        .desired_width(100.0)
                        .show(ui);
                    
                    egui::ComboBox::from_id_source("method")
                        .selected_text(httpConfig.req_cfg.method.as_ref())
                        .show_ui(ui, |ui| {
                            for m in &METHODS {
                                ui.selectable_value(
                                    &mut httpConfig.req_cfg.method,
                                    m.to_owned(),
                                    m.as_ref(),
                                );
                            }
                        });

                    ui.add(
                        egui::TextEdit::singleline(&mut httpConfig.req_cfg.url)
                            .desired_width(300.)
                            .hint_text("http url"),
                    );

                    ui.add(
                        egui::TextEdit::singleline(&mut httpConfig.send_count_ui)
                            .desired_width(60.)
                            .hint_text("Count"),
                    );

                    if ui
                        .add_enabled(!httpConfig.req_cfg.url.is_empty(), egui::Button::new("Send"))
                        .clicked()
                    {
                    }

                    ui.separator();

                    // request result count
                    let (s, e, r) = httpConfig.get_request_reper();
                    ui.label(format!("s:{s}, e:{e}, r:{r}"));

                    ui.separator();
                });
@januwA januwA added the bug Something is broken label Jan 11, 2025
@MetaflameDragon
Copy link

Looks like a duplicate of #5500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants