Commit 99ac36b2 authored by Guido Gunther's avatar Guido Gunther
Browse files

Add error page

parent 7b83da12
......@@ -45,6 +45,7 @@ struct _LiviWindow
GtkAdjustment *adj_duration;
GtkImage *img_fullscreen;
GtkBox *box_error;
GtkBox *box_placeholder;
GstPlayer *player;
......@@ -139,6 +140,8 @@ static void
on_player_error (GstPlayer *player, GError *error, LiviWindow *self)
{
g_warning ("Player error: %s", error->message);
gtk_stack_set_visible_child (self->stack_content, GTK_WIDGET (self->box_error));
}
......@@ -358,6 +361,8 @@ livi_window_class_init (LiviWindowClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/sigxcpu/Livi/livi-window.ui");
gtk_widget_class_bind_template_child (widget_class, LiviWindow, adj_duration);
gtk_widget_class_bind_template_child (widget_class, LiviWindow, box_content);
gtk_widget_class_bind_template_child (widget_class, LiviWindow, box_error);
gtk_widget_class_bind_template_child (widget_class, LiviWindow, box_placeholder);
gtk_widget_class_bind_template_child (widget_class, LiviWindow, btn_mute);
gtk_widget_class_bind_template_child (widget_class, LiviWindow, btn_play);
......
......@@ -22,6 +22,7 @@
<object class="GtkOverlay" id="overlay">
<child>
<object class="GtkPicture" id="picture_video">
<property name="width-request">300</property>
<property name="halign">center</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
......@@ -171,6 +172,23 @@
</child>
</object>
</child>
<child>
<object class="GtkBox" id="box_error">
<property name="orientation">vertical</property>
<property name="valign">center</property>
<child>
<object class="AdwStatusPage">
<property name="icon-name">face-uncertain-symbolic</property>
<property name="title">Failed to play video</property>
<style>
<class name="livi-error"/>
</style>
</object>
</child>
</object>>
</child>
</object>
</child>
</template>
......
......@@ -20,6 +20,15 @@
border-radius: 4px;
}
.livi-error {
background-color: rgba(80, 80, 80, 0.8);
color: @warning_color;
margin: 4px 16px 4px 16px;
border-radius: 4px;
}
.livi-info label {
margin: 6px;
border-radius: 4px;
......
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