remove ugly gnome's ScrolledWindow + TextView integration

This commit is contained in:
yggverse 2025-11-15 19:54:22 +02:00
parent ffb1474c7e
commit 4a94cd4161
3 changed files with 5 additions and 17 deletions

View file

@ -61,13 +61,7 @@ impl Input {
title: Option<&str>,
size_limit: Option<usize>,
) {
self.update(Some(&gtk::Box::response(
action,
base,
title,
size_limit,
MAX_CONTENT_HEIGHT,
)));
self.update(Some(&gtk::Box::response(action, base, title, size_limit)));
}
pub fn set_new_sensitive(

View file

@ -23,7 +23,6 @@ pub trait Response {
base: Uri,
title: Option<&str>,
size_limit: Option<usize>,
max_content_height: i32,
) -> Self;
}
@ -36,7 +35,6 @@ impl Response for Box {
base: Uri,
title: Option<&str>,
size_limit: Option<usize>,
max_content_height: i32,
) -> Self {
// Init components
let control = Rc::new(Control::build());
@ -49,18 +47,12 @@ impl Response for Box {
.margin_end(MARGIN)
.margin_start(MARGIN)
.margin_top(MARGIN)
.spacing(SPACING)
.orientation(Orientation::Vertical)
.spacing(SPACING)
.build();
g_box.append(&title);
g_box.append(
&gtk::ScrolledWindow::builder()
.child(&text_view)
.max_content_height(max_content_height)
.propagate_natural_height(true)
.build(),
);
g_box.append(&text_view);
g_box.append(&control.g_box);
// Init events

View file

@ -36,6 +36,7 @@ impl Form for TextView {
.css_classes(["frame", "view"])
.extra_menu(&adapter.menu_model())
.left_margin(MARGIN)
.margin_bottom(MARGIN / 4)
.right_margin(MARGIN)
.top_margin(MARGIN)
.valign(gtk::Align::BaselineCenter)
@ -43,6 +44,7 @@ impl Form for TextView {
.build();
text_view.insert_action_group("spelling", Some(&adapter));
text_view.set_size_request(-1, 36); // @TODO [#635](https://gitlab.gnome.org/GNOME/pygobject/-/issues/635)
// Init events
text_view.connect_realize(|this| {