feat: Update button padding and height in title bar for improved UI consistency
This commit is contained in:
@@ -856,11 +856,13 @@ impl shader::Primitive for CanvasShaderPrimitive {
|
|||||||
clip_bounds.width,
|
clip_bounds.width,
|
||||||
clip_bounds.height,
|
clip_bounds.height,
|
||||||
);
|
);
|
||||||
|
// clip_bounds is already in physical pixels from iced — use it for the
|
||||||
|
// wgpu viewport which also expects physical pixel coordinates.
|
||||||
render_pass.set_viewport(
|
render_pass.set_viewport(
|
||||||
self.bounds.x,
|
clip_bounds.x as f32,
|
||||||
self.bounds.y,
|
clip_bounds.y as f32,
|
||||||
self.bounds.width,
|
clip_bounds.width as f32,
|
||||||
self.bounds.height,
|
clip_bounds.height as f32,
|
||||||
0.0,
|
0.0,
|
||||||
1.0,
|
1.0,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -178,7 +178,8 @@ pub fn view<'a>(
|
|||||||
|
|
||||||
let minimize_btn = button(text("─").size(12))
|
let minimize_btn = button(text("─").size(12))
|
||||||
.on_press(Message::WindowMinimize)
|
.on_press(Message::WindowMinimize)
|
||||||
.padding([2, 8])
|
.padding([4, 10])
|
||||||
|
.height(MENU_BAR_HEIGHT)
|
||||||
.style(
|
.style(
|
||||||
move |_theme: &iced::Theme, status: iced::widget::button::Status| match status {
|
move |_theme: &iced::Theme, status: iced::widget::button::Status| match status {
|
||||||
iced::widget::button::Status::Hovered => iced::widget::button::Style {
|
iced::widget::button::Status::Hovered => iced::widget::button::Style {
|
||||||
@@ -189,7 +190,7 @@ pub fn view<'a>(
|
|||||||
},
|
},
|
||||||
_ => iced::widget::button::Style {
|
_ => iced::widget::button::Style {
|
||||||
background: Some(iced::Background::Color(iced::Color::from_rgba(
|
background: Some(iced::Background::Color(iced::Color::from_rgba(
|
||||||
0.0, 0.0, 0.0, 0.0,
|
0.0, 0.0, 0.0, 0.06,
|
||||||
))),
|
))),
|
||||||
text_color: c.text_secondary,
|
text_color: c.text_secondary,
|
||||||
border: iced::Border::default(),
|
border: iced::Border::default(),
|
||||||
@@ -200,7 +201,8 @@ pub fn view<'a>(
|
|||||||
|
|
||||||
let maximize_btn = button(text("□").size(12))
|
let maximize_btn = button(text("□").size(12))
|
||||||
.on_press(Message::WindowMaximize)
|
.on_press(Message::WindowMaximize)
|
||||||
.padding([2, 8])
|
.padding([4, 10])
|
||||||
|
.height(MENU_BAR_HEIGHT)
|
||||||
.style(
|
.style(
|
||||||
move |_theme: &iced::Theme, status: iced::widget::button::Status| match status {
|
move |_theme: &iced::Theme, status: iced::widget::button::Status| match status {
|
||||||
iced::widget::button::Status::Hovered => iced::widget::button::Style {
|
iced::widget::button::Status::Hovered => iced::widget::button::Style {
|
||||||
@@ -211,7 +213,7 @@ pub fn view<'a>(
|
|||||||
},
|
},
|
||||||
_ => iced::widget::button::Style {
|
_ => iced::widget::button::Style {
|
||||||
background: Some(iced::Background::Color(iced::Color::from_rgba(
|
background: Some(iced::Background::Color(iced::Color::from_rgba(
|
||||||
0.0, 0.0, 0.0, 0.0,
|
0.0, 0.0, 0.0, 0.06,
|
||||||
))),
|
))),
|
||||||
text_color: c.text_secondary,
|
text_color: c.text_secondary,
|
||||||
border: iced::Border::default(),
|
border: iced::Border::default(),
|
||||||
@@ -222,7 +224,8 @@ pub fn view<'a>(
|
|||||||
|
|
||||||
let close_btn = button(text("×").size(13))
|
let close_btn = button(text("×").size(13))
|
||||||
.on_press(Message::WindowClose)
|
.on_press(Message::WindowClose)
|
||||||
.padding([2, 10])
|
.padding([4, 10])
|
||||||
|
.height(MENU_BAR_HEIGHT)
|
||||||
.style(
|
.style(
|
||||||
move |_theme: &iced::Theme, status: iced::widget::button::Status| match status {
|
move |_theme: &iced::Theme, status: iced::widget::button::Status| match status {
|
||||||
iced::widget::button::Status::Hovered => iced::widget::button::Style {
|
iced::widget::button::Status::Hovered => iced::widget::button::Style {
|
||||||
@@ -233,7 +236,7 @@ pub fn view<'a>(
|
|||||||
},
|
},
|
||||||
_ => iced::widget::button::Style {
|
_ => iced::widget::button::Style {
|
||||||
background: Some(iced::Background::Color(iced::Color::from_rgba(
|
background: Some(iced::Background::Color(iced::Color::from_rgba(
|
||||||
0.0, 0.0, 0.0, 0.0,
|
0.0, 0.0, 0.0, 0.06,
|
||||||
))),
|
))),
|
||||||
text_color: c.text_secondary,
|
text_color: c.text_secondary,
|
||||||
border: iced::Border::default(),
|
border: iced::Border::default(),
|
||||||
|
|||||||
Reference in New Issue
Block a user