Skip to content

Commit

Permalink
fix(window): center window title
Browse files Browse the repository at this point in the history
  • Loading branch information
git-f0x authored and Drakulix committed Oct 10, 2024
1 parent b7a34bd commit ea2215e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/shell/element/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ impl Program for CosmicWindowInternal {

fn view(&self) -> cosmic::Element<'_, Self::Message> {
let mut header = cosmic::widget::header_bar()
.start(cosmic::widget::horizontal_space(32))
.title(self.last_title.lock().unwrap().clone())
.on_drag(Message::DragStart)
.on_close(Message::Close)
Expand All @@ -504,10 +505,14 @@ impl Program for CosmicWindowInternal {
.on_right_click(Message::Menu);

if cosmic::config::show_minimize() {
header = header.on_minimize(Message::Minimize);
header = header
.on_minimize(Message::Minimize)
.start(cosmic::widget::horizontal_space(40)); // 32 + 8 spacing
}
if cosmic::config::show_maximize() {
header = header.on_maximize(Message::Maximize);
header = header
.on_maximize(Message::Maximize)
.start(cosmic::widget::horizontal_space(40)); // 32 + 8 spacing
}

header.into()
Expand Down

0 comments on commit ea2215e

Please sign in to comment.