Commit Graph

61892 Commits

Author SHA1 Message Date
Matthias Clasen
059917b83c gtk-demo: Fix the overlay demo
We must use two separate boxes for the label and
the entry, otherwise we can't keep their can-target
properties apart.
2020-03-28 00:08:12 -04:00
Matthias Clasen
163aa82d45 gtk-demo: Use mnemonics in menu buttons
Use GtkMenuButton:use-underline in the modelbutton demo.
2020-03-28 00:08:12 -04:00
Matthias Clasen
ba25e08e7b menubutton: Add a use-underline property
This is necessary since apps no longer have direct
access to the label.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2489
2020-03-28 00:08:12 -04:00
Matthias Clasen
bc2c341d60 gtk-demo: Visual fixes to the model button demo 2020-03-28 00:08:12 -04:00
Matthias Clasen
7e0266004e Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!1577
2020-03-27 21:10:19 +00:00
Matthias Clasen
93d54ba10b gtk-demo: Fix the search entry demo
Avoid critical warnings when setting up the context
menu actions.
2020-03-27 16:24:20 -04:00
Matthias Clasen
5d07a66d1d widget-factory: Fix the radio button example
We only want one of the sensitive buttons to be active,
so don't tell them all to be active.
2020-03-27 16:06:03 -04:00
Matthias Clasen
8997dc6f31 Merge branch 'rename-theme-resources' into 'master'
Rename GResources for standard GTK themes

See merge request GNOME/gtk!1576
2020-03-27 16:37:31 +00:00
Matthias Clasen
9f72f4225d Merge branch 'trigger-parser' into 'master'
Improve GtkShortcutTrigger parser

See merge request GNOME/gtk!1572
2020-03-27 15:45:08 +00:00
Emmanuele Bassi
f1003d6ae8 Rename GResources for standard GTK themes
After commit 2ab9be54fb we had to rename
the generated CSS files to be included into the GResource bundle; we
kept the URI stable to avoid too much churn, and allow backporting the
change to the 3.24 stable branch. This had the adverse effect of making
it harder to debug issues, as the on-disk file name does not match the
location in the GResource that will be used to print out warnings,
errors, and debugging messages.
2020-03-27 15:20:59 +00:00
Emmanuele Bassi
b1327167e2 Improve GtkShortcutTrigger parsing tests
Split off all possible cases into sub-tests, and add more thorough
checks on the invalid strings unit.
2020-03-27 14:56:05 +00:00
Emmanuele Bassi
6719d3044d Add parsing for GtkAlternativeTrigger
Alternative triggers are separate by a pipe character.
2020-03-27 14:35:00 +00:00
Emmanuele Bassi
c75fdda8dd tests: Add more cases for the trigger parser 2020-03-27 13:57:19 +00:00
Emmanuele Bassi
170e8bd605 Parse keyval name directly for mnemonic triggers
We don't need to parse the full accelerator format for mnemonic
triggers.
2020-03-27 13:57:19 +00:00
Emmanuele Bassi
96ccb25f97 Return a full reference when parsing triggers
We're not returning a full reference for GtkNeverTrigger, but we are
returning full references for mnemonic and keyval triggers; this means
we're either going to leak mnemonic and keyval triggers if we consider
this function a "transfer none" one, or we are going to trigger an
assertion failure when finalizing a never trigger, if we consider this
function a "transfer full" one.

Let's be consistent, and always return a full reference to the caller.
2020-03-27 13:57:19 +00:00
Timm Bäder
c3c06e60dc calendar: Only highlight one day as today
Fixes #2490
2020-03-27 09:50:30 +01:00
Timm Bäder
ecb8dda309 shortcutscontroller: Make add_shortcut transfer-full
Like all the other shortcut api
2020-03-27 08:36:32 +01:00
Timm Bäder
f7975828bc filechooserwidget: Plug a memory leak 2020-03-27 08:36:32 +01:00
Matthias Clasen
5fdb897f06 Merge branch 'widget-factory-theme' into 'master'
widget-factory: Add theme switch

See merge request GNOME/gtk!1573
2020-03-26 18:23:11 +00:00
Matthias Clasen
8ab2e31b58 widget-factory: Add theme switch
Add a submenu to test the builtin themes. This is mainly
for the benefit of the artists working on those themes.
2020-03-26 13:51:59 -04:00
Matthias Clasen
0d710b0353 Merge branch 'wip/jimmac/HC-redesign' into 'master'
HC: derive from Adwaita

Closes #1450

See merge request GNOME/gtk!1571
2020-03-26 17:24:42 +00:00
Jakub Steiner
06fe4f0205 Adwaita: make insensitive slightly less sensitive
- will expose itself even more in HC
2020-03-26 17:22:47 +01:00
Jakub Steiner
910dd7a20a HC: derive from Adwaita
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1450
2020-03-26 17:21:47 +01:00
Jakub Steiner
8d8990ccd7 Revert "Adwaita: make insensitive slightly less sensitive"
This reverts commit bf3ccaa1bf.
2020-03-26 17:19:19 +01:00
Jakub Steiner
bf3ccaa1bf Adwaita: make insensitive slightly less sensitive
- will expose itself even more in HC
2020-03-26 15:55:42 +01:00
Matthias Clasen
eaa20f5cdf Merge branch 'wip/matthiasc/shortcut-4' into 'master'
Shortcuts

