Skip to content

Commit

Permalink
error: Fixup appearance
Browse files Browse the repository at this point in the history
When testing this out, I realized the spacing and packing of most of the
widgets had regressed since gtk4. So, fix that.
  • Loading branch information
Lyude committed Dec 25, 2022
1 parent a3b9af7 commit bef2ffa
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,28 @@ pub struct ErrorArea {

impl ErrorArea {
pub fn new() -> Self {
let base = gtk::Box::new(gtk::Orientation::Horizontal, 0);
let base = gtk::Box::builder()
.orientation(gtk::Orientation::Horizontal)
.spacing(10)
.valign(gtk::Align::Center)
.halign(gtk::Align::Center)
.vexpand(true)
.hexpand(true)
.build();

let label = gtk::Label::builder()
.wrap(true)
.hexpand(true)
.vexpand(true)
.build();

let label = gtk::Label::builder().wrap(true).build();
let error_image = gtk::Image::from_icon_name("dialog-error");
error_image.set_icon_size(gtk::IconSize::Large);
error_image.set_halign(gtk::Align::End);
error_image.set_valign(gtk::Align::Center);
error_image.set_hexpand(true);
error_image.set_vexpand(true);

base.append(&error_image);
base.append(&label);

Expand Down

0 comments on commit bef2ffa

Please sign in to comment.