Use scrolled window for source view

This commit is contained in:
ranfdev
2023-10-25 23:42:47 +02:00
parent 6d3c3ad1a7
commit d4953af5fc

View File

@ -262,6 +262,7 @@ impl NotifyWindow {
let message = imp.entry.text(); let message = imp.entry.text();
relm4_macros::view! { relm4_macros::view! {
window = adw::Window { window = adw::Window {
set_default_height: 400,
set_modal: true, set_modal: true,
set_transient_for: Some(self), set_transient_for: Some(self),
#[wrap(Some)] #[wrap(Some)]
@ -293,19 +294,22 @@ impl NotifyWindow {
set_xalign: 0.0, set_xalign: 0.0,
set_halign: gtk::Align::Start, set_halign: gtk::Align::Start,
}, },
append: text_view = &gsv::View { append = &gtk::ScrolledWindow {
add_css_class: "code", #[wrap(Some)]
set_tab_width: 4, set_child: text_view = &gsv::View {
set_indent_width: 2, add_css_class: "code",
set_auto_indent: true, set_tab_width: 4,
set_top_margin: 4, set_indent_width: 2,
set_bottom_margin: 4, set_auto_indent: true,
set_left_margin: 4, set_top_margin: 4,
set_right_margin: 4, set_bottom_margin: 4,
set_hexpand: true, set_left_margin: 4,
set_vexpand: true, set_right_margin: 4,
set_monospace: true, set_hexpand: true,
set_background_pattern: gsv::BackgroundPatternType::Grid set_vexpand: true,
set_monospace: true,
set_background_pattern: gsv::BackgroundPatternType::Grid
},
}, },
append = &gtk::Label { append = &gtk::Label {
add_css_class: "heading", add_css_class: "heading",
@ -313,8 +317,9 @@ impl NotifyWindow {
set_xalign: 0.0, set_xalign: 0.0,
set_halign: gtk::Align::Start, set_halign: gtk::Align::Start,
}, },
append = &gtk::Box { append = &gtk::FlowBox {
set_spacing: 4, set_column_spacing: 4,
set_row_spacing: 4,
append = &gtk::Button { append = &gtk::Button {
add_css_class: "pill", add_css_class: "pill",
add_css_class: "small", add_css_class: "small",