See merge request GNOME/gtk!1569
2020-03-26 03:40:22 +00:00
Matthias Clasen
d07e22dc03 Some documentation fixes 2020-03-25 23:14:45 -04:00
Matthias Clasen
1ec2d1d9f1 shortcutmanager: Add some more docs 2020-03-25 23:14:45 -04:00
Matthias Clasen
f59cd392ba shortcuttrigger: Some documentation fixups 2020-03-25 23:14:45 -04:00
Matthias Clasen
6bacb0b0ae shortcutaction: Some documentation fixups 2020-03-25 23:14:45 -04:00
Matthias Clasen
530b571d89 shortcutcontroller: Expand the docs 2020-03-25 23:14:45 -04:00
Matthias Clasen
ce22ef18f9 docs: Update the overview input chapter
Update the wording around events to reflect current
usage, and add information about shortcuts and the
shortcut controller.
2020-03-25 23:14:45 -04:00
Matthias Clasen
591f6bd7a9 popovermenu: Show mnemonics on keynav
This is the expected behavior for menus.
2020-03-25 23:14:45 -04:00
Matthias Clasen
642503afb4 popover: Implement auto mnemonics
Unfortunately, this involves copying a bunch of
code from gtkwindow.c. The only difference here
is that we add a private method to turn this off,
which will be used by GtkPopoverMenu to implement
its own auto mnemonics.
2020-03-25 23:14:45 -04:00
Matthias Clasen
fc0b0b14a8 label: Respect GtkPopover::mnemonics-visible
When inside a popover, look to the popover for
whether to show mnemonics or not.
2020-03-25 23:14:45 -04:00
Matthias Clasen
2de4fc3ec0 popover: Add a mnemonics-visible property
This will be handled separately for popovers, so we
need our own property for it.
2020-03-25 23:14:45 -04:00
Matthias Clasen
b2ac42e576 label: Disconnect visible mnemonics in popovers
The controller handling mnemonics is limited to same-native,
so showing mnemonics in other natives.
2020-03-25 23:14:45 -04:00
Matthias Clasen
b19d4b9006 modelbutton: Install accels when inside a popover
When a model button in a popover displays a shortcut,
it is probably from the global shortcut controllers,
and will not work inside the popover, since that is
a different native. Install a shortcut using the same
trigger that just activates the model button. This
shortcut will end up in the managed shortcut controller
of the popover.
2020-03-25 23:14:45 -04:00
Matthias Clasen
2c28a0713d popovermenu: Make mnemonics work without Alt
This is expected menu behavior.
2020-03-25 23:14:45 -04:00
Matthias Clasen
b423f974db shortcutcontroller: Inject accels into the action muxer
This is the way model button pic up accels for their actions.
2020-03-25 23:14:45 -04:00
Matthias Clasen
4a430820bd popover: Implement GtkShortcutManager
This makes mnemonics work in popovers.
2020-03-25 23:14:45 -04:00
Matthias Clasen
5153cdc01d modelbutton: Make activatable
This is expected of button-like widgets, and is necessary
to make keynav in popover menus work as expected.
2020-03-25 23:14:45 -04:00
Matthias Clasen
1db5382c6d modelbutton: Remove accel poking
Stop manually poking GtkApplication for accels.
GtkApplication already feeds them into the action
muxer machinery, so that is where will get them.
2020-03-25 23:14:45 -04:00
Emmanuele Bassi
6e8c78714d Turn GtkShortcutAction into a GObject
Just like we did for GtkShortcutTrigger.

This allows language bindings to properly deal with all the actions.
2020-03-25 23:14:45 -04:00
Emmanuele Bassi
457b6657bb Turn GtkShortcutTrigger into an object
The lightweight inheritance mechanism used for GtkShortcutTrigger is not
going to be usable by bindings, because boxed types cannot have derived
types.

We could use GTypeInstance and derive everything from that, like
GParamSpec, but in the end shortcuts are not really a performance
critical paths, unlike CSS values or render nodes.
2020-03-25 23:14:45 -04:00
Emmanuele Bassi
1ddd8586dd Add definition macro for internal types
GTK defines various types that are meant to be derivable only within GTK
itself, and "final" from the perspective of consumers of the GTK API.
The existing macros defined by GObject, such as G_DECLARE_FINAL_TYPE and
G_DECLARE_DERIVABLE_TYPE, lack this functionality.

While we wait for GObject to get this kind of macro, we should define
our own.
2020-03-25 23:14:45 -04:00
Matthias Clasen
5ea45bf57d widget: Remove some leftover accel group plumbing
The ::can-activate-accel and ::accel-closures-changed signals
are not used anymore, remove them.
2020-03-25 23:14:45 -04:00
Matthias Clasen
4e978d6b7a shortcutcontroller: Only activate shortcuts of visible widgets
Our shortcuts are like mnemonics in this respect - they only
activate when the widget is viewable.
2020-03-25 23:14:45 -04:00
Matthias Clasen
b4722b43a1 Drop GtkKeyHash 2020-03-25 23:14:45 -04:00
Matthias Clasen
fd95cc56b1 window: Remove GtkKeyHash remnants
It is not used anymore.
2020-03-25 23:14:45 -04:00