Commit Graph

2708 Commits

Author SHA1 Message Date
Matthias Clasen
6565cb78da gtk-demo: Don't create extra windows
When activate() is called via D-Bus, just present the window we
already have.

Fixes: #7213
2024-12-21 10:39:09 -05:00
Matthias Clasen
cec8d46b6a print-editor: Add --version support
Since it is easy now.
2024-12-10 21:18:44 -05:00
Matthias Clasen
761e92c664 widget-factory: Use g_application_set_version
A better version of --version.
2024-12-10 21:16:52 -05:00
Matthias Clasen
c8a9ea0228 node-editor: Use g_application_set_version
The easy way to add --version arguments.
2024-12-10 21:14:38 -05:00
Matthias Clasen
48940f976a gtk-demo: Use g_application_set_version
A small comfort measure that appeared in GLib 2.80.
2024-12-10 21:12:02 -05:00
Matthias Clasen
3a9c26a9ec demos: Quiet some deprecation warnings
The pixbuf animation api forces us to ues deprecated GLib api.
2024-12-10 19:03:11 -05:00
Sergey Bugaev
e633032786 demo: Fix a check
This way, some actual GTK logos show up.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2024-11-25 15:28:33 +03:00
Matthias Clasen
ed6f2a9693 Merge branch 'fix-demo-expander' into 'main'
demo: Fix "Expander" demonstration

See merge request GNOME/gtk!7887
2024-11-05 18:37:11 +00:00
Matthias Clasen
6a02caf216 Merge branch 'fix-demo-dnd' into 'main'
demo: Fix drag and drop demo critical

See merge request GNOME/gtk!7892
2024-11-05 18:32:43 +00:00
Florian "sp1rit"​
036364f4d4
demos: Add xmlns to appstream metainfo files
Pixiewood expects well-formed XML files, whose tags match the AppStream
namespace. Note that AppStream itself does not do this, so picking a
prefix for the namespace is fine for pixiewood but not AppStream.
2024-11-02 20:43:54 +01:00
Florian "sp1rit"​
4b619930f2
demo: Fix drag and drop demo critical
Right now, child is NULL when starting a drag in the main area and
moving the pointer onto the colors, there releasing it.
To avoid gtk_widget_get_ancestor thowing a critical, early exit if child
is NULL.
2024-11-02 19:25:01 +01:00
Florian "sp1rit"​
56f0735e2b
demo: Fix "Expander" demonstration
The expander window is not a dialog anymore, so attempting connecting to
its "response" is invalid and throws a critical:
  signal 'response' is invalid for instance '<PTR>' of type 'GtkWindow'
2024-10-31 08:59:49 +01:00
Alice Mikhaylenko
3274a286cc application: Set default window icon to appid by default
Lots of newer apps that use their appid as their icon name don't set
window icons, since they aren't used in GNOME. Instead of setting it
manually in every app, just default to it.

Only set the icon if it exists in the icon theme.

Remove manually set default icons in the demo.

No tests as GtkApplication doesn't have any in the first place.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/7120
2024-10-30 23:39:23 +04:00
Matthias Clasen
4bf6668906 demo: Use GtkInscription more
Port the columnview Unicode demo to GtkInscription.
2024-10-25 22:14:45 -04:00
Matthias Clasen
c09a51628b gtk4-demo: Call gtk_init in main
We end up using a display via gtk_application_set_accels_for_action,
and that can't happen before gtk_init anymore.
2024-10-21 21:17:00 -04:00
Benjamin Otte
a84cbe22d1 Merge branch 'wip/otte/win32-fixes' into 'main'
win32: Various fixes

