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

Latest commit

 

History

History
21 lines (14 loc) · 1.53 KB

README.md

File metadata and controls

21 lines (14 loc) · 1.53 KB

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.