Commit 9f0fdfa4 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

Put the errors in a scrolled window

it also cleans up the stylecontext errors before displaying them
parent 31708eec
Pipeline #103757 passed with stages
in 30 minutes and 18 seconds
......@@ -205,17 +205,35 @@ Software's source code can be found <a href="https://gitlab.gnome.org/GNOME/g
<property name="can_focus">False</property>
<property name="relative_to">errors_togglebtn</property>
<child>
<object class="GtkBox" id="errors_container">
<object class="GtkScrolledWindow">
<property name="width_request">350</property>
<property name="height_request">200</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="orientation">vertical</property>
<property name="can_focus">True</property>
<property name="max_content_width">400</property>
<property name="max_content_height">400</property>
<property name="propagate_natural_height">True</property>
<child>
<placeholder/>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkBox" id="errors_container">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
<style>
<class name="errors-container"/>
</style>
</object>
</child>
</object>
</child>
<style>
<class name="errors-container"/>
</style>
</object>
</child>
</object>
......
......@@ -91,7 +91,8 @@ impl Banner {
Ok(_) => self.sender.send(Action::RemoveError(banner_id.to_string())).unwrap(),
Err(err) => {
warn!("Couldn't load stylesheet of banner {}", err);
self.sender.send(Action::AddError(banner_id.to_string(), err.to_string())).unwrap();
let sent_error = err.to_string().replace("<data>:", "");
self.sender.send(Action::AddError(banner_id.to_string(), sent_error)).unwrap();
}
};
ctx.add_provider(&provider, 300);
......
......@@ -100,12 +100,14 @@ impl Window {
let error_app = gtk::Label::new(Some(id));
error_app.set_halign(gtk::Align::Start);
error_app.get_style_context().add_class("dim-label");
error_app.set_xalign(0.0);
error_app.show();
error_box.pack_start(&error_app, false, false, 0);
let error_label = gtk::Label::new(Some(error));
error_label.set_halign(gtk::Align::Start);
error_label.set_property_width_request(300);
error_label.set_xalign(0.0);
error_label.set_property_wrap(true);
error_label.set_ellipsize(pango::EllipsizeMode::End);
error_label.show();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment