Commit Graph

40498 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
202e889577 filesystemmodel: Use G_DECLARE_FINAL_TYPE()
Clean up boilerplate. It's a private object anyway.
2023-01-07 09:17:37 -05:00
Georges Basile Stavracas Neto
a8690c84ab filesystemmodel: Cosmetics
Adjust code style, and shuffle some functions around. Remove
unhelpful doc comments.
2023-01-07 09:17:15 -05:00
Matthias Clasen
35244f4b59 filesystemmodel: Use g_set_object 2023-01-07 09:12:44 -05:00
Georges Basile Stavracas Neto
503c3ec04d filesystemmodel: Make function private to gtkfilesystemmodel.c
The _gtk_file_system_model_update_file() function is not used outside
GtkFileSystemModel, so no need to expose it in the header.

Shuffle it around in code, and remove it from the header.
2023-01-07 08:44:40 -05:00
Georges Basile Stavracas Neto
4a5a466975 filesystemmodel: Cleanup unused defines
They were made unused with the removal of GtkTreeModel interface
implementation.
2023-01-07 08:44:34 -05:00
Corey Berla
735cf301a4 calendar: Set marked days immediately
The marked days are set only as part of gtk_calendar_select_day().
This is insufficient, especially because the day-selected signal
is emitted after the marked days are set in gtk_calendar_select_day().
2023-01-06 20:37:54 -08:00
Corey Berla
e8a29f90d1 calendar: Only apply the marked_day to the current month
The marked day gets applied to the current month, and either the previous
or subsequent month if they are visible within the current month.
This doesn't make any sense and likely was an accidental regression
in a6f9052cf1.  Clarify the docs.
2023-01-06 20:21:35 -08:00
Corey Berla
182cc74834 calendar: Add css style for marked days
As part of a6f9052cf1, marked days lost
their style, essentially making that function worthless.  Previously,
they were simply bolded, but that doesn't give them proper justice.
2023-01-06 20:21:35 -08:00
Matthias Clasen
7801dd8944 Merge branch 'wip/phako/fix-activate-action-annotation' into 'main'
widget: Mark format as nullable in activate_action

See merge request GNOME/gtk!4653
2023-01-07 01:06:00 +00:00
Matthias Clasen
38e090f5c1 Merge branch 'main' into 'main'
Fix a typo

See merge request GNOME/gtk!5170
2023-01-07 00:59:32 +00:00
Matthias Clasen
120396fa40 wip: Split off GdkWaylandPopup
Like the GdkWaylandToplevel split-off, this needs some
more cleanup.
2023-01-06 16:50:19 -05:00
Matthias Clasen
d61ec38974 wip: Split off GdkWaylandToplevel
This still needs some more cleanup.
2023-01-06 16:50:19 -05:00
Matthias Clasen
68700f8722 Merge branch 'drop-file-dialog-shortcuts' into 'main'
filedialog: Drop shortcut folders

See merge request GNOME/gtk!5396
2023-01-06 13:35:14 +00:00
Matthias Clasen
f76270167c Merge branch 'wip/otte/for-5496' into 'main'
filedialog: Never set the chooser's file

Closes #5496

See merge request GNOME/gtk!5393
2023-01-06 13:34:55 +00:00
Matthias Clasen
2a442c4fbb Merge branch 'macos-command-symbol' into 'main'
macos: Use Command key symbol in Keyboard shortcuts window

See merge request GNOME/gtk!5296
2023-01-06 13:17:36 +00:00
Matthias Clasen
9356dfc404 filedialog: Drop shortcut folders
The filechooser portal does not support this,
and we are defaulting to using the portal now.
Lets not offer a non-functional API.
2023-01-06 07:40:57 -05:00
Arjan Molenaar
c52978dfa4
macos: Command should not come from gettext
Instead, just provide the right character.

See also
https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkaccelgroup.c#L916.
2023-01-06 12:08:55 +01:00
Matthias Clasen
52dfa54301 Merge branch 'test-file-dialog' into 'main'
Test file dialog

See merge request GNOME/gtk!5394
2023-01-06 04:28:28 +00:00
Matthias Clasen
8780aa02d7 filedialog: Cosmetics 2023-01-05 23:06:31 -05:00
Benjamin Otte
8d5a39d765 Merge branch 'wip/corey/dnd-use-cursor' into 'main'
Fix accidental DnD

See merge request GNOME/gtk!5275
2023-01-05 22:39:26 +00:00
Benjamin Otte
446e6a8d62 filedialog: Never set the chooser's file
Instead, get by with setting the name and hope the filechooser figures
things out by itself.

Fixes #5496
2023-01-05 21:30:15 +01:00
Matthias Clasen
9b1bee99b8 Merge branch 'openuri-activation-token' into 'main'
Pass an activation token to OpenURI

