Changed the file structure

This commit is contained in:
Eduardo Flores 2022-10-12 19:44:44 -07:00 committed by Michael Murphy
parent 7743d0d084
commit 420d3c3dfc
22 changed files with 409 additions and 395 deletions

View file

@ -7,6 +7,6 @@ pub fn main() -> cosmic::iced::Result {
let mut settings = settings();
settings.window.min_size = Some((600, 300));
// TODO: Window resize handles not functioning yet
// settings.window.decorations = false;
settings.window.decorations = false;
Window::run(settings)
}

View file

@ -1,4 +1,4 @@
use cosmic::widget::{expander, expander_row, list_section_style, ListBox};
use cosmic::widget::{expander, ListBox};
use cosmic::{
iced::widget::{
checkbox, column, container, horizontal_space, pick_list, progress_bar, radio, row, slider,
@ -7,11 +7,8 @@ use cosmic::{
iced::{self, theme, Alignment, Application, Color, Command, Element, Length, Theme},
iced_lazy::responsive,
iced_winit::window::{drag, maximize, minimize},
scrollable,
widget::{
button, header_bar, list_item, list_row, list_section, list_view, nav_bar_style,
nav_button, toggler,
},
list_item, list_row, list_section, list_view, nav_button, scrollable,
widget::{button, header_bar, list_row, list_view::*, nav_bar::nav_bar_style, toggler},
};
#[derive(Default)]
@ -77,6 +74,7 @@ impl Application for Window {
.show_maximize(true)
.show_minimize(true);
window.slider_value = 50.0;
// window.theme = Theme::Light;
window.pick_list_selected = Some("Option 1");
(window, Command::none())
}
@ -109,6 +107,7 @@ impl Application for Window {
fn view(&self) -> Element<Message> {
let mut header: Element<Message, _> = header_bar()
.title(self.title())
.nav_title(String::from("Settings"))
.sidebar_active(self.sidebar_toggled)
.show_minimize(self.show_minimize)
.show_maximize(self.show_maximize)
@ -240,12 +239,12 @@ impl Application for Window {
.icon(String::from("edit-paste"))
.on_row_selected(Box::new(Message::RowSelected))
.rows(vec![
expander_row()
list_row()
.title("Label")
.subtitle("Caption")
.icon(String::from("help-about")),
expander_row().subtitle("Caption").title("Label"),
expander_row().title("Label")
list_row().subtitle("Caption").title("Label"),
list_row().title("Label")
])
),
list_section!(