Commit graph

40 commits

Author SHA1 Message Date
velsinki
18413cb172 background: Make CcBackgroundPaintable independent
To make the CcBackgroundPaintable fully reusable, it has to know the
desired thumbnail size and the thumbnail factory. We add a width and
height property, and modify the thumbnail retrieval of CcBackgroundItem
to use the scale factor now.

This also allows us to greatly simplify the background sources, so that
they now only do one thing: provide CcBackgroundItems from different
sources.

We keep the fixed thumbnail height and width for the chooser, which
makes more sense now that it is in the chooser code instead of the
background source code.
2023-12-19 14:14:28 +00:00
Felipe Borges
a9312cdea3 background: Check for bg name before sorting wallpapers
Otherwise a missing <name> tag in an wallpaper XML can couse
Settings to crash.

Fixes #2087
2022-10-17 15:13:34 +00:00
Felipe Borges
0be875c0b0 background: Order background items alphabetically
Except for the "Default Background" which skips the line and gets
shown first.

Fixes #1716
2022-05-10 03:46:33 +00:00
Robert Ancell
3eb0aaec28 background: Connect signals with g_signal_connect_object in swapped form 2020-03-30 16:18:49 +13:00
Georges Basile Stavracas Neto
c64ab472b6
background: Switch to GtkFlowBox
This is a major rework on how images are loaded and stored.
Unfortunately, this is so entangled that doing each change
as an atomic step is pretty much unfeasible.

The first major change is that BgSource now returns a GListStore
instead of a GtkListStore. This is necessary for us to bind it
to GtkFlowBox, and pretty much signals we're not using any of
the tree/icon views anymore.

Second, the thumbnail factory was moved to BgSource itself. We
only create factories for large thumbnails, so it's not needed
to handle each one of them individually.

At last, switch CcBackgroundChooser to GtkFlowBox, and adjust
the signals we connect to.
2019-05-30 20:01:45 -03:00
Georges Basile Stavracas Neto
5afc292c2b
background: Make BgSource receive a GtkWidget
Instead of a GtkWindow. We don't really depend on GtkWindow
itself, just any widget with access to the scale factor.
2019-05-30 20:01:12 -03:00
Robert Ancell
2b95f9576d background: Fix compile warnings with g_clear_pointer 2019-02-07 11:22:53 +13:00
Robert Ancell
122f997493 background: Replace deprecated GSimpleAsyncResult with GTask 2018-06-03 06:46:16 +04:00
Robert Ancell
0baacee873 background: Use g_auto for variables
https://bugzilla.gnome.org/show_bug.cgi?id=788155
2018-01-26 16:22:23 +13:00
Robert Ancell
378e837a06 background: Use G_DEFINE_TYPE 2017-09-25 14:16:09 -04:00
Debarshi Ray
fabc31b447 background: Clean up uses of GIcon
Now that we are compositing our own emblems, there is no need to use
GIcon. We can directly use GdkPixbufs everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=732375
2014-08-12 23:48:46 +02:00
Debarshi Ray
7f606870a3 background: Composite the emblems ourselves
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
2014-07-16 17:42:18 +02:00
Debarshi Ray
a3247e73a4 background: Use higher resolution thumbnails on HiDpi displays
https://bugzilla.gnome.org/show_bug.cgi?id=731713
2014-06-17 18:50:28 +02:00
Debarshi Ray
b950a69f3b background: Rearrange the GObject boilerplate
... so that it is possible to override virtual functions and change
the order of the object creation and destruction process without having
to write a bunch of prototypes. Having the class_init below the others
helps us do that.

https://bugzilla.gnome.org/show_bug.cgi?id=731713
2014-06-17 18:50:27 +02:00
Debarshi Ray
9475b514bc background: Remove empty property getters and setters
https://bugzilla.gnome.org/show_bug.cgi?id=731713
2014-06-17 18:50:27 +02:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Kalev Lember
4ecb35ca12 background: Fix a memory leak with wallpaper loading
This removes an extra g_object_ref when inserting items to GtkListStore:
the list store takes care of incrementing the reference count itself and
the caller doesn't need to do it.

https://bugzilla.gnome.org/show_bug.cgi?id=709453
2013-10-07 10:35:52 +02:00
Bastien Nocera
a2872ff123 background: Remove empty finalize functions
They were just chaining up.

