Commit e1ce7413 authored by Eisha Chen-yen-su's avatar Eisha Chen-yen-su

MediaViewer: Add a notification when loading

This adds a notification showing when the previous media are being
loaded.

See #265
parent 09f9630d
...@@ -145,6 +145,74 @@ ...@@ -145,6 +145,74 @@
<property name="index">1</property> <property name="index">1</property>
</packing> </packing>
</child> </child>
<child type="overlay">
<object class="GtkOverlay" id="media_viewer_notify_overlay">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">start</property>
<child>
<object class="GtkRevealer" id="media_viewer_notify_revealer">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<child>
<object class="GtkFrame" id="media_viewer_notify_frame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkBox" id="media_viewer_notify_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">10</property>
<child>
<object class="GtkSpinner" id="media_viewer_notify_spinner">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="media_viewer_notify_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Loading more media</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<child type="label_item">
<placeholder/>
</child>
<style>
<class name="app-notification"/>
</style>
</object>
</child>
</object>
<packing>
<property name="pass_through">True</property>
<property name="index">-1</property>
</packing>
</child>
</object>
<packing>
<property name="index">3</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
......
...@@ -171,6 +171,10 @@ impl AppOp { ...@@ -171,6 +171,10 @@ impl AppOp {
pub fn load_more_media(&mut self) { pub fn load_more_media(&mut self) {
if let Some(ref mut mv) = self.media_viewer { if let Some(ref mut mv) = self.media_viewer {
// TODO: Move out these instructions // TODO: Move out these instructions
let inapp: gtk::Revealer = self.ui.builder
.get_object("media_viewer_notify_revealer")
.expect("Can't find media_viewer_notify_revealer in ui file.");
inapp.set_reveal_child(true);
let previous_media_button = self.ui.builder let previous_media_button = self.ui.builder
.get_object::<gtk::Button>("previous_media_button") .get_object::<gtk::Button>("previous_media_button")
.expect("Cant find previous_media_button in ui file."); .expect("Cant find previous_media_button in ui file.");
...@@ -221,6 +225,12 @@ impl AppOp { ...@@ -221,6 +225,12 @@ impl AppOp {
APPOP!(previous_media); APPOP!(previous_media);
// TODO: Move out these instructions
let inapp: gtk::Revealer = ui.builder
.get_object("media_viewer_notify_revealer")
.expect("Can't find media_viewer_notify_revealer in ui file.");
inapp.set_reveal_child(false);
gtk::Continue(false) gtk::Continue(false)
} }
}); });
......
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