Commit graph

334 commits

Author SHA1 Message Date
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
Robert Ancell
ff342dfbc7 background: Use g_autoptr to remove an explicit unref 2019-10-30 12:10:29 +00:00
Robert Ancell
5183faea04 background: Fix crash if a BgRecentSource is unreffed during an async operation
The BG_RECENT_SOURCE (user_data) call was done before it was checked if is was
cancelled. At this point user_data is pointing to an object that has been deleted.

Fixes #729
2019-10-22 14:03:14 +00:00
Niels De Graef
f83450cebf Chain up to parent finalize()
This was forgotten in a few places, which means you have a memory leak
(albeit tiny).
2019-10-14 09:56:08 +02:00
Philip Chimento
ecd27846f8 background: Update clock in both preview modes
There is a clock widget both on the desktop preview and the lock screen.
Without this change, the clock on the desktop preview is always blank.
2019-09-30 11:08:13 -07:00
Damián Nohales
70fb75eb27 background: Allow load background file relative to XML file 2019-09-17 13:35:09 -07:00
Robert Ancell
97985a664e Remove unused GNOMELOCALEDIR defines 2019-09-09 21:45:53 +00:00
Allan Day
4bfb32a578 background: clarify remove background button
The button doesn't delete the original file - it just removes
the image from the selection. "Remove" is therefore a better word
than "Delete", and the destructive action style isn't appropriate.

Fixes #578
2019-07-22 21:25:29 +00:00
Mohammed Sadiq
e1cd43cb48 background: Get Preview aspect ratio from primary monitor
Get the aspect ratio from Primary monitor, and allow the preview
to have smaller size, so that it works well on smaller screens
2019-07-20 02:22:03 +00:00
Georges Basile Stavracas Neto
8d9ed8c655
background: Cleanup BgColorsSource
After commit c64ab472b6, none of the thumbnail factories are
actually used anymore in BgColorsSource. Clean them up from
the code -- which is unused now, but will be kept for future
proofing purposes.
2019-05-30 20:09:54 -03:00
Georges Basile Stavracas Neto
6df2b0bb4a
background: Remove dead code
We do not download pictures anymore; the BgRecentSource
always copies the wallpapers before actually adding them,
and the BgWallpapersSource handles system-wide wallpapers,
which typically do not change.

Remove this dead code, and the unecessary widgets that were
kept to keep this code working -- essentially, a few boxes
around the previewers.
2019-05-30 20:09:53 -03: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
9e39748d16
background: Introduce BgRecentSource
BgRecentSource is a background source implementation that
keeps track of recently added backgrounds.

The backgrounds are copied to $(local data dir)/backgrounds,
which is monitored. When copying files to this folder, the
current time is added as prefix to avoid filename collisions.
2019-05-30 20:09:50 -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
5b214404a1
background: Move preview to CcBackgroundPreview
This is a dedicate class to generate the preview. Not only
it renders the pixbuf of the wallpaper, but it also adds
lock screen or desktop frames on top of it. It also monitors
the time to keep the lock screen preview label always updated.
2019-05-30 20:01:48 -03:00
Georges Basile Stavracas Neto
205bfb9446
background: Use the cairo_t provided by GTK
Instead of creating our own one using a deprecated function.
2019-05-30 20:01:48 -03:00
Georges Basile Stavracas Neto
214f03750b
background: Remove CcBackgroundChooserDialog
It's functionality moved to CcBackgroundChooser.
2019-05-30 20:01:48 -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
ee37d0194c
background: Cache thumbnails in CcBackgroundItem
We don't actually need to use custom qdata in GObjects to do
that; instead, cache the thumbnail directly in the item.
2019-05-30 20:01:12 -03:00
Georges Basile Stavracas Neto
df80d4a2fe
background-panel: Remove background chooser buttons
The chooser itself is now located below, and we don't need
to have the buttons anymore.
2019-05-30 20:01:12 -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
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
Georges Basile Stavracas Neto
ad740deeea
background: Turn into a template class 2019-05-30 20:01:11 -03:00
Georges Basile Stavracas Neto
c290dadf0c
background: Rename ui file to cc-background-panel.ui 2019-05-30 20:01:11 -03:00
Robert Ancell
2b95f9576d background: Fix compile warnings with g_clear_pointer 2019-02-07 11:22:53 +13:00
Robert Ancell
c11890667b background: Fix warning when XDG_PICTURES_DIR not defined
Make the code match the existing monitor to fall back to the home directory.

