Skip to content
This repository was archived by the owner on Sep 27, 2022. It is now read-only.

Commit cc6a1fe

Browse files
Ivan Atanasovfrenkel
authored andcommitted
Support for markup in notice
1 parent 63df8cd commit cc6a1fe

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/app.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,10 @@ impl App {
239239
if current_version < latest_version {
240240
self.to_ui
241241
.send(ui::Signal::ShowNotice(format!(
242-
"New version available ({}), download it from {}",
242+
"New version available ({}), download it from <a href=\"{}\">{}</a>",
243243
txt.data.dname,
244244
env!("CARGO_PKG_HOMEPAGE"),
245+
env!("CARGO_PKG_HOMEPAGE")
245246
)))
246247
.expect("Sending message to ui thread");
247248
break;

src/ui.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,13 @@ impl Ui {
139139
Signal::ShowNotice(message) => {
140140
let bar = gtk::InfoBar::new();
141141
let content_area = bar.get_content_area().unwrap();
142+
let label = gtk::Label::new(None);
143+
label.set_markup(&message);
144+
142145
content_area
143146
.downcast::<gtk::Container>()
144147
.unwrap()
145-
.add(&gtk::Label::new(Some(&message)));
148+
.add(&label);
146149
bar.show_all();
147150
ui.grid.attach(&bar, 0, 0, 4, 1);
148151
}

0 commit comments

Comments
 (0)