Commit graph

409 commits

Author SHA1 Message Date
Automeris naranja
faef4a5915 background: Add missing mnemonics 2024-01-23 11:09:19 +00:00
velsinki
94513252fc background: Remove bg-colors-source and refactor
The ability to choose solid colored backgrounds has been removed at
least 4 years ago, so let's remove the code for it too.

Furthermore, we slightly refactor some code to make it easier to
understand and fit better to the usual style.
2023-12-19 14:14:28 +00:00
velsinki
23e7e8466e background: Make preview sharper using CcBackgroundPaintable
Because the CcBackgroundPaintable is now reusable, it can be used inside
the preview. This allows removing lots of code, since the drawing is now
done by the paintable. Because the scale factor was previously not
handled properly, this change makes the preview much sharper on scale
factors > 1.

Fixes #704
2023-12-19 14:14:28 +00:00
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
velsinki
761367ac4a background: Make paintable light/dark adjustable
In order to make the CcBackgroundPaintable more reusable, the way it
draws itself either light, dark, or both needs to be adjustable. We
therefore introduce CcBackgroundPaintFlags that indicate the desired
drawing behavior.
2023-12-19 14:14:28 +00:00
velsinki
50411b206d background: Split Meson generated enums
This separates the CcBackground... enums from the GDesktop... ones,
preserving the separate namespaces.
2023-12-19 14:14:28 +00:00
Automeris naranja
dff589a6c7 background-chooser: Add tooltip to the remove background button 2023-11-29 10:12:30 +00:00
velsinki
96a0b79a15 background: Improve chooser performance
The size of the background item is currently never used, but setting it
using `gnome_bg_get_image_size ()` is expensive, since that actually
does a thumbnail retrieval.

Instead, we can retrieve the size of the background file directly,
improving the rendering performance of the chooser significantly.
2023-11-28 13:43:06 +00:00
velsinki
798eb78023 background: Improve preview performance
Since 7cef6dc5, the background previews are rendered at the full
resolution. However, this is expensive and causes considerable lag,
especially for resizes. Since then, the thumbnail size has doubled to
256 pixels, making the previews sharper even at larger sizes.

So, to improve performance, let's effectively revert 7cef6dc5. The
revert is not possible without disabling frame = 0 retrieval, since that
is broken for non-slideshow backgrounds and was not used before anyways
with force_size = TRUE.

Related to #674
Related to #704
Related to #2448
2023-11-28 13:43:06 +00:00
Alice Mikhaylenko
4680f362f3 Port to AdwNavigationSplitView 2023-08-25 08:00:43 +00:00
Alice Mikhaylenko
11a9c20ba6 background: Port to AdwToolbarView 2023-08-25 08:00:43 +00:00
Robert Ancell
b87a46079d background: Connect signal handlers in swapped form 2023-06-07 09:12:54 +12:00
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
0b850560a8 background: Fix name of parent class variable 2023-06-06 07:54:38 +00:00
Robert Ancell
f23218e037 background: Do signal handlers in swapped form 2023-05-30 08:36:22 +00:00
Pablo Correa Gómez
7f7b65545c all: meson: do not specify resources from gresource files as dependencies
Meson extracts them by itself and add them as dependencies for the target.
It means one less location to keep track of files, and a lot less boilerplate
around the meson files
2023-05-24 08:34:14 +00:00
Nelson Benítez León
6fb6ba1dc9 meson: improve comment and fix deprecated functions
- Clarify that 'mm-glib' dep is for ModemManager (not Network
   Manager which is below). The comment also helps people
   which may confuse it with glibmm library.

 - Fix following Meson warning about two deprecated functions:
   WARNING: Deprecated features used:
   * 0.56.0: {'dependency.get_pkgconfig_variable', 'meson.source_root'}
2023-05-02 11:33:31 +00:00
Ray Strode
b1850b5c8a background: Clear out dconf if user picks defaults
If a user chooses the default background in control-center, then
they still end up with a change in dconf. This change means that
on upgrades, they'll keep the old distro background configured.

That's probably unexpected and may lead them to believe the upgrade
didn't work.

This commit checks if the user goes back to the distro defaults and
clears out dconf in that case, so that when the disto defaults change
they get the new defaults.
2023-05-02 11:32:49 +00:00
Bastien Nocera
11ae5d11d1 background: Remove unused thumbnail factory 2023-01-25 09:54:10 +00:00
Jake Dane
89443fe550 desktop: Remove obsolete Bugzilla entries
The `X-GNOME-Bugzilla-*` entries were for use by bug-buddy, a GNOME 2
technology that's been gone for over a decade. These entries are
obsolete and can be removed from all desktop files.

The `X-GNOME-Settings-Panel` entry is also obsolete as far as I can
tell and only these panels had it in their desktop file: notifications,
sharing, sound and user-accounts. These entries can also be removed.

After removing the `X-GNOME-Bugzilla-*` entries, the desktop files have
no more variables in them. The meson `configure_file` step is therefor
pointless—there are no variables to configure. As such the
`*.desktop.in.in` files are renamed to `*.desktop.in` to reflect this
and `meson.build` files are modified to remove `configure_file` step.
2022-10-20 13:20:09 +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
Matthias Clasen
920302bb52 background: Allow all images
The code was filtering with a small list of known
image mimetypes, needlessly. Just allow any
image/* mimetypes.

Fixes: #2036
2022-08-25 17:06:12 +00:00
Alexander Mikhaylenko
38442303e0 background: Adjust preview header bar style
There has been a slight change, sync to it.
2022-06-28 22:36:36 +04: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
Cassidy James Blaede
91f3a7ec4f background: change "Light" to "Default" 2022-06-15 19:12:10 +00:00
Felipe Borges
e5dbc0dcc1 appearance: Add "Appearance" keyword to desktop file
With the panel getting renamed from "Background" to "Appearance", users
like myself will start getting accustomed to search for the new term
instead.
2022-05-25 10:09:06 +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
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
Sebastian Keller
5df1519d7d background: Make sure the size of the light/dark previews is the same
Without homogeneous columns the difference in the size of the light/dark
labels could cause one preview to be larger.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1810
2022-05-05 10:13:34 +02:00
Alexander Mikhaylenko
c932168462 background: Trigger screen transition when changing style
See https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2070
2022-02-11 22:12:49 +00:00
Alexander Mikhaylenko
eca4c0a370 background-paintable: Clip light wallpapers as well
Turns out drawing the whole light wallpaper and then half of the dark
wallpaper on top of it is leading to a case of
https://gitlab.gnome.org/GNOME/gtk/-/issues/3840

Draw half of each instead, so they don't overlap.
2022-02-10 05:11:30 +05: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
ca5bdd07de background: Refine background chooser layout
Make thumbnails smaller, add margin on the sides.
2022-02-07 10:50:10 +00:00
Alexander Mikhaylenko
c5792cfb00 background: Support dark wallpapers 2022-02-07 10:50:10 +00:00
Alexander Mikhaylenko
303cc2176e background-preview: Add a missing break 2022-02-07 10:50:10 +00:00
Alexander Mikhaylenko
1e2069e748 background: Don't expand the background list
It looks weird when there are few wallpapers.
2022-02-07 10:50:10 +00:00
Sam Hewitt
65b109763b Cleanup private use symbolics
- remove references to deprecated app symbolics
- reduce file size of private-use icons
- update dated icons
2022-02-04 18:12:41 +00:00
Christopher Davis
8347e01453 background: Use AdwPreferences{Page,Group}
Now that AdwPreferencesGroup has support for
header suffixes, we can cut out a lot of widgetry
by using it and AdwPreferencesPage directly.
2022-01-31 12:15:43 -08:00
Jakub Steiner
13376ecb8b Add individual app icons 2022-01-31 14:08:22 +00:00
Georges Basile Stavracas Neto
acd59aec65 Rename app-id to org.gnome.Settings
Rename the app-id to org.gnome.Settings since this is what
we've been calling it for many years now. Adjust all files
that derive from the app-id, such as the desktop file, D-Bus
service file names, search providers, GSettings schemas, to
match that.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/344
2022-01-21 13:08:50 +00:00
Georges Basile Stavracas Neto
0ab20af9ba panels: Switch to CcPanel content
Start porting panels to the new panel format. This commit
temporarily makes panels have two titlebar, which will be
fixed soon.
2022-01-20 02:23:42 +00:00
Jan Beich
37b29c32cb meson: drop unused argument for i18n.merge_file()
Ignored in Meson < 0.60.0, deprecated since 0.60.1 and fatal since 0.61.0.

panels/applications/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/background/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/camera/meson.build:10:5: ERROR: Function does not take positional arguments.
[...]
2022-01-07 17:22:43 +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
Alexander Mikhaylenko
3fea98b151 background: Rename to Appearance 2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
ecd6124b91 background: Add a light/dark style switcher 2021-12-20 19:51:46 +00:00
Alexander Mikhaylenko
0aaa6f296d background: Redo the layout to match the new mockups 2021-12-20 19:51:46 +00:00