The error message was:
(gnome-control-center:22910): GLib-GIO-CRITICAL **: 16:42:17.915: g_file_new_for_path: assertion 'path != NULL' failed
2018-10-18 01:31:27 +00:00
Robert Ancell
9da8e1b68d background: Fix warning when opening background selection dialog
This was due to the callback occurring before all the widgets had been added to
the dialog.

Also remove the workaround for the handler occuring during/after dispose by
using g_signal_connect_object.

The warnings were:
(gnome-control-center:13048): Gtk-CRITICAL **: 09:42:17.841: gtk_bin_get_child: assertion 'GTK_IS_BIN (bin)' failed
(gnome-control-center:13048): Gtk-CRITICAL **: 09:42:17.841: gtk_icon_view_unselect_all: assertion 'GTK_IS_ICON_VIEW (icon_view)' failed
2018-10-10 22:57:43 +00:00
Robert Ancell
d2d8a501cd background: Don't use gtk_widget_show_all
It is removed in GTK+ 4
2018-10-10 04:01:11 +00:00
Robert Ancell
122f997493 background: Replace deprecated GSimpleAsyncResult with GTask 2018-06-03 06:46:16 +04:00
Robert Ancell
930aff4cc7 background: Fix compile warning about object type
[8/15] Compiling C object 'panels/background/panels@background@@background-chooser@sta/cc-background-xml.c.o'.
In file included from /usr/include/glib-2.0/gobject/gbinding.h:29:0,
                 from /usr/include/glib-2.0/glib-object.h:23,
                 from /usr/include/glib-2.0/gio/gioenums.h:28,
                 from /usr/include/glib-2.0/gio/giotypes.h:28,
                 from /usr/include/glib-2.0/gio/gio.h:26,
                 from ../panels/background/cc-background-xml.c:22:
../panels/background/cc-background-xml.c: In function ‘cc_background_xml_load_xml_internal’:
/usr/include/glib-2.0/gobject/gobject.h:512:32: warning: passing argument 2 of ‘emit_added_in_idle’ from incompatible pointer type [-Wincompatible-pointer-types]
 #define g_object_ref(Obj)      ((__typeof__(Obj)) (g_object_ref) (Obj))
                                ^
../panels/background/cc-background-xml.c:310:34: note: in expansion of macro ‘g_object_ref’
         emit_added_in_idle (xml, g_object_ref (item));
                                  ^~~~~~~~~~~~
