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.
|
// If collapsed, use the maximum width available.
|
||||||
visible_width = if state.collapsed {
|
visible_width = if state.collapsed {
|
||||||
max_size.width - f32::from(self.button_height)
|
max_size.width
|
||||||
} else {
|
} else {
|
||||||
total_width
|
total_width
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -475,7 +475,7 @@ where
|
||||||
} else {
|
} else {
|
||||||
// Check if the next tab button was clicked.
|
// Check if the next tab button was clicked.
|
||||||
if cursor_position.is_over(Rectangle {
|
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,
|
y: bounds.y,
|
||||||
width: f32::from(self.button_height),
|
width: f32::from(self.button_height),
|
||||||
height: f32::from(self.button_height),
|
height: f32::from(self.button_height),
|
||||||
|
|
@ -803,13 +803,7 @@ where
|
||||||
renderer.fill_quad(
|
renderer.fill_quad(
|
||||||
renderer::Quad {
|
renderer::Quad {
|
||||||
bounds: Rectangle {
|
bounds: Rectangle {
|
||||||
x: bounds.width
|
x: bounds.x + bounds.width - f32::from(self.button_height),
|
||||||
- f32::from(self.button_height) / 2.0
|
|
||||||
- if let Length::Shrink = self.width {
|
|
||||||
0.0
|
|
||||||
} else {
|
|
||||||
8.0
|
|
||||||
},
|
|
||||||
y: bounds.y,
|
y: bounds.y,
|
||||||
width: f32::from(self.button_height),
|
width: f32::from(self.button_height),
|
||||||
height: bounds.height,
|
height: bounds.height,
|
||||||
|
|
@ -838,13 +832,8 @@ where
|
||||||
appearance.inactive.text_color
|
appearance.inactive.text_color
|
||||||
},
|
},
|
||||||
Rectangle {
|
Rectangle {
|
||||||
x: bounds.width
|
x: bounds.x + bounds.width - f32::from(self.button_height)
|
||||||
- f32::from(self.button_height) / 4.0
|
+ f32::from(self.button_height) / 4.0,
|
||||||
- if let Length::Shrink = self.width {
|
|
||||||
0.0
|
|
||||||
} else {
|
|
||||||
8.0
|
|
||||||
},
|
|
||||||
y: bounds.y + f32::from(self.button_height) / 4.0,
|
y: bounds.y + f32::from(self.button_height) / 4.0,
|
||||||
width: 16.0,
|
width: 16.0,
|
||||||
height: 16.0,
|
height: 16.0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue