Skip to content

Commit

Permalink
ui: Only shows port number if protocol allows changing it
Browse files Browse the repository at this point in the history
  • Loading branch information
joaofl committed Dec 30, 2024
1 parent 81d3500 commit fd6ad70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ui/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ impl eframe::App for UI {
ui.group(|ui| {
ui.add(Label::new(format!("{}", p.protocol.to_string())));

if p.protocol != Protocol::Dhcp {

// Some protocols do not allow changing ports (and may be set to 0)
// so we only show the port field if it is not 0
if p.port != 0 {
ui.add(DragValue::new(&mut p.port).range(1..=50000));
}

Expand Down

0 comments on commit fd6ad70

Please sign in to comment.