Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Show how to implement an in-app notification overlay

Notifications You must be signed in to change notification settings

gaphor/in-app-notification-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GTK in-app notification demo

This repo contains a small demo in-app notifications for GTK. In-app notifications are part of GTK, but there's no special widget. Instead it can be created by combining existing widgets and applying style classes.

in-app notification

Background

When you look at applications like GNOME Files and Geary, it shows a nice small notification overlay at the top of the window every now and then.

There is no special widget for such a notification bar. When I searched for this notification bar I found exactly one match: a post on Stack Overflow. Where else.

That's not a lot. Geary is not the only application to implement one.

The basics

The basic idea is to use a Gtk.Overlay. Add the main content to the base layer and add a second layer with a Gtk.Revealer. To this revealer, you add a Gtk.Box, or a Gtk.Frame, and apply a class app-notification to it. Add a label and a button and you're done. The icons used are "symbolic" icons.

About

Show how to implement an in-app notification overlay

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages