feat: tweaks
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
mod font;
|
mod font;
|
||||||
|
|
||||||
use crate::font::Font;
|
use crate::font::Font;
|
||||||
use adw::{prelude::*, Application, ApplicationWindow, HeaderBar};
|
use adw::{prelude::*, Application, ApplicationWindow, ComboRow, HeaderBar, PreferencesGroup};
|
||||||
use gtk4::{
|
use gtk4::{
|
||||||
cairo::Context, Box as GtkBox, DrawingArea, Label, ListBox, ListBoxRow, MenuButton,
|
cairo::Context, Box as GtkBox, DrawingArea, Label, ListBox, ListBoxRow, MenuButton,
|
||||||
Orientation, Popover,
|
Orientation, Popover, StringList,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@@ -53,6 +53,17 @@ impl AppWindow {
|
|||||||
}
|
}
|
||||||
popover.set_child(Some(&list_box));
|
popover.set_child(Some(&list_box));
|
||||||
|
|
||||||
|
let group = PreferencesGroup::new();
|
||||||
|
let combo_row = ComboRow::new();
|
||||||
|
|
||||||
|
let options = vec!["Option 1", "Option 2", "Option 3"];
|
||||||
|
let string_list = StringList::new(&options);
|
||||||
|
combo_row.set_model(Some(&string_list));
|
||||||
|
|
||||||
|
// Optionally set which one is selected (by index)
|
||||||
|
combo_row.set_selected(1); // Select "Medium"
|
||||||
|
group.add(&combo_row);
|
||||||
|
|
||||||
let drawing_area = DrawingArea::new();
|
let drawing_area = DrawingArea::new();
|
||||||
drawing_area.set_vexpand(true);
|
drawing_area.set_vexpand(true);
|
||||||
drawing_area.set_hexpand(true);
|
drawing_area.set_hexpand(true);
|
||||||
@@ -80,6 +91,7 @@ impl AppWindow {
|
|||||||
|
|
||||||
let layout = GtkBox::new(Orientation::Vertical, 0);
|
let layout = GtkBox::new(Orientation::Vertical, 0);
|
||||||
layout.append(&header_bar);
|
layout.append(&header_bar);
|
||||||
|
layout.append(&combo_row);
|
||||||
layout.append(&drawing_area);
|
layout.append(&drawing_area);
|
||||||
window.set_content(Some(&layout));
|
window.set_content(Some(&layout));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user