add title to server select menu, don't use unneeded Container in language select menu

This commit is contained in:
Yusuf Bera Ertan 2020-07-25 11:57:02 +03:00 committed by Imbris
parent 12abd64a01
commit 52479fec2f
3 changed files with 22 additions and 14 deletions

View File

@ -160,6 +160,8 @@ https://veloren.net/account/."#,
"main.login.banned": "You have been banned with the following reason",
"main.login.kicked": "You have been kicked with the following reason",
"main.servers.select_server": "Select a server",
/// End Main screen section

View File

@ -217,9 +217,9 @@ impl LanguageSelectBanner {
selected_language_index: Option<usize>,
button_style: style::button::Style,
) -> Element<Message> {
let title =
Container::new(Text::new(i18n.get("main.select_language")).size(fonts.cyri.scale(35)))
.center_x();
let title = Text::new(i18n.get("main.select_language"))
.size(fonts.cyri.scale(35))
.horizontal_alignment(iced::HorizontalAlignment::Center);
let mut list = Scrollable::new(&mut self.selection_list)
.spacing(8)

View File

@ -39,17 +39,23 @@ impl Screen {
i18n: &Localization,
button_style: style::button::Style,
) -> Element<Message> {
let button = neat_button(
&mut self.back_button,
i18n.get("common.back"),
0.77_f32,
button_style,
Some(Message::Back),
);
let button = Container::new(Container::new(button).max_width(200))
let title = Text::new(i18n.get("main.servers.select_server"))
.size(fonts.cyri.scale(35))
.width(Length::Fill)
.align_x(Align::Center);
.horizontal_alignment(iced::HorizontalAlignment::Center);
let back_button = Container::new(
Container::new(neat_button(
&mut self.back_button,
i18n.get("common.back"),
0.77_f32,
button_style,
Some(Message::Back),
))
.max_width(200),
)
.width(Length::Fill)
.align_x(Align::Center);
let mut list = Scrollable::new(&mut self.servers_list)
.spacing(8)
@ -88,7 +94,7 @@ impl Screen {
Container::new(
Container::new(
Column::with_children(vec![list.into(), button.into()])
Column::with_children(vec![title.into(), list.into(), back_button.into()])
.width(Length::Fill)
.height(Length::Fill)
.spacing(10)