Skip to content

Commit

Permalink
improved ux
Browse files Browse the repository at this point in the history
  • Loading branch information
marci1175 committed Dec 26, 2023
1 parent 7219191 commit bb932b7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,13 @@ impl eframe::App for backend::TemplateApp {

ui.allocate_ui(vec2(ui.available_width(), 25.), |ui| {
ui.with_layout(Layout::left_to_right(Align::Center), |ui| {
//Make connecting to an ip more user friendly
ui.add(egui::TextEdit::singleline(&mut self.send_on_address).hint_text("Address"));
ui.add(egui::TextEdit::singleline(&mut self.send_on_port).hint_text("Port"));
//Make connecting to an ip more user friendly
// ui.add(egui::TextEdit::singleline(&mut self.send_on_address).hint_text("Address"));
// ui.add(egui::TextEdit::singleline(&mut self.send_on_port).hint_text("Port"));

//format two text inputs, so because im too lazy
self.send_on_ip = format!("[{}]:{}", self.send_on_address, self.send_on_port);
// //format two text inputs, so because im too lazy
// self.send_on_ip = format!("[{}]:{}", self.send_on_address, self.send_on_port);
ui.text_edit_singleline(&mut self.send_on_ip);

ui.allocate_ui(vec2(25., 25.), |ui| {
if ui
Expand Down
4 changes: 2 additions & 2 deletions src/app/ui/client_ui/message_instances/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ impl TemplateApp {
});
Area::new("image_overlay_exit")
.movable(false)
.anchor(Align2::RIGHT_TOP, vec2(30., 50.))
.anchor(Align2::RIGHT_TOP, vec2(-100., 100.))
.show(ctx, |ui|{
ui.allocate_ui(vec2(75., 75.), |ui| {
ui.allocate_ui(vec2(25., 25.), |ui| {
if ui.add(egui::ImageButton::new(egui::include_image!("../../../../../icons/cross.png"))).clicked() {
self.image_overlay = false;
}
Expand Down
7 changes: 7 additions & 0 deletions src/app/ui/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,14 @@ impl TemplateApp {
if self.ipv4_mode {
ui.label(RichText::from("Public ipV4 address : ").size(20.));
ui.text_edit_singleline(&mut pub_ip[1].trim().to_string());

ui.label("Server address");
ui.text_edit_singleline(&mut format!("[{}]:{}", pub_ip[1],self.open_on_port));
} else {
ui.label(RichText::from("Public ipV6 address : ").size(20.));
ui.text_edit_singleline(&mut pub_ip[0].trim().to_string());
ui.label("Server address");
ui.text_edit_singleline(&mut format!("[{}]:{}", pub_ip[0],self.open_on_port));
}
if self.server_req_password && !self.server_password.is_empty() {
ui.label(RichText::from(format!(
Expand All @@ -117,6 +122,8 @@ impl TemplateApp {
}
ui.label(RichText::from("Port").size(15.).strong());
ui.label(RichText::from(self.open_on_port.clone()).size(15.));


}
});
});
Expand Down

0 comments on commit bb932b7

Please sign in to comment.