See merge request GNOME/gtk!5389
2023-01-05 14:06:14 +00:00
Matthias Clasen
fc1f1366b4 filechooser: Don't assert for possible cases
switch_to_selected_folder can be called when the
selection contains more than one item. Handle it
like it used to be handled: switch to the first
folder we find.

Fixes: #5494
2023-01-05 08:41:33 -05:00
Matthias Clasen
6efd1a9dad Pass an activation token to OpenURI
The OpenURI portal can take an activation_token
nowadays. So it give one.
2023-01-04 16:39:24 -05:00
Matthias Clasen
918ff1d0f4 Deprecate gtk_toggle_button_toggled
The function is documented as useless.
2023-01-04 07:32:51 -05:00
Carlos Garnacho
4041ca0f69 gdkdisplay: Deprecate gdk_display_notify_startup_complete()
We have various layers where we store the startup ID for a request,
since this API does not have a GdkToplevel that we can refer about
for the Wayland platform, this is the most obvious candidate to
start untangling these various layers.

Deprecate this call, it is already unused in the gtk/ side.
2023-01-03 14:58:33 +01:00
Carlos Garnacho
3526d8b299 gtkapplication: Do not call gdk_display_notify_startup_complete()
This should do nothing worthwhile anymore, the X11/Wayland GtkApplication
implementations do already pass the startup ID from the platform_data
via windowing specific APIs, and the application handling the request
via show()/present() should trigger the activation request.
2023-01-03 14:58:33 +01:00
Carlos Garnacho
e8adfa2a88 gtkwindow: Shuffle gdk_toplevel_set_startup_id() calls
While this used to be tangential to windows showing or requesting
focus, the xdg-activation Wayland protocol does merge both concepts
together.

But also, for a correct interaction with the compositor, the
toolkit should ideally merge the activation request resulting from
both into the same one, so that the gdk_toplevel_focus() request
replies to the startup token that started the application and
correct focus-stealing prevention/etc happens, instead making up
one just in time for the focus request.

This kind of requires doing things in the right order, a show()
request on the GtkWindow should activate any pending activation
token on the toplevel, a present() request should additionally
create a new token if there was none pending. And
xdg_activation_v1_activate() should happen once on both.

Shuffle the gdk_toplevel_set_startup_id() calls so that this
happens in the right order for Wayland, while making X11 happy
too.
2023-01-03 14:58:33 +01:00
Carlos Garnacho
6f01f846dc gtkwindow: Minor refactor
Move the handling of the startup ID to a separate function, since
this will be called from several places.
2023-01-03 14:57:44 +01:00
Matthias Clasen
53813f24f0 Merge branch 'matthiasc/for-main' into 'main'
ci: Enable introspection for the docs build

See merge request GNOME/gtk!5383
2023-01-02 21:53:58 +00:00
Matthias Clasen
1fde83f12b Merge branch 'direction-from-language' into 'main'
Determine direction from language

See merge request GNOME/gtk!5385
2023-01-02 21:50:54 +00:00
Matthias Clasen
1f7783224b Determine direction from language
We can determine the direction to return here
without relying on translations, by using pango
and HarfBuzz apis to go
language -> script -> direction.
2023-01-02 16:30:27 -05:00
Matthias Clasen
0d04ceda76 Merge branch 'ccook/doc-changes-2' into 'main'
Various documentation suggests across a few domains.

