Commit graph

27 commits

Author SHA1 Message Date
Christopher Davis
b73ce78230 background: Use GtkFileDialog
The GtkFileChooser interface is deprecated. Instead of using it,
we should use the new GtkFileDialog APIs.
2023-06-06 13:33:29 +00:00
Robert Ancell
f23218e037 background: Do signal handlers in swapped form 2023-05-30 08:36:22 +00:00
grumpey
3ca850b257 Add support for multiple file selection
fix formatting
2022-06-20 23:25:44 +00:00
Amy
7f4a7c125f background: fix parameter indentation
Commit d2474bf0 ("background: revert false indentation") fixed a warning
which sprung from improper indentation of a function call. To comply 
with project style, the parameter list's indentation must also be
adjusted. This issue was pointed out by Georges (@fearanon). 

This patch changes the indentation of the parameters in compliance.
2022-06-15 19:26:24 +00:00
Amy
dbfc44b1f4 background: revert false indentation
Commit 46673670 ("Fix indentation") indented lines 160-163 of
cc-background-chooser.c to make them seem as if they were part of the
associated if statement. However, they are not, which causes confusion
as to the intention of the code. It appears as if the
gtk_accessible_update_property call is executed upon button being non-
null, but it is always executed due to the lack of an if block. For
clarity, and to resolve a compiler warning, this patch should be
reverted.

This patch reverts 46673670, changing the indentation back correctly. 
This was mentioned in #1902 and received no objections, including
approval from Lukas.
2022-06-15 19:26:24 +00:00
Lukáš Tyrychtr
46673670d9 Fix indentation 2022-05-10 21:11:57 +00:00
Lukáš Tyrychtr
a477684f20 Improve accessibility of the background panel 2022-05-10 21:11:57 +00:00
Alexander Mikhaylenko
24311b6ebd background-chooser: Remove a leftover binding
GtkWidget:text-direction doesn't exist. That's why we connect to the
::direction-changed signal instead, and this property binding was
just a leftover from c5792cfb00.
2022-02-09 14:23:29 +00:00
Alexander Mikhaylenko
c5792cfb00 background: Support dark wallpapers 2022-02-07 10:50:10 +00:00
Alexander Mikhaylenko
5c903af015 background: Polish wallpaper thumbnails
Make corners rounded.

Replace selected style with an overlay check, make the close button
smaller to match. Move slideshow indicator to the lower left corner.

Set margins in css.
2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
88879951cf background: Clean up the slideshow icon
Update the unused symbolic to match the svg with a baked-in shadow,
actually use it. Bundle it in gresources instead of installing, fix the
style class name. Fix margins - the close button was overriding them.
2021-12-20 19:51:46 +00:00
Georges Basile Stavracas Neto
d9d670328b background: Port to GTK4
CcBackgroundPreview required some layout changes, but
overall a pretty easy port.
2021-12-14 22:34:21 -03:00
Debarshi Ray
f85750274c background: Drop the unused build dependency on Grilo
The code that uses Grilo to fetch the user's Flickr photos isn't
actually used by the Background panel, to the extent that the final
binary doesn't even link against Grilo. Getting rid of this unused code
will ensure that distributors aren't needlessly pulling in this
dependency.

https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1345
2021-04-20 23:04:10 +02:00
Alexander Mikhaylenko
13ffacb083 background: Fix thumbnail size on hidpi
Use GIcon GtkImage API instead lf GdkPixbuf. The latter treats pixbufs as
always being in 1x scale and upscales them to compensate, while in our case
they are pre-scaled.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/787
2021-03-04 13:29:27 +00:00
Robert Ancell
9418093900 background: Replace g_object_new with gtk widget methods
This improves compile time type checking.
2020-10-19 04:07:53 +00:00
Felipe Borges
40c8426f15 background: Allow adding multiple files to backgrounds
Fixes #889
2020-03-29 22:38:55 +00:00
Tobias Bernard
27b88c2ce6 Background: change thumbnail size to 154 2020-02-19 10:59:28 +00:00
Julian Sparber
2e1dc3da00 background: add remove button overlay to recent section 2020-02-19 09:37:26 +00:00
Florian Müllner
7c436727a3 background: Simplify background-chosen signal
Now that there's only a single background to set, there's no use for
a flag parameter to specify the background(s).

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/864
2020-02-19 09:37:26 +00:00
Julian Sparber
159c9afe93 background: Remove the popover
In 3.36, we will use a heavily blurred wallpaper on the lock screen.

As that wallpaper will be unrecognizable, there is no good reason to
pick a different one from the regular session. The shell will therefore
stop using the separate lock-screen settings.
The popover isn't needed anymore because it would only have one option:
to set the wallpaper. And an additional option for the recent section to
remove the wallpaper for the list, which can be done via a overlay
button.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/864
2020-02-19 09:37:26 +00:00
Robert Ancell
70f8f74765 background: Move gnome-desktop-thumbnail.h includes
Remove one that wasn't needed, add in two in files that don't include it.
2020-01-22 11:40:42 +13:00
Robert Ancell
cd377768f5 Avoid warnings where G_LOG_DOMAIN is overriden
Undefine the value before overriding it to avoid the following warnings:
../panels/background/cc-background-chooser.c:22: warning: "G_LOG_DOMAIN" redefined
2019-11-04 22:12:05 +00:00
Georges Basile Stavracas Neto
728d3b4fca
background: Add "Open Picture…" header button
This makes the new Background panel feature-complete; we can
add and remove custom wallpapers now.
2019-05-30 20:09:53 -03:00
Georges Basile Stavracas Neto
6c5270db32
background: Add recent backgrounds
Add a recent section, composed by an additional GtkFlowBox and
a separator, and code to hide it when there are no recent
wallpapers.

To the popover menu, add a new "Remove Background" button that
is only visible when clicking on recent backgrounds.
2019-05-30 20:09:53 -03:00
Georges Basile Stavracas Neto
5ba721b581
background: Use widgets to render slideshow emblem
Instead of manually rendering it.
2019-05-30 20:01:49 -03: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
2f032f224a
background: Introduce CcBackgroundChooser
It will become essentially what CcBackgroundChooserDialog,
but without a dialog and organized differently. Right now,
it is as minimal as it could be and only shows wallpapers.
As we grow it, it may cover pictures and even colors.
2019-05-30 20:01:12 -03:00