../panels/background/cc-background-xml.c:138:1: note: expected ‘GObject * {aka struct _GObject *}’ but argument is of type ‘CcBackgroundItem * {aka struct _CcBackgroundItem *}’
 emit_added_in_idle (CcBackgroundXml *xml,
 ^~~~~~~~~~~~~~~~~~
2018-06-01 14:29:28 +12:00
Robert Ancell
ba3797aafe background: Remove unused variables 2018-05-25 12:36:34 +12:00
Piotr Drąg
7265bd53a0 Add translator comments to .desktop files
Icons are confusing translators, and gettext
is unlikely to get fixed any time soon.
2018-02-23 18:49:35 +01:00
Robert Ancell
ed03e9c49f background: Remove GdkColor deprecation warnings
https://bugzilla.gnome.org/show_bug.cgi?id=788205
2018-02-01 09:11:00 +13: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
trey
bb3ff84929 background: Add black background color
https://bugzilla.gnome.org/show_bug.cgi?id=778648
2018-01-26 00:35:19 -02:00
Iñigo Martínez
0dd386f405 build: Migrate from Intltool to Gettext
Recent versions of Gettext are able to translate several formats
that are used in GNOME applications. This patch migrates from
Intltool to Gettext by using meson's i18n features.

https://bugzilla.gnome.org/show_bug.cgi?id=787588
2018-01-23 10:49:31 +01:00
Iñigo Martínez
dc0988d47c build: Remove autotools
To avoid the burden of maintaining multiple build systems, this
patch removes autotools support.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-18 12:20:08 +01:00
Piotr Drąg
b65e31323a panels: Remove soft hyphens from .desktop files
With the old shell gone, there is no need to work around cut off panel
names (bug #647087). As it stands now, it only confuses translators
(invisible characters are hard to, well, see).

https://bugzilla.gnome.org/show_bug.cgi?id=792629
2018-01-18 00:12:04 -02:00
Iñigo Martínez
32edd6789e build: Port to meson build system
Meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-17 20:09:35 -02:00
Georges Basile Stavracas Neto
b23ef59926 shell-model: Remove old categories
Since we don't maintain two different shells anymore, there
is no need to maintain the two different sets of categories
in the desktop files.

This commit also drops the "#ifdef CC_ENABLE_ALT_CATEGORIES"
blocks, since the previous commit removed that define.

https://bugzilla.gnome.org/show_bug.cgi?id=790923
2017-11-28 17:03:51 -02:00
Robert Ancell
6723ff4d2b background: Drop dead background screenshot code
The screenshot was only trying to capture gnome-shell's top bar to
overlay on the background preview but now on 3.26 the top bar might be
transparent which obviously wouldn't work at all for previewing a
different wallpaper.

https://bugzilla.gnome.org/show_bug.cgi?id=788206
2017-11-01 16:09:22 +01:00
Robert Ancell
378e837a06 background: Use G_DEFINE_TYPE 2017-09-25 14:16:09 -04:00
Volodymyr Buell
daec536e25 background: Reduce the number of pixbuf creation by caching
https://bugzilla.gnome.org/show_bug.cgi?id=765887
2017-09-22 15:25:04 +02:00
Georges Basile Stavracas Neto
f69c1e106b background: Improve background chooser dialog
The background chooser dialog behavior was modeled against
a fixed-size, unmaximizable window, and makes some assumptions
that doesn't work well on the new layout.

Fix that by always setting 3 columns, and adjusting the dialog
height according to the transient parent.
2017-08-16 17:28:01 -03:00
Georges Basile Stavracas Neto
b182402fa9 background: Properly align labels with buttons
When the window resizes, we still want to keep these
labels centralized against their parents.
2017-08-16 16:18:29 -03:00
Georges Basile Stavracas Neto
e465010faa background: Improve layout on the new shell
The current Background panel was designed and architectured
for a fixed size, non resizable window. As such, it has a
few quirks that does not scale well with the new shell.

Fix that by rearchitecturing the Background panel hierarchy,
removing the deprecated widgets and simplifying the overall
hierarchy of widgets.
2017-08-12 12:34:01 -03:00
Silvère Latchurié
5508226405 background: handle EXIF orientation in chooser
The chooser ignores EXIF orientations embedded in the pictures when the
thumbnails are generated.

Because the EXIF informations are available after the file has been
loaded, it has to be reloaded if the transformed dimensions don't
match the thumbnails constraints.

The transformations are directly applied for EXIF orientations 1, 2,
3 and 4. For EXIF orientations 5, 6, 7 and 8, the pictures are reloaded
with swapped dimensions before the transformations are applied.

https://bugzilla.gnome.org/show_bug.cgi?id=783200
2017-06-07 18:24:26 +02:00
Bastien Nocera
99acb323d2 background: Add more information to run-time warning
It was impossible to know which background XML had an error with the
original message.
2017-06-07 18:24:26 +02:00
Georges Basile Stavracas Neto
2777fd583d panels: use the new categories
Following the previous patch, this patch adds the new alternative
categories to the panels' Desktop files. These alternative categories
are only relevant for the alternative Shell, and do not break the
current Shell in any way.

https://bugzilla.gnome.org/show_bug.cgi?id=767301
2016-06-14 12:16:43 -03:00