fix(segmented_button): misaligned next tab button
This commit is contained in:
parent
135770a16d
commit
213ede371b
2 changed files with 5 additions and 16 deletions
|
|
@ -152,7 +152,7 @@ where
|
|||
|
||||
// If collapsed, use the maximum width available.
|
||||
visible_width = if state.collapsed {
|
||||
max_size.width - f32::from(self.button_height)
|
||||
max_size.width
|
||||
} else {
|
||||
total_width
|
||||
};
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ where
|
|||
} else {
|
||||
// Check if the next tab button was clicked.
|
||||
if cursor_position.is_over(Rectangle {
|
||||
x: bounds.width - f32::from(self.button_height) / 4.0 - 8.0,
|
||||
x: bounds.x + bounds.width - f32::from(self.button_height),
|
||||
y: bounds.y,
|
||||
width: f32::from(self.button_height),
|
||||
height: f32::from(self.button_height),
|
||||
|
|
@ -803,13 +803,7 @@ where
|
|||
renderer.fill_quad(
|
||||
renderer::Quad {
|
||||
bounds: Rectangle {
|
||||
x: bounds.width
|
||||
- f32::from(self.button_height) / 2.0
|
||||
- if let Length::Shrink = self.width {
|
||||
0.0
|
||||
} else {
|
||||
8.0
|
||||
},
|
||||
x: bounds.x + bounds.width - f32::from(self.button_height),
|
||||
y: bounds.y,
|
||||
width: f32::from(self.button_height),
|
||||
height: bounds.height,
|
||||
|
|
@ -838,13 +832,8 @@ where
|
|||
appearance.inactive.text_color
|
||||
},
|
||||
Rectangle {
|
||||
x: bounds.width
|
||||
- f32::from(self.button_height) / 4.0
|
||||
- if let Length::Shrink = self.width {
|
||||
0.0
|
||||
} else {
|
||||
8.0
|
||||
},
|
||||
x: bounds.x + bounds.width - f32::from(self.button_height)
|
||||
+ f32::from(self.button_height) / 4.0,
|
||||
y: bounds.y + f32::from(self.button_height) / 4.0,
|
||||
width: 16.0,
|
||||
height: 16.0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue