Commit Graph

378 Commits

Author SHA1 Message Date
Matthias Clasen
820929958d file chooser: Stop using gtk_widget_get_action_group
We create this action group ourselves,
we can keep track of it.
2019-06-15 21:40:55 -04:00
Matthias Clasen
7f65e5f96b Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00:00
Matthias Clasen
7447abb52b Stop using gtk_widget_get_toplevel
All uses of it can be replaced by gtk_widget_get_root.
2019-05-28 20:25:16 +00:00
Matthias Clasen
948347afa9 Stop using gtk_widget_is_toplevel 2019-05-28 20:25:16 +00:00
Matthias Clasen
18788c2a86 Remove gtk_widget_get/set_has_surface
These serve no purpose anymore - widgets don't
have surfaces, unless they're a GtkNative.
2019-05-28 20:25:15 +00:00
Matthias Clasen
81548911de file chooser widget: Drop the priv pointer 2019-05-28 03:02:33 +00:00
Matthias Clasen
e795c0c67e file chooser widget: Make final 2019-05-28 02:41:15 +00:00
Timm Bäder
3a863ccd00 filechooserwidget: Remove unused gobject data 2019-05-18 13:47:59 +02:00
Timm Bäder
d53d7eb9e7 filechooserwidget: Remove some unused struct members 2019-05-15 17:08:58 +02:00
Emmanuele Bassi
59c6862a03 Use gtk_widget_class_set_layout_manager_type()
Instead of manually creating the layout manager inside the instance
initialization function, we can let GtkWidget do that for us.
2019-05-06 12:06:27 +01:00
Matthias Clasen
965d0e04d1 gtk: Use root/unroot instead of display-changed
The display-changed signal is going away
2019-05-02 01:33:41 +00:00
Timm Bäder
074a0014c1 filechooserwidget: Only query clock-format setting once
We don't support that setting life-updating anyway. So, instead of
getting the value *every time we format a time*, get it once for the
filechooserwidget and reuse that value.
2019-04-30 06:43:42 +02:00
Timm Bäder
175e3d751d filechooserwidget: Remove unnecessary deprecation guards 2019-04-30 05:36:20 +02:00
Timm Bäder
83e9361005 filechooserwidget: Stop using gtk_widget_get_allocat* 2019-04-30 05:36:20 +02:00
Timm Bäder
17bb1248b5 filechooserwidget: Shorten cancel_all_operations() impl 2019-04-30 05:36:20 +02:00
Timm Bäder
8211e79be9 filechooserwidget: Shorten dispose impl a bit 2019-04-30 05:36:20 +02:00
Timm Bäder
d5282862e5 filechooserwidget: Remove some unnecessary show() calls
Widgets are visible by default now.
2019-04-30 05:36:20 +02:00
Timm Bäder
26b6d18563 filechooserwidget: Use a bin layout
Instead of implementing size_allocate and measure manually.
2019-04-30 05:36:20 +02:00
Timm Bäder
31fb5cc2d4 filechooserwidget: Shorten finalize implementation a bit 2019-04-30 05:36:20 +02:00
Timm Bäder
90301c6813 filechooserwidget: Inline fuction into only caller 2019-04-30 05:36:20 +02:00
Timm Bäder
1d81a58cf1 filechooserwidget: Pick reasonable default sidebar width
The old default of 148px doesn't work everywhere. Instead, pick a
default value of -1 and measure() the sidebar widget in the
filechooserwidget in that case. Other values >= 0 are still handled as
before.
2019-04-30 05:36:20 +02:00
Timm Bäder
09cec2e6a1 filechooserwidget: Delay view switch to search hits
Leave it to the ::hits-added handler to switch to the list of search
hits. This way we don't get a weird transition when the current search
didn't have any hits and the next one doesn't either.
Searches with hits still feel good.
2019-04-30 05:36:20 +02:00
Matthias Clasen
92e21c3f1c Drop the can-default property
It was added at a time when default buttons
had a very large external border that would disrupt
aligment. Not a problem nowadays.
2019-04-28 23:28:39 +00:00
Matthias Clasen
3d1fdf77dc file chooser: Stop using gtk_window_activate_default
Instead, use the new way of activating default.

I think most of the default handling in
GtkFileChooserDialog should be dropped, but
for now this keeps things working.
2019-04-28 23:20:13 +00:00
Matthias Clasen
ff604e1906 file chooser: Stay focused
When hitting Escape in the location entry,
we were not moving the focus anywhere,
causing focus to be NULL, and key bindings
to stop working. The visible effect was
that Ctrl-L / Escape / Ctrl-L would not
get back to the location entry, as expected.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1851
2019-04-28 16:08:21 +00:00
Matthias Clasen
34974a8a66 Merge branch 'wip/baedert/filechooser2' into 'master'
Assorted filechooser improvements

