We should be pairing gtk_window_get_size with
gtk_window_set_default_size to avoid inconsistencies between the size
reading and setting code. eg., in recent GTK+ versions,
gtk_window_get_size and gtk_widget_set_size_request differ in their
interpretation of the CSD chrome.
However, gtk_window_set_default_size didn't work with non-resizable
GtkWindows, until now.
https://bugzilla.gnome.org/show_bug.cgi?id=762548
Instead of using a GtkGrid and GtkBox to mimic what GtkStack and
GtkStackSwitcher already does for us, let's just use the latter. As a
result each source now has its separate GtkIconView. The pictures
source has a nested GtkStack to switch between the 'empty' box and the
view, which should simplify size-related issues.
https://bugzilla.gnome.org/show_bug.cgi?id=736366
There are three cases which affect our size calculation:
- When the dialog is without a parent in the test application.
- When the dialog is maximized on small screens.
- When the dialog is used with an unmaximized parent.
The width of the chooser is much more than half the width of the parent
in the third case. So there is no point in doing it.
The width that we set for the grid in the content area is actually what
is useful.
https://bugzilla.gnome.org/show_bug.cgi?id=736366
We were assuming that setting stock-size would affect the emblems in
GEmblemedIcons, but not the icons themselves. This is a bit weird.
GtkCellRendererPixbuf:gicon is meant to work with
GtkCellRendererPixbuf:stock-size, and this was only working so far
because GTK_ICON_LOOKUP_FORCE_SIZE was not being used when loading
the icon.
Let's composite the emblems ourselves so that we don't have to depend
on this quirky interpretation of stock-size.
Unfortunately, we can not directly use the pixbufs because they are
unaware of the scale factor and GTK+ will scale them on HiDpi
displays. Since our pixbufs already have enough pixels to work well
with such devices, scaling them further will lead to giant, fuzzy
thumbnails. Hence, we use GtkCellRendererPixbuf:surface with the
scale factor codified in it.
https://bugzilla.gnome.org/show_bug.cgi?id=732375
When using a small screen, make sure that the whole of the dialogue
is visible, including the confirmation buttons. This means that the
dialogue will be maximised when on smaller screens (just like its
parent), and that we won't set a number of columns for the icon
view.
We will also stop making the dialogue much bigger than the
Settings window itself.
https://bugzilla.gnome.org/show_bug.cgi?id=692495
Instead of setting the size on each child, set it on the parent grid
because only one of those children are visible at any given point.
We are cheating a bit by ignoring the fact there is a second child
which is always shown -- the button box. This will make the other
children lose some height and the dialog will be smaller. However it is
still too big for smaller screens.
https://bugzilla.gnome.org/show_bug.cgi?id=708943
Show a message to the user when the Pictures source is empty, inspired both
in design and widget layout by the EmptyResultsBox from gnome-documents.
https://bugzilla.gnome.org/show_bug.cgi?id=630892