See merge request GNOME/gtk!5384
2023-01-02 20:40:54 +00:00
Cam Cook
9396ccf9ff Various documentation suggests across a few domains.
| domain | current | suggestion |
|--------|---------|------------|
| [GtkSeparator](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkseparator.c#L39)    | "`![An example GtkSeparator](separators.png)`" | "`![An example GtkSeparator](separator.png)`" [1] |
| [GtkTextBuffer](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L4885)  | "if there is an redoable action" | "if there is a redoable action" |
| [GtkTextBuffer/get_enable_undo](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L5005) | (Renders `No description available.`) | "Returns: %TRUE if undoing and redoing changes to the buffer is allowed." [3] |
| [GtkTextBuffer/get_max_undo_levels](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L5102) | (Renders `No description available.`)| "Returns: The max number of undo levels allowed (0 indicates unlimited)." |
| [GtkTextBuffer](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L3874) | "with gtk_text_buffer_add_selection_clipboard()." | "with [method@Gtk.TextBuffer.add_selection_clipboard]" |
| [GtkTextBuffer](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L3494) | "it will automatically toggled" | "it will automatically toggle" |

* [1] See : [separator.png](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/docs/reference/gtk/images/separator.png), [gtk4.toml.in](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/docs/reference/gtk/gtk4.toml.in#L218), [visual_index.md](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/docs/reference/gtk/visual_index.md?plain=1#L16)
* [2] Taken from `enable-undo` [property description](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L516)

* [GtkTextMark/gtk_text_mark_set_visible](https://docs.gtk.org/gtk4/method.TextMark.set_visible.html) is defined in [GtkTextMark's header](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextmark.h#L93), but implemented in [GtkTextBTree](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbtree.c#L3036).
  * Other than being kind of confusing, this causes `gtk_text_mark_set_visible()`'s doc to not render where it expects it to.
2023-01-02 13:47:55 -05:00
Matthias Clasen
85df554ec1 Fix compiler warnings 2023-01-02 11:18:54 -05:00
Matthias Clasen
e126110ae0 Merge branch 'wide-inspector' into 'main'
inspector: Avoid super-wide window

See merge request GNOME/gtk!5379
2022-12-31 20:07:45 +00:00
Matthias Clasen
40a2910262 inspector: Avoid super-wide window
Ellipsize values that can get long, to avoid
forcing an excessively wide window.
2022-12-31 12:30:40 -05:00
Marco Melorio
ec84077486 docs: Annotate GtkDialog deprecations 2022-12-30 15:37:11 +01:00
Corey Berla
7ad693f865 gtkcolumnviewcolumn: Only create cells when the column is visible
It's a big performance drag to create many cells (and their associated
widgets) for columns that may never be shown. Only create cells
is the column is visible, and subsequently create/remove cells
when in column_set_visible.
2022-12-29 11:11:40 -08:00
Corey Berla
4e694c1824 gtkdroptarget: Notify value property on local drag
The value property is only getting notified when it's unset
or when it's set from gdk_drop_real_value_async().  Make sure
to always notify :value when its changed
2022-12-27 08:11:53 -08:00
Matthias Clasen
5eb4a3af0d filedialog: Handle initial-folder being NULL
This showed up as test failure in ci.
2022-12-24 09:01:16 -05:00
Benjamin Otte
c4c747d2ad alertdialog: Rephrase docs for show() a bit
In particular, discuss what to do about cancellables.

Related: !5326
2022-12-24 07:56:57 -05:00
Benjamin Otte
671fad5f34 filedialog: Clarify interaction of :filters and :default-filter 2022-12-24 07:56:57 -05:00
Benjamin Otte
1b9c45b660 filedialog: Rename :current-filter to :default-filter
The last "current" removed from properties. None of these are current.
2022-12-24 07:56:57 -05:00
Benjamin Otte
e2f730c0bf filedialog: Add gtk_file_dialog_set_initial_file()
A shortcut for setting initial-folder and initial-name at the same time.

We can remove all arguments from the actual async calls this way.
2022-12-24 07:56:57 -05:00
Benjamin Otte
8a2d35b9fb filedialog: Add gtk_file_dialog_set_initial_name() 2022-12-24 07:56:57 -05:00
Benjamin Otte
26cec4a021 filedialog: Rename current-folder to initial-folder
It's not the current one - unlike in GtkFileChooser - because there are
no live updates. So we use a more descriptive name.
2022-12-24 07:56:57 -05:00
Benjamin Otte
8d8e83afa2 fontdialog: Handle Escape better
Closing the dialog by hitting Escape should
have the same effect as clicking the cancel
button. Make it so.
2022-12-24 07:56:57 -05:00
Benjamin Otte
381bb84f3d alertdialog: Bring the GError back
Make sure we have a GError, so that dismissing and cancelling can be
separated.
2022-12-24 07:56:57 -05:00
Benjamin Otte
977fedfdf1 dialog: GTK_DIALOG_ERROR_ABORTED => GTK_DIALOG_ERROR_CANCELLED
This is done via the GCancellable, so let's call it cancelling.
2022-12-24 07:56:57 -05:00
Benjamin Otte
8957302bd4 dialog: GTK_DIALOG_ERROR_CANCELLED => GTK_DIALOG_ERROR_DISMISSED
The term "cancelling" is used with GCancellable, a user clicking a close
button is not that.
User input is usually described as "dismissing", so we use that term.
2022-12-24 07:56:57 -05:00
Benjamin Otte
8a7f739f9f directorylist: Always add standard::name
glib can't figure out how to do that, so we need to do that ourselves.
2022-12-24 07:56:57 -05:00
Cam Cook
1cd44ec7b7 Make stylecheck happy 2022-12-23 11:21:18 -05:00
Cam Cook
424d56830a Merge remote-tracking branch 'upstream/main' into ccook/doc-changes-1 2022-12-23 11:02:18 -05:00
Cam Cook
7fc4d02851 Various spelling mistakes across a few domains that show up in documentation.
| domain | current | suggestion |
|--------|---------|------------|
| [GtkAspectFrame](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkaspectframe.c#L457)    | "requistion of the child" | "requisition of the child" |
| [GtkPaned](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkpaned.c#L2500)               | "(attributes org.gtk.Method.set_propery=wide-handle)" | "(attributes org.gtk.Method.set_property=wide-handle)"|
| [GtkPopover](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkpopover.c#L2484)           | "with gtk_popover_set_offset()." | "with [method@Gtk.Popover.set_offset()]." |
| [GtkPopoverMenu](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkpopovermenu.c#L859)    | "with gtk_popover_menu_add_child()" | "with [method@Gtk.PopoverMenu.add_child()]" |
| [GtkSelectionModel](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkselectionmodel.c#L316) | "the queired range" | "the queried range" |
| [GtkScrolledWindow](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkscrolledwindow.c#L76) | "automatically removed hen" | "automatically removed when"|
| [GtkSearchBar](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtksearchbar.c#L425)         | "Connects the \`GtkEditable widget" | "Connects the `GtkEditable` widget" |
2022-12-23 11:01:07 -05:00
Matthias Clasen
123eebb93d Merge branch 'tweak-gtkfilechooser-button-tooltips' into 'main'
GtkFileChooser: Tweak Grid View & List View button tooltips

See merge request GNOME/gtk!5345
2022-12-21 12:39:53 +00:00
Lukáš Tyrychtr
ffe333a21f Don't present GTK class names to assistive technologies even as a fallback
A screen reader user is not interested in GTK internals, for example,
he does not care whether a button is an image button or not,
and a screen reader will report the fact that it is a button anyway.
Same applies for GtkEntry widgets, for example.

This actually is sufficient to fix gnome-control-center#2244.
And, according to the discussion in #5145, it should be fine.
2022-12-21 11:35:46 +01:00
Matthias Clasen
257ca10eb1 Merge branch 'file-nullable' into 'main'
filelauncher: Make set_file argument nullable

See merge request GNOME/gtk!5357
2022-12-21 03:23:58 +00:00
Benjamin Otte
ae097d9674 Merge branch 'wip/antoniof/listbase-rubberband-better-fix' into 'main'
listbase: Cancel rubberband if not handling drag

See merge request GNOME/gtk!4831
2022-12-21 01:14:57 +00:00
Luca Bacci
cf91e09d75 Include hicolor index.theme as a resource
index.theme file copied from upstream xdg/default-icon-theme
repository at tag 0.17:

https://gitlab.freedesktop.org/xdg/default-icon-theme/-/tree/0.17

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5303
2022-12-20 16:30:00 +01:00
Luca Bacci
59df956f4f Revert "Merge branch 'include-hicolor-index-theme-as-resource' into 'main'"
This reverts merge request !5341
2022-12-20 13:23:51 +00:00
Matthias Clasen
09691ead4c Merge branch 'include-hicolor-index-theme-as-resource' into 'main'
Include hicolor index.theme as a resource

Closes #5303

See merge request GNOME/gtk!5341
2022-12-20 12:24:25 +00:00
Maximiliano Sandoval R
18a7f715c4
filelauncher: Make set_file argument nullable 2022-12-20 11:08:47 +01:00
Matthias Clasen
d758754f20 build: Lift gir and build_gir to toplevel
build_gir is used in multiple subdirectories,
so it is a bit nasty that it is defined in
one too.
2022-12-19 22:38:38 -05:00
Matthias Clasen
a920c0d2de Merge branch 'wip/gtk4-fix-delete-surrounding' into 'main'
gtkimcontextwayland: Convert byte based offset to char based offset in delete_surrounding_text

See merge request GNOME/gtk!5254
2022-12-20 02:40:14 +00:00
Alynx Zhou
ad83d616c4 gtkimcontextwayland: Convert byte based offset to char based offset in delete_surrounding_text
ClutterInputFocus/GtkIMContext uses char based offset for
delete_surrounding, however, text_input_v3 uses byte based offset for
it. Currently only GTK with mutter can work correctly via text_input_v3
because they both forget to convert between char based offset and byte
based offset.

This commit fixes it in GTK by converting byte based offset to char
based offset with the UTF-8 encoded surrounding text.

Fixes <https://gitlab.gnome.org/GNOME/gtk/-/issues/4566>.
2022-12-20 09:51:08 +08:00
António Fernandes
efbd228940 listbase: Cancel rubberband if not handling drag
If the drag events are claimed by another gesture (e.g. a GtkDragSource
in an item widget), list base still commits a rubberband selection, for
a rubberband which wasn't even visible yet. This is a problem for the
GNOME Files application which needs both rubberbanding and drag-n-drop.

My previous fix[0] was enough for the case where the event sequence is
claimed right before the first GtkDragGesture::drag-update emission,
but it's useless if the event is claimed later (e.g. after the drag
treashold), because a rubberband already exists by that time.

Therefore, the complete solution requres checking whether the event
sequence is no longer being handled by our gesture, and commit the
selection changes only if it is, but otherwise cleanup the rubberband.

This is what GtkFlowBox does already, so let's do the same here.

[0] commit dc4540fae9
2022-12-18 21:31:31 -10:00
Nirbheek Chauhan
cd77936265 meson: Fix find_program and subproject usage
Dummy dependencies are not required to execute a subproject
automatically for providing a program, nor do you need to explicitly
call subproject() to do that.

A `[provide]` section in the wrap file is enough.
2022-12-19 03:09:11 +05:30
sunflowerskater
6b71ccdb43 GtkFileChooser: Tweak Grid View & List View button tooltips
The tooltips from the Grid View & List View buttons are unnecessarily long and look different from the tooltips used in Nautilus.

This commit makes the tooltips to be consistent with Nautilus and, consequently, makes them shorter.
2022-12-17 18:21:10 -03:00
Christopher Davis
143229f829 gtkfiledialog: Allow devs to set custom accept labels
Accept labels can be used for additional context regarding
the purpose of a file. The old GtkFileChooser APIs allowed
developers to set it, but the initial FileDialog API was missing
this functionality.

This commit adds `gtk_file_dialog_set_accept_label ()` to
restore the missing functionality.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/5421
2022-12-16 10:16:52 -05:00
Luca Bacci
b563736b66 Include hicolor index.theme as a resource
index.theme file copied from upstream xdg/default-icon-theme
repository at tag 0.17:

https://gitlab.freedesktop.org/xdg/default-icon-theme/-/tree/0.17

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5303
2022-12-16 14:58:59 +01:00
Matthias Clasen
6cb5f20942 Silence a compiler warning 2022-12-16 00:12:44 -05:00
Matthias Clasen
2154460139 Merge branch 'no-portals' into 'main'
Add GDK_DEBUG=no-portals

Closes #5441

See merge request GNOME/gtk!5336
2022-12-15 16:27:33 +00:00
Matthias Clasen
ef17a44876 Merge branch 'deprecate-show-hide' into 'main'
Deprecate gtk_widget_show/hide

See merge request GNOME/gtk!5278
2022-12-15 14:53:48 +00:00
Matthias Clasen
8eace1c385 Merge branch 'check-button-radio-docs' into 'main'
gtkcheckbutton: Document how to keep track of changes for radio buttons

See merge request GNOME/gtk!5328
2022-12-15 00:25:08 +00:00
Benjamin Otte
1f001a8f6a Merge branch 'wip/corey/listbase-focus' into 'main'
listbase: Use set_focus_child properly

Closes #5433 and #5432

See merge request GNOME/gtk!5169
2022-12-14 19:06:57 +00:00
Pablo Correa Gómez
42ba97eb5c gtkcheckbutton: Document how to keep track of changes for radio buttons 2022-12-14 20:02:07 +01:00
Matthias Clasen
e5560c1535 Add GDK_DEBUG=no-portals
Fixes: #5441
2022-12-14 13:50:20 -05:00
Corey Berla
93e591fdf1 listbase: Use set_focus_child properly
The EventControllerFocus on the list item, updates the list base focus
tracker and scrolled to position any time the list item enters focus.
This works when interacting within a single window, but has unexpected
results when changing focus between multiple windows.

Instead of using the focus controller workaround, just make
gtk_list_base_update_focus_tracker the set_focus_child vfunc

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5433
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5432
2022-12-14 07:56:57 -10:00
Corey Berla
7081bfc614 listbase: Split scroll_to_item for reuse 2022-12-14 07:51:34 -10:00
Matthias Clasen
a471a8b57c Merge branch 'ebassi/gidocgen-update' into 'main'
ci: Update the gi-docgen dependencies

See merge request GNOME/gtk!5263
2022-12-14 16:24:48 +00:00
Georges Basile Stavracas Neto
b0f65ead84 Merge branch 'gbsneto/filechooser-grid-view' into 'main'
Add GtkGridView to the filechooser

Closes #233

See merge request GNOME/gtk!5163
2022-12-14 14:47:21 +00:00
Matthias Clasen
e3f805f169 Merge branch 'appdialog' into 'main'
Add GtkAppDialog

See merge request GNOME/gtk!5284
2022-12-14 13:24:20 +00:00
Matthias Clasen
c2c99a163a Merge branch 'stylanydev' into 'main'
Gtk.GestureStylus: implement `anydev` property

See merge request GNOME/gtk!4707
2022-12-13 19:34:12 +00:00
Matthias Clasen
eec8cf1309 Deprecate gtk_widget_show/hide
gtk_widget_set_visible does the same job.
2022-12-13 13:46:02 -05:00
Georges Basile Stavracas Neto
8cf9810240 pathbar: Reimplement using GtkBox
The path bar does a lot of manual management of buttons, mostly to
be able to show navigation arrows when there's not enough space to
show the full path.

Since the GTK4 migration, this is slightly broken in some cases, due
to the 'need_sliders' variable being always set to TRUE. Furthermore,
after the introduction of the Recent button as a special cased fake
root, the allocation of the buttons is generating warnings.

Reimplement the path bar as a GtkBox, inside a GtkScrolledWindow.
This mimics what Nautilus does, and allows us to make navigation more
predictable, and remove most of the complexity from GtkPathBar. It
also prevents it from generating allocation warnings.

The path bar itself now doesn't override GtkWidget.measure nor
GtkWidget.allocate; instead, it delegates layout to the GtkBinLayout
layout manager.

CSS is adjusted to account for the changed hierarchy of buttons.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto
f0a76f2ca8 filechooserwidget: Improve grid cell visuals
Use a GtkLabel instead of a GtkInscription to get filenames better
displayed within the available space.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto
358d9d72d1 filechooserwidget: Don't check operation mode for tooltip
There's no way this could ever have been correct. We always want to
show the tooltip, and it's basically always available.
2022-12-13 14:45:15 -03:00
Sam Hewitt
aabb8dce91 filechooser: Add hover styles to the gridview children 2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto
80736d782b filechooserwidget: Add toggle view button clone in search
It's positioned and looks exactly like the browse_toggle_view_button,
but due to the way things are organized, we cannot simply reuse that
button.

Add a clone of browse_toggle_view_button in the search entry page of
the toolbar stack. Make it toggle the same action as of the original
button, and bind the icon name and tooltip texts to it too.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto
1464289710 filechooserwidget: Show pathbar in recent mode
As per design direction, show the pathbar in recent mode.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto
72c676aecb pathbar: Special case recent button
Soon pathbar will be shown on the Recent mode, with a static
path pointing to, well, Recent, so special case it in the
GtkPathBar with a static icon.
2022-12-13 14:45:15 -03:00
Corey Berla
c717d10dda filechooserwidget: Hide ColumnView settings in GridView 2022-12-13 14:45:15 -03:00
Matthias Clasen
ee5324359d filechooser: Save and restore view type
With this, the filechooser comes up with the
same view (grid or list) that it had the last
time you used it.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto
10338a5237 filechooserwidget: Rename callback
It's shared between both column and grid views now.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto
1c5caf53b6 filechooserwidget: Implement 'keynav-failed' for grid view
It's exactly the same as of the column view. Since we're sharing
the callback now, rename it to browse_files_view_keynav_failed_cb.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto
0bb6377a3a filechooserwidget: Use correct view in various places
Most of the pointer comparisons against 'browse_files_column_view'
should actually be performed against the current view widget. As
it turns out, it weren't that many places after all.
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto
ce12ab8307 style: Improve filechooser grid view slightly 2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto
27613e3bc5 filechooserwidget: Add a grid view
Add a grid view outside of the widgetry tree. The grid view mimics
the column view using bindings, so we only need to manage the column
view.

Also add a button in the path bar section to toggle the view. This
is handled as a new 'toggle-view' action in the file chooser.

The way switching between views currently work is by setting either
the column or grid view as the child of the GtkScrolledWindow. This
has the benefit of unmapping the unused view, which is nice and can
avoid some tricky situations with thumbnails.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/233
2022-12-13 14:45:15 -03:00
Georges Basile Stavracas Neto
a9be0be32b filethumbnail: Add 'icon-size' property
This will be used by future commits so that we can reuse this widget
in the file chooser grid view.
2022-12-13 14:45:15 -03:00
Matthias Clasen
f94e9d26b5 gtk: Update all callers 2022-12-13 07:49:02 -05:00
Matthias Clasen
69cc4b42cf filelauncher: Add a file property 2022-12-13 07:48:35 -05:00
Matthias Clasen
631b0fa9fd Merge branch 'sunflowerskater-main-patch-64457' into 'main'
appchooser: Rename "application" to "app"

See merge request GNOME/gtk!5323
2022-12-12 16:48:56 +00:00
sunflowerskater
e319b14dc2 appchooserbutton: Rename "application" to "app"
This change is a part of an initiative to use the word "app" instead of "application" in the UI:

Teams/Design/initiatives#123
2022-12-11 19:20:12 -03:00
sunflowerskater
c96fefd7f5 appchooserwidget: Rename "application" to "app"
This change is a part of an initiative to use the word "app" instead of "application" in the UI:

https://gitlab.gnome.org/Teams/Design/initiatives/-/issues/123
2022-12-11 19:13:51 -03:00
sunflowerskater
b1a9afbdba appchooser: Rename "application" to "app"
This change is a part of an initiative to use the word "app" instead of "application" in the UI: https://gitlab.gnome.org/Teams/Design/initiatives/-/issues/123
2022-12-11 20:05:54 +00:00
Matthias Clasen
6bed0cfb5a Merge branch 'popover-present-docs' into 'main'
popover: Clarify docs

See merge request GNOME/gtk!5318
2022-12-11 04:03:10 +00:00
Matthias Clasen
973a8752ab Merge branch 'ebassi/image-dispose' into 'main'
Do not change the notification queue inside finalization

Closes #5420

See merge request GNOME/gtk!5321
2022-12-11 04:02:49 +00:00
Emmanuele Bassi
b3b5a5064e Do not change the notification queue inside finalization
Notifications are not going to be emitted during the finalization, and
GObject will warn if you try to acquire and release a reference to the
notification queue when the reference count of an object has reached
zero.

Fixes: #5420
2022-12-11 00:36:03 +00:00
Matthias Clasen
5c70f2ae9b builderscope: Add a note for implementors
Recommend that scope implementations should fall
back to or derive from GtkBuilderCScope in order
to not lose GTK's type-guessing machinery.

Related: #5398
2022-12-10 17:12:02 -05:00
Matthias Clasen
5df9f4016e popover: Clarify docs
gtk_popover_present() is a misleadingly named
function, so at least give it clear docs that
tell people to use gtk_popover_popup() instead.
2022-12-10 16:36:00 -05:00
Matthias Clasen
00bdad23b0 Deprecate gtk_show_uri
This API has been superseded by GtkFileLauncher.
2022-12-09 13:36:28 -05:00
Matthias Clasen
8ff3217712 gtk: Stop using gtk_show_uri
Replace all uses of gtk_show_uri
with GtkFileLauncher.
2022-12-09 13:36:28 -05:00
Matthias Clasen
1d9ee050f4 Add GtkFileLauncher
This is a replacement for gtk_show_uri_full,
which can open a GFile in an application, or
open its containing folder in a file manager.
2022-12-09 13:25:02 -05:00
Matthias Clasen
40d54ad3eb window: Deprecate the ::keys-changed signal 2022-12-09 13:14:27 -05:00
Matthias Clasen
12f9883599 treeview: Drop a few unused variables
Compilers get pickier every year...
2022-12-09 13:12:47 -05:00
Matthias Clasen
4e23fe896e composetable: Drop an unused variable 2022-12-09 13:09:34 -05:00
Matthias Clasen
a07bf1a047 Merge branch 'dialog-fixes' into 'main'
filechooserwidget: Fixes

See merge request GNOME/gtk!5311
2022-12-09 16:22:00 +00:00
Matthias Clasen
42cd230d44 openuriportal: Better error handling
Nested async calls are always a challenge.

Hopefully, things are straightened out now,
and we report GTK_DIALOG_ERROR errors for
the cases we care about.
2022-12-09 11:05:48 -05:00
Matthias Clasen
bc8e19fcd0 openuriportal: Add a check function
Add private API to check whether the portal
is available.
2022-12-09 11:05:48 -05:00
Matthias Clasen
ae29fee903 openuriportal: Support OpenDirectory
This required an extra argument. Update all callers.
2022-12-09 11:05:48 -05:00
Matthias Clasen
7ad0bae12f openuriportal: Cosmetics
There were some copy-paste errors.
2022-12-09 11:05:48 -05:00
Matthias Clasen
3e11ea9ddf fontdialog: Improve docs
Be more specific about possible errors.
2022-12-09 11:05:48 -05:00
Matthias Clasen
5b6c98d589 colordialog: Improve the docs
Be more specific about possible errors.
2022-12-09 11:05:48 -05:00
Matthias Clasen
57082e2e40 fontdialog: Don't forget to propagate errors
Oops.
2022-12-09 11:05:48 -05:00
Matthias Clasen
45e3e1594f fontdialogbutton: Survive window closing
If the parent window of the button gets destroyed
while the dialog is open, we cancel the async op,
but we need to be a little more careful about not
stepping on glass.
2022-12-09 11:05:48 -05:00
Matthias Clasen
637ef84d04 colordialogbutton: Survive window closing
If the parent window of the button gets destroyed
while the dialog is open, we cancel the async op,
but we need to be a little more careful about not
stepping on glass.
2022-12-09 11:05:48 -05:00
Matthias Clasen
b297baed32 fontdialog: Unset check cancellable 2022-12-09 11:05:48 -05:00
Matthias Clasen
c45f172e79 colordialog: Unset check cancellable 2022-12-09 11:05:48 -05:00
Matthias Clasen
417382375b filedialog: Report cancellation propertly
Unless we prevent it, GTask will always report
cancellation as G_IO_ERROR_CANCELLED. But we
want GTK_DIALOG_ERROR_ABORTED for this case.
2022-12-09 11:05:48 -05:00
Matthias Clasen
2e90a752eb filechooserwidget: Fixes
Fix a memory leak in the file manager launch path.
2022-12-09 11:05:48 -05:00
Matthias Clasen
abe5181b10 Merge branch 'wip/corey/column-view-header' into 'main'
columnviewtitle: Prevent header clicks from propagating

Closes #5425

See merge request GNOME/gtk!5306
2022-12-09 15:28:58 +00:00
Matthias Clasen
de83d57e14 filedialog: Use title if set
This broken when the code was reshuffled into
the switch.

Fixes: #5415
2022-12-08 07:57:16 -05:00
Matthias Clasen
8c7b9c30de Merge branch 'ccook/spelling-changes' into 'main'
Various spelling mistakes across a few domains that show up in documentation.

See merge request GNOME/gtk!5292
2022-12-08 12:16:22 +00:00
Cam Cook
6bfb35f047 Various spelling mistakes across a few domains that show up in documentation. 2022-12-08 12:16:22 +00:00
Corey Berla
33e7774743 columnviewtitle: Prevent header clicks from propagating
The header in GtkColumnView has multiple event handlers
there is a ::pressed handler in GtkColumnView for
resizing the columns in CAPTURE as well as a motion
and drag controller.  The ::release handler is in
GtkColumnViewTitle.   We can't claim the event in the
existing handlers because then the ::release handler will
never get called.  Currently, however, all clicks get propagated
to the ColumnView from the header which can be problematic.
Since we don't usually want the clicks from the header
handled on the view, claim it in the BUBBLE phase.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5425
2022-12-07 10:25:09 -10:00
Guido Günther
89c816a614 emojichooser: Actually disable the recent section
The loop sets empty = FALSE when there are emojis but for that
to work we need to initialize the value to TRUE initially.

Fixes: 7928532bc5
2022-12-07 19:33:59 +01:00
Arjan Molenaar
19aaa8fee5 macos: Use Command key symbol for meta
Show the Apple Command symbol ⌘ as keyboard shortcut for the Meta key on macos,
similar to GtkAccelGroup.
2022-12-05 21:00:42 +01:00
Corey Berla
c541de3e05 list: Remove active state handling in listitemwidget and treeexpander
Active state is handled by main now.  It appears that listitem and
treeexpander handled it manually (probably before main did).  This
is unnecessary now, so let's remove it.
2022-11-30 10:48:14 -08:00
Corey Berla
fdfd76774e treeexpander: Scroll to expanded item
If the anchor is below the expanded item, the expanded item will
go out of view if there are sufficient children items.  This is not
ideal, so make sure to scroll to the item to ensure it remains in
view.
2022-11-30 09:43:20 -08:00
Corey Berla
7eac27e5ee listitemwidget: Add listitem.scroll-to action
This is the matching action for list.scroll-to-item
2022-11-30 09:43:20 -08:00
Corey Berla
847b3261fc treeexpander: Toggle expand on release instead of pressed
With the introduction of the hide-expander property, I noticed that
the active state would persist in many cases because the release
signal was never emitted.  In gtk3 tree expanders, expanded
on release.  gtk4 expanded on press to match window explorer.
Per irc chat, the designers didn't have a strong preference
for press or release.  In order to keep consistency and
fix this bug, let's move back to release.
2022-11-30 09:41:18 -08:00
Corey Berla
63a655e345 treeexpander: Fix typo and GestureClick type
"canceled" should be "cancelled".  Also, "cancel" is a signal on
GtkGesture.
2022-11-29 20:52:46 -08:00
Corey Berla
ff8d88b097 dragsource: Add a timeout before starting a drag
No one wants a drag that happens in less than 100ms (if so, it's
probably accidental).
2022-11-29 20:06:21 -08:00
Emmanuele Bassi
9bce5f0462 docs: Fix property cross-links in GtkTreeExpander 2022-11-29 13:49:35 +00:00
Matthias Clasen
36a4bb0341 Merge branch 'ccook/spelling-fixes' into 'main'
docfix: Various spelling errors that show up in docs

See merge request GNOME/gtk!5272
2022-11-29 08:57:48 +00:00
Matthias Clasen
d9f4bd5490 Merge branch 'wip/corey/at-spi-context' into 'main'
atspicontext: Cache empty atspi bus address

See merge request GNOME/gtk!5276
2022-11-29 07:51:23 +00:00
Matthias Clasen
23a3bf7a3c Merge branch 'show-hide-cleanup' into 'main'
gtk: Stop using gtk_widget_show/hide

See merge request GNOME/gtk!5273
2022-11-29 07:30:04 +00:00
Corey Berla
44e297488f atspicontext: Log more helpful warnings when the a11y bus doesn't exist 2022-11-28 17:02:18 -08:00
Corey Berla
8072d202e3 atspicontext: Cache empty atspi bus address
We are caching the bus address as data on the display object when it
exists, but fail to set the data when the bus address doesn't exist.
That causing excessive calls to GetAddress when the accesssbility
bus doesn't exist. Make sure to cache a non-existent accessibility
bus by setting the "" string.
2022-11-28 17:02:13 -08:00