Commit 6a83809a authored by Felipe Borges's avatar Felipe Borges

notification: Port Boxes.AuthNotification to GtkRevealer

GtkRevealer combined with the "app-notification" class is enough
to represent the notification concept nowadays. This is part of
the effort to drop the dependency on libgd.

https://bugzilla.gnome.org/show_bug.cgi?id=779978
parent 154fa83c
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.9 -->
<template class="BoxesAuthNotification" parent="GdNotification">
<template class="BoxesAuthNotification" parent="GtkRevealer">
<property name="visible">True</property>
<property name="valign">start</property>
<property name="timeout">-1</property>
<property name="border-width">6</property>
<child>
<object class="GtkGrid" id="grid">
<property name="visible">True</property>
<property name="column-spacing">12</property>
<property name="row-spacing">6</property>
<property name="border-width">6</property>
<style>
<class name="app-notification"/>
</style>
<child>
<object class="GtkLabel" id="title_label">
......
......@@ -2,7 +2,9 @@
using Gtk;
[GtkTemplate (ui = "/org/gnome/Boxes/ui/auth-notification.ui")]
private class Boxes.AuthNotification: Gd.Notification {
private class Boxes.AuthNotification: Gtk.Revealer {
public signal void dismissed ();
public delegate void AuthFunc (string username, string password);
[GtkChild]
......@@ -26,7 +28,12 @@ private class Boxes.AuthNotification: Gd.Notification {
owned Notification.DismissFunc? dismiss_func,
bool need_username,
Searchbar searchbar) {
show_close_button = false; // FIXME: Seems setting this from .UI file doesn't work
/*
* Templates cannot set construct properties, so
* lets use the respective property setter method.
*/
set_reveal_child (true);
title_label.label = auth_string;
dismissed.connect (() => {
......@@ -79,4 +86,9 @@ private class Boxes.AuthNotification: Gd.Notification {
dismiss ();
}
public void dismiss () {
set_reveal_child (false);
dismissed ();
}
}
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