https://bugzilla.gnome.org/show_bug.cgi?id=707602
2013-09-09 16:24:56 +02:00
Bastien Nocera
00d8f80586 background: Use g_clear_* helpers when possible
https://bugzilla.gnome.org/show_bug.cgi?id=707602
2013-09-09 16:24:37 +02:00
William Jon McCann
79ec684fa4 background: New background panel design
Implement a new design for the wallpaper selection.

https://bugzilla.gnome.org/show_bug.cgi?id=676539
2012-08-17 17:57:27 -04:00
Matthias Clasen
4838efab11 Background: Improve a11y of wallpaper list
Add an invisible text cell renderer to have the text spoken
by orca.
2011-05-16 00:12:44 -04:00
Bastien Nocera
e5fb92268f background: Show 'Adwaita' as the first in the list
https://bugzilla.gnome.org/show_bug.cgi?id=637384
2011-02-12 03:14:00 +00:00
Bastien Nocera
265e10af1a background: Remove unused variable 2011-02-12 03:13:58 +00:00
Bastien Nocera
ce4f4d5627 background: Make loading wallpapers seem faster
As the UI actually updates as the files are loaded.
2011-02-12 03:13:56 +00:00
Bastien Nocera
415d4c1111 background: GnomeWpXml to CcBackgroundXml
and into a GObject.
2011-02-12 03:13:53 +00:00
Bastien Nocera
c016e5cea2 background: Remove the "changed" signal
It wasn't used anyway.
2011-02-12 03:13:50 +00:00
Bastien Nocera
2735c788b4 background: Use URIs everywhere internally
Now we'd just need gnome-bg to make the jump.

This also fixes unique IDs for the wallpapers source, as
multiple backgrounds can be defined in a single XML file.
2011-02-11 18:11:11 +00:00
Bastien Nocera
ca14846ef9 background: Major rework of the CcBackgroundItem code
It now is a full GObject, will be able to track the original
XML file for a wallpaper, as well as which values are set in it.

This will allow us to restore wallpapers properly, and only offer
editing options when those aren't already hard-coded inside the
item.
2011-02-10 20:35:02 +00:00
Bastien Nocera
9a209fa181 background: Rename gnome-wp-item to cc-background-item 2011-02-10 20:35:02 +00:00
Bastien Nocera
7b287b8c03 background: Async function for loading XML wallpapers
It's ugly API, but it means we don't block anymore.
2011-02-10 12:10:13 +00:00
Bastien Nocera
035126a970 background: Add emblem for slideshow previews
Though for some reason the icon ends up being tiny...
2010-12-14 20:29:33 +00:00
Bastien Nocera
f48054ccf1 background: Show wallpaper size on startup
When available. Remove the "px" from the size label.
2010-12-14 19:24:19 +00:00
Bastien Nocera
39f452afee background: Follow mockups
Add icon to represent slideshows, always show a name for the
currently set background on startup, show whether a background
is a slideshow, and its pixel size if available.
2010-12-14 18:27:11 +00:00
William Jon McCann
d5642cf221 background: load wallpapers in an idle
So we don't block the construction.
2010-11-21 22:06:26 -05:00
Andreas Proschofsky
32f59e6df5 all: Fix build for latest gnome-desktop changes
https://bugzilla.gnome.org/show_bug.cgi?id=634859
2010-11-14 22:12:59 +00:00
Rodrigo Moya
bb26cd2e51 background: Use gdesktop-settings-schemas enums all over 2010-10-14 14:57:35 +02:00
Bastien Nocera
7854262a93 background: add FIXME for unused function 2010-09-20 18:01:27 +01:00
Thomas Wood
ce8cd97754 background: implement new UI design from Jakub Steiner 2010-08-25 19:18:05 +01:00
Thomas Wood
abdb42e9e2 background: derive background sources from a common source object
Add the BgSource object to define the common aspects of background sources
and make sure the existing sources inherit from it.
2010-08-10 17:01:15 +01:00
Thomas Wood
e721f417ad Add initial implementation of "background" panel
The background settings panel provides a way for users to change the
desktop background by selecting an image and/or colour.
2010-08-10 15:26:07 +01:00