See merge request GNOME/gtk!783
2019-04-28 15:33:07 +00:00
Matthias Clasen
b9467a4dc7 file chooser: Prevent accidental search
When hitting Escape, the file chooser will go
into search mode, because the search entry
consumes the key to emit the ::search-stopped
signal. Recognize this situation and avoid
switching to search mode in this case.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1850
2019-04-28 15:20:07 +00:00
Timm Bäder
b75bc8aa64 filechooserwidget: Allow keynav from the treeview to the search entry 2019-04-28 11:27:42 +02:00
Timm Bäder
78049f452a filechooserwidget: Remove unneeded function prototype 2019-04-28 11:08:09 +02:00
Timm Bäder
cf2ef4863b filechooserwidget: Don't focus treeview when searching
It's just weird that the search entry does not have focus while we type.
2019-04-28 11:07:14 +02:00
Timm Bäder
2bd348558e filechooserwidget: Remove some GdkEvent usage 2019-04-28 11:05:37 +02:00
Timm Bäder
0f6d83bb5f filechooserbutton: Remove some dead code 2019-04-28 11:02:59 +02:00
Matthias Clasen
eea1388cf4 file chooser: Fix Ctrl-L
We were forwarding key events to the search entry
and unconditionally considered search started
afterwards. That is not correct, since things
like a Ctrl key press should not trigger search.
Fix this by only switching to search mode when
the event was actually consumed.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1829
2019-04-27 17:43:59 +00:00
Matthias Clasen
285293ac17 file chooser: Fix some compiler warnings 2019-04-05 05:10:26 +00:00
Carlos Garnacho
e59c6abd91 filechooserwidget: Drop usage of gtk_search_entry_handle_event()
Just use gtk_event_controller_key_forward() to let know the search
entry of the Esc key being pressed.
2019-04-03 13:23:34 +02:00
Matthias Clasen
5b5a68c5db Fix filechooser search
This makes the search entry show up again
when I type. There is still some misbehavior
where the entry loses focus again, and Escape
does not work to exit search.
2019-03-31 23:06:42 -04:00
Matthias Clasen
2ed533c3e1 file chooser: Stop using gtk_window_get_position
It is going away.
2019-03-26 17:55:29 -04:00
Matthias Clasen
f13e6179e8 filechooser: Stop using ::set-focus
We can achieve the same with the focus-widget property.
2019-03-16 21:24:44 -04:00
Matthias Clasen
2bf1561b48 Port widgets to the root focus API 2019-03-16 21:24:44 -04:00
Timm Bäder
f35b8a7541 Fix compile time warnings 2019-03-02 05:28:55 +01:00
Matthias Clasen
9e0c471b03 entry, spin button: Drop redundant API
Avoid duplicating GtkEditable APIs. Port existing users.
2019-02-28 16:34:00 -05:00
Matthias Clasen
55337c588c file chooser: Stop using ::hierarchy-changed
Use the root and unroot vfuncs instead.
2019-02-23 09:43:57 -05:00
Matthias Clasen
08bd6904b9 file chooser: Use editable api on the search entry 2019-02-19 00:25:59 -05:00
Emmanuele Bassi
25fd230327 gtk: Drop the "plus"
Source names should use "[gtk]" without the plus.
2019-02-05 11:26:20 +01:00
Matthias Clasen
f3f5a896de box: Avoid position in the reorder api
Change the reorder api to insert after a sibling,
so that moving to first place becomes reorder (... NULL).

And add a insert_after api that can replace the common
container_add / reorder_after (... NULL) combination.

Update all callers.
2019-01-23 19:30:47 -05:00
Timm Bäder
bd71e744d2 Stop using gtk_box_pack_end
It might soon go away!
2019-01-23 19:30:46 -05:00
Timm Bäder
fae6113ce3 filechooserwidget: Show spinner when searching
This was lost it seems
2019-01-18 19:43:49 +01:00
Timm Bäder
ade171a2ed widget: Don't pass a position to ->size_allocate
The values have been 0/0 for a long time now, so just drop the
GtkAllocation argument and replace it with width and height.
2018-11-13 16:28:54 +01:00
Matthias Clasen
b904fc6ee0 Add a missing cast
This fixes a warning introduced in the previous commit.
2018-08-29 19:55:58 -04:00
Matthias Clasen
3b8d206143 The file chooser is no box anymore
Don't treat it as one, it does not like it.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1297
2018-08-29 13:11:06 -04:00