elementary / granite

Library that extends GTK with common widgets and utilities
https://elementary.io
GNU Lesser General Public License v3.0
286 stars 60 forks source link

Responsive placeholder #664

Closed danirabbit closed 9 months ago

danirabbit commented 1 year ago

Problem

Granite.Placeholder is great as a welcome screen or as a placeholder in large lists, but for smaller lists in dialogs and popovers it is way too big

Proposal

An alternate, more compact style. Maybe we can do this automatically if the placeholder is inside a popover or dialog and/or with a style class?

Prior Art (Optional)

Screenshot from 2023-10-24 16 27 17

In this popover in Mail we make our own custom placeholder because Granite's is too big

danirabbit commented 9 months ago

Think about it more, I think it should just automatically scale based on its parent. So for example:

list placeholder .title-1 {
    font-size: 2em;
}

list placeholder .title-2 {
    font-size: 1em;
}

popover placeholder > grid > .large-icons {
    -gtk-icon-size: 32px;
}

popover placeholder .title-1 {
    font-size: 1em;
}

popover placeholder .title-2 {
    font-size: 0.85em;
}