Fixed the ambience volume ui element positions

This commit is contained in:
LunarEclipse 2022-09-03 20:15:50 +02:00
parent 24c50fab3b
commit be9e0497d1

View File

@ -8,7 +8,7 @@ use crate::{
}; };
use conrod_core::{ use conrod_core::{
color, color,
position::Relative, position::{Align, Relative},
widget::{self, Button, Rectangle, Scrollbar, Text}, widget::{self, Button, Rectangle, Scrollbar, Text},
widget_ids, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, widget_ids, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon,
}; };
@ -342,7 +342,7 @@ impl<'a> Widget for Sound<'a> {
.localized_strings .localized_strings
.get_msg("hud-settings-ambience_volume"), .get_msg("hud-settings-ambience_volume"),
) )
.down_from(state.ids.sfx_volume_slider, 10.0) .down_from(state.ids.sfx_volume_muted, 10.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR) .color(TEXT_COLOR)
@ -356,7 +356,7 @@ impl<'a> Widget for Sound<'a> {
self.imgs.slider, self.imgs.slider,
) )
.w_h(104.0, 22.0) .w_h(104.0, 22.0)
.down_from(state.ids.ambience_volume_text, 10.0) .right_from(state.ids.ambience_volume_muted, 8.0)
.track_breadth(12.0) .track_breadth(12.0)
.slider_length(10.0) .slider_length(10.0)
.pad_track((5.0, 5.0)) .pad_track((5.0, 5.0))
@ -391,7 +391,7 @@ impl<'a> Widget for Sound<'a> {
// Music spacing // Music spacing
Text::new(&self.localized_strings.get_msg("hud-settings-music_spacing")) Text::new(&self.localized_strings.get_msg("hud-settings-music_spacing"))
.down_from(state.ids.ambience_volume_slider, 10.0) .down_from(state.ids.ambience_volume_muted, 10.0)
.font_size(self.fonts.cyri.scale(14)) .font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR) .color(TEXT_COLOR)
@ -406,6 +406,7 @@ impl<'a> Widget for Sound<'a> {
) )
.w_h(104.0, 22.0) .w_h(104.0, 22.0)
.down_from(state.ids.music_spacing_text, 10.0) .down_from(state.ids.music_spacing_text, 10.0)
.x_align_to(state.ids.ambience_volume_slider, Align::Start)
.track_breadth(12.0) .track_breadth(12.0)
.slider_length(10.0) .slider_length(10.0)
.pad_track((5.0, 5.0)) .pad_track((5.0, 5.0))
@ -457,6 +458,7 @@ impl<'a> Widget for Sound<'a> {
.hover_image(self.imgs.button_hover) .hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press) .press_image(self.imgs.button_press)
.down_from(state.ids.music_spacing_slider, 12.0) .down_from(state.ids.music_spacing_slider, 12.0)
.x_align_to(state.ids.ambience_volume_text, Align::Start)
.label(&self.localized_strings.get_msg("hud-settings-reset_sound")) .label(&self.localized_strings.get_msg("hud-settings-reset_sound"))
.label_font_size(self.fonts.cyri.scale(14)) .label_font_size(self.fonts.cyri.scale(14))
.label_color(TEXT_COLOR) .label_color(TEXT_COLOR)