Skip to content

Commit f2e6fee

Browse files
committed
Fix positioning of offline status label
1 parent 0846a1f commit f2e6fee

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/Widgets/ServiceInfo.vala

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ public class FeedReader.ServiceInfo : Gtk.Overlay {
2323
m_label.get_style_context ().add_class (Granite.STYLE_CLASS_H3_LABEL);
2424
m_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL);
2525

26+
m_offline = new Gtk.Label ("OFFLINE") {
27+
halign = Gtk.Align.CENTER,
28+
margin_start = 10,
29+
margin_end = 10,
30+
margin_top = 6,
31+
opacity = 0.0
32+
};
33+
m_offline.get_style_context ().add_class ("osd");
34+
2635
m_box = new Gtk.Grid () {
2736
orientation = Gtk.Orientation.VERTICAL,
2837
hexpand = true,
@@ -31,6 +40,7 @@ public class FeedReader.ServiceInfo : Gtk.Overlay {
3140
};
3241
m_box.add (m_logo);
3342
m_box.add (m_label);
43+
m_box.add (m_offline);
3444
m_box.margin_top = 20;
3545
m_box.margin_bottom = 5;
3646

@@ -41,15 +51,6 @@ public class FeedReader.ServiceInfo : Gtk.Overlay {
4151
m_stack.add_named (m_spinner, "spinner");
4252
m_stack.get_style_context ().add_class (Gtk.STYLE_CLASS_SIDEBAR);
4353
this.add (m_stack);
44-
45-
m_offline = new Gtk.Label ("OFFLINE");
46-
m_offline.margin_start = 40;
47-
m_offline.margin_end = 40;
48-
m_offline.margin_top = 30;
49-
m_offline.margin_bottom = 10;
50-
// m_offline.get_style_context ().add_class ("osd");
51-
m_offline.no_show_all = true;
52-
this.add_overlay (m_offline);
5354
}
5455

5556
public void refresh () {
@@ -76,10 +77,10 @@ public class FeedReader.ServiceInfo : Gtk.Overlay {
7677
}
7778

7879
public void setOffline () {
79-
m_offline.show ();
80+
m_offline.opacity = 1.0;
8081
}
8182

8283
public void setOnline () {
83-
m_offline.hide ();
84+
m_offline.opacity = 0.0;
8485
}
8586
}

0 commit comments

Comments
 (0)