refactor: icon styling and headerbar icon styling

Headerbar icons are transparent when their window is not focused, but otherwise share the same style as icons with selection. This updates the icon styles to match figma when selected.
This commit is contained in:
Ashley Wulber 2024-03-11 15:21:48 -04:00
parent 6f6eeec0e7
commit 3e305199f1
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
11 changed files with 121 additions and 115 deletions

View file

@ -469,7 +469,6 @@ impl Application for Window {
};
let mut header = header_bar()
.window_id(window::Id::MAIN)
.title("COSMIC Design System - Iced")
.on_close(Message::Close)
.on_drag(Message::Drag)

View file

@ -131,7 +131,11 @@ impl cosmic::Application for MultiWindow {
let input = text_input("something", &w.input_value)
.on_input(move |msg| Message::Input(input_id.clone(), msg))
.id(w.input_id.clone());
let focused = self
.core()
.focused_window()
.map(|i| i == id)
.unwrap_or_default();
let new_window_button = button(text("New Window")).on_press(Message::NewWindow);
let content = scrollable(
@ -151,7 +155,7 @@ impl cosmic::Application for MultiWindow {
if id == window::Id::MAIN {
window_content.into()
} else {
column![header_bar().window_id(id), window_content].into()
column![header_bar().focused(focused), window_content].into()
}
}