Skip to content

Commit 4a94cd4

Browse files
author
yggverse
committed
remove ugly gnome's ScrolledWindow + TextView integration
1 parent ffb1474 commit 4a94cd4

3 files changed

Lines changed: 5 additions & 17 deletions

File tree

src/app/browser/window/tab/item/page/input.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,7 @@ impl Input {
6161
title: Option<&str>,
6262
size_limit: Option<usize>,
6363
) {
64-
self.update(Some(&gtk::Box::response(
65-
action,
66-
base,
67-
title,
68-
size_limit,
69-
MAX_CONTENT_HEIGHT,
70-
)));
64+
self.update(Some(&gtk::Box::response(action, base, title, size_limit)));
7165
}
7266

7367
pub fn set_new_sensitive(

src/app/browser/window/tab/item/page/input/response.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pub trait Response {
2323
base: Uri,
2424
title: Option<&str>,
2525
size_limit: Option<usize>,
26-
max_content_height: i32,
2726
) -> Self;
2827
}
2928

@@ -36,7 +35,6 @@ impl Response for Box {
3635
base: Uri,
3736
title: Option<&str>,
3837
size_limit: Option<usize>,
39-
max_content_height: i32,
4038
) -> Self {
4139
// Init components
4240
let control = Rc::new(Control::build());
@@ -49,18 +47,12 @@ impl Response for Box {
4947
.margin_end(MARGIN)
5048
.margin_start(MARGIN)
5149
.margin_top(MARGIN)
52-
.spacing(SPACING)
5350
.orientation(Orientation::Vertical)
51+
.spacing(SPACING)
5452
.build();
5553

5654
g_box.append(&title);
57-
g_box.append(
58-
&gtk::ScrolledWindow::builder()
59-
.child(&text_view)
60-
.max_content_height(max_content_height)
61-
.propagate_natural_height(true)
62-
.build(),
63-
);
55+
g_box.append(&text_view);
6456
g_box.append(&control.g_box);
6557

6658
// Init events

src/app/browser/window/tab/item/page/input/response/form.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ impl Form for TextView {
3636
.css_classes(["frame", "view"])
3737
.extra_menu(&adapter.menu_model())
3838
.left_margin(MARGIN)
39+
.margin_bottom(MARGIN / 4)
3940
.right_margin(MARGIN)
4041
.top_margin(MARGIN)
4142
.valign(gtk::Align::BaselineCenter)
4243
.wrap_mode(WrapMode::Word)
4344
.build();
4445

4546
text_view.insert_action_group("spelling", Some(&adapter));
47+
text_view.set_size_request(-1, 36); // @TODO [#635](https://gitlab.gnome.org/GNOME/pygobject/-/issues/635)
4648

4749
// Init events
4850
text_view.connect_realize(|this| {

0 commit comments

Comments
 (0)