See merge request GNOME/gtk!7848
2024-10-21 21:39:30 +00:00
Matthias Clasen
5366f83711 demos: Beef up about dialogs 2024-10-21 11:39:04 -04:00
Matthias Clasen
3ffc194e9c demos: Drop the icon-browser fully
This was forgotten in 32d03a548e.
2024-10-21 11:39:04 -04:00
Matthias Clasen
0170f8e261 Drop expandtab from vim modelines
This is already covered by our editorconfig.
2024-10-21 11:39:04 -04:00
Benjamin Otte
66e059ae52 build: Fix MSVC warning about function prototypes
We're using custom sorters and those want int as the return value,
not GtkOrdering.
2024-10-21 07:35:41 +02:00
Matthias Clasen
32d03a548e Drop some demos
The gtk4-icon-browser and gtk4-constraint-editor demos are basically
unmaintained, and not great showcases for GTK, so lets drop them.
2024-10-04 21:24:11 -04:00
Matthias Clasen
39374c7209 gtk4-demo: Make demos standalone
Making the demo windows transient and modal makes gnome-shell
treat them like dialogs, which is not right.
2024-10-02 19:15:31 -04:00
Matthias Clasen
64ecb972cf gtk4-demo: Add another scrolling case
Add a case for text with various underlines. In particular error
underlines, since these are more complicated and use repeat nodes
and offscreens.
2024-10-02 07:21:41 -04:00
Matthias Clasen
ded6d400d7 gtk-demo: Make scrolling benchmark resizable
The small window does not really tax our renderer much. Make it
resizable, so we can test fullscreen scrolling.
2024-10-02 07:20:36 -04:00
Matthias Clasen
d483883f38 node-editor: Use NGL for exporting images
This is a step towards dropping the GL renderer.
2024-09-30 18:58:33 -04:00
Matthias Clasen
0dc0bea1d5 gtk4-demo: Drop the glshader demos
The GL renderer will be going away in 4.18, and with that, shader
nodes will stop working for good. It is time to start preparing
for that.
2024-09-30 18:58:33 -04:00
Matthias Clasen
f20ca9067e gtk-demo: Stop using g_time_zone_new
It is deprecated in favor of g_time_zone_new_identifier.
2024-09-25 21:57:49 -04:00
Benjamin Otte
37cefde5b0 demo: Unmix argument names 2024-09-25 02:50:22 +02:00
Benjamin Otte
2f670bdc59 demo: Fix typo 2024-09-25 02:50:22 +02:00
Benjamin Otte
8d5660b4ab demo: Fix argument name 2024-09-25 02:50:22 +02:00
Benjamin Otte
820ba1ef13 demo: Correct argument name 2024-09-25 02:50:22 +02:00
Benjamin Otte
9507130dbc demo: Unmix argument names 2024-09-25 02:50:22 +02:00
Benjamin Otte
d2dede635b demo: include missing header 2024-09-25 02:50:22 +02:00
Matthias Clasen
171612671f demo: Beef up the image scaling demo
Add buttons for loading the Portland Rose, and a nameless large
png. Make them load the texture in a thread, to demonstrate better
handling of large images.
2024-09-06 16:14:24 -04:00
Matthias Clasen
a8e49cc21f gtk-demo: Cosmetics
Don't print out when the user just canceled the print dialog,
in the fill and stroke demo.
2024-09-01 10:33:27 -04:00
Fina Wilke
649782b547 a11y: Consistently use list type for errormessage relation
This more closely matches the spec. This is an API break, however the
atspi backend already assumed that this was a list, and would throw
criticals whenever this relation was set. Therefore it can be assumed
that this relation was not previously in active use.
2024-08-30 20:22:59 +00:00
Balló György
283c66251b demos: Set icon for the windows 2024-08-28 17:02:44 +02:00
Matthias Clasen
22860389de node-editor: Make Ctrl-Shift-V undoable 2024-08-18 21:45:25 -04:00
Matthias Clasen
cefaec5d6f node-editor: Add Ctrl-Shift-V
Make Ctrl-Shift-V trigger a 'paste-as-node' action which replaces
the current content with the render node in the clipboard.
2024-08-18 15:44:40 -04:00
Matthias Clasen
78935ec83c Make node-format.md part of the docs
This makes useful information more easily available, and it also
serves to validate the markdown.
2024-08-05 11:11:15 -04:00
Matthias Clasen
16431da3f2 nodeparser: Add support for cicp color states
Allow defining cicp color states with an @-rule:

    @cicp "jpeg" {
      primaries: 1;
      transfer: 13;
      matrix: 6;
      range: full;
    }

And allow using them in color() like this:

    color("jpeg" 50% 0.5 1 / 75%)

Note that custom color states use a string, unlike default color
states which use an ident.

Test included.
2024-08-05 11:11:15 -04:00
Simon McVittie
15a09c79f9 Fix debug format strings for non-LP64 platforms
Unfortunately the format string for a size_t, `%zu`, is not portable
to all Windows compilers, and the appropriate format string for the
fundamental type that implements size_t varies between platforms
(typically `%u` on 32-bit platforms, `%lu` on 64-bit Linux or
`%llu` on 64-bit Windows).

In gtk-demo, cast the number of search results to long, to avoid
breaking up a translatable string.

Elsewhere, use GLib's abstraction for this.

Signed-off-by: Simon McVittie <smcv@debian.org>
2024-07-27 18:14:31 +01:00
Benjamin Otte
32625381fa gsk: Deprecate GskGLShader and the rendernode
The new renderers don't support them due to the required complexity of
integrating them with Vulkan and the assumptions those nodes make about
the renderer (the GL renderer exports its internal APIs into the
GLShader).

There haven't been any complaints that I'm aware of since 4.14 was
released where the default renderer does not support the nodes, so usage
in public seems to be close to nonexistant.

The 2 uses I know of were workarounds about missing features in GTK that
have stopped since GTK now supports them:

1. GStreamer used in to do premultiplication when the old GL renderer
   did not do so in hardware but on the CPU.
2. Adwaita used it for masking before the mask node wa added in 4.10.
2024-07-04 21:28:06 +02:00
Benjamin Otte
3be7ef17ff node-editor: Make this app non-unique
There's no benefit in having multiple windows share the process.

But there's a huge disadvantage because running the app a 2nd time with
different environment variables will open a window in the first process
instead and discard the variables.

And my use of GSK_RENDERER hates that.
2024-06-21 19:53:46 +02:00
Georges Basile Stavracas Neto
f9929d15eb gtk-demo: Remove set-but-unused variable 2024-05-03 12:30:39 -03:00
Matthias Clasen
3b8218a99e gtk-demo: Name some idles
These show up in profiles, so give them a name.
2024-05-01 16:06:16 -04:00
Matthias Clasen
9904259661 gsk: Serialize hint metrics too
We need this to ensure that we properly roundtrip text nodes
without any changes.
2024-05-01 14:00:18 -04:00
Matthias Clasen
9df6f802f2 gtk-demo: Better accessibility for the sidebar
Add an accessible description saying how many search reasults
we have. This is an experiment.

Related: #6678
2024-04-30 11:54:56 -04:00
Benjamin Otte
02d7817632 demo: Use get_fps() in fishbowl demo
Hopefully that leads to somewhat more reliable fps measurements
2024-04-09 17:39:36 +02:00
Matthias Clasen
f51c82a2aa gtk-demo: Use offload for shadertoy
This is an easy way to verify that GtkGLArea delivers dmabufs
now, and it might have some practical uses to offload gl area.
2024-04-07 13:03:13 -04:00