Commit Graph

33783 Commits

Author SHA1 Message Date
Matthias Clasen
4fe5710456 textview: Remove unnecessary drag highlighting
GTK does this unconditionally anyway, now.
2020-01-08 18:48:22 -05:00
Matthias Clasen
ac5b4a6307 text: Remove unnecessary drag highlighting
GTK does this unconditionally anyway, now.
2020-01-08 18:48:22 -05:00
Matthias Clasen
5ce7bfbbd8 notebook: Receive tab dnd on the tabs
Don't make the whole notebook a drop target
for tab dnd, but just the tab bar. This will
help with drag highlighting, and it arguably
more correct anyway.
2020-01-08 18:48:22 -05:00
Matthias Clasen
7646d1b22c Adwaita: No drag highlight for placessidebar
It does its own custom thing.
2020-01-08 18:48:22 -05:00
Matthias Clasen
61db81ab8e Adwaita: No dnd highlight for iconviews
We only want to highlight the drop location
that is rendered with a separate css node now.
2020-01-08 18:48:22 -05:00
Matthias Clasen
24d7586163 iconview: Use a named subnode for dnd highlight
This is necessary because we want to style the
iconview itself and the item highlighting differently.
2020-01-08 18:48:22 -05:00
Matthias Clasen
b150625105 Adwaita: No dnd highlight for treeviews
We only want to highlight the drop location
that is rendered with a separate css node now.
2020-01-08 18:48:22 -05:00
Matthias Clasen
5787146238 treeview: Use a named subnode for dnd highlight
This is necessary because we want to style the
treeview itself and the row highlighting differently.
2020-01-08 18:48:22 -05:00
Matthias Clasen
8a72031e99 Adwaita: No drag highlight for stack switchers 2020-01-08 18:48:22 -05:00
Matthias Clasen
201a791076 Adwaita: No drag highlight for expanders
This is pretty ugly, because Adwaita has a very
generic drop-highlight implementaiton that we
need to overrule.
2020-01-08 18:48:22 -05:00
Matthias Clasen
359003670a dragdest: Rename ::armed to ::contains 2020-01-08 18:48:22 -05:00
Matthias Clasen
8a521accbc dragsource: Change the ::prepare return type
Make it return the content provider to use for
the next drag. This allows just-in-time provision
of the content provider. The default handler just
returns the value of the ::content property.
2020-01-08 18:48:22 -05:00
Matthias Clasen
a053d7ddb1 dragsource: Drop gtk_drag_source_drag_begin
No longer used. Also, minor cleanups all over.
2020-01-08 18:48:22 -05:00
Matthias Clasen
c878f650ce dragksource: Small doc fix 2020-01-08 18:48:22 -05:00
Matthias Clasen
2d2cdeae88 Drop GTK content formats apis
These functions have been superseded by better
facilities in GDK.
2020-01-08 18:48:22 -05:00
Matthias Clasen
379166e1ff text: Use GDK content formats API 2020-01-08 18:48:22 -05:00
Matthias Clasen
a59a20c1d4 placessidebar: Use GDK content formats api 2020-01-08 18:48:22 -05:00
Matthias Clasen
fb4b5c666b filechooserwidget: Use GDK content formats api: 2020-01-08 18:48:22 -05:00
Matthias Clasen
b59c70aaeb filechooserbutton: Use GDK content formats api 2020-01-08 18:48:22 -05:00
Matthias Clasen
6fcae42dde calendar: Use GDK content formats api 2020-01-08 18:48:22 -05:00
Matthias Clasen
a04d314910 text: Fix dragging of text across focus changes
When dragging selected text from an entry over a stackswitcher
to show a different page, the focus changes, causing the selection
to be lost; we should not lose the dragged content in this case.
2020-01-08 18:48:22 -05:00
Matthias Clasen
f83f7a2b4d Adwaita: Add drop highlight for iconview items 2020-01-08 18:48:22 -05:00
Matthias Clasen
edb175cf75 iconview: Render drop highlight properly
Use :drop(active) and render a frame, not focus.
2020-01-08 18:48:22 -05:00
Matthias Clasen
1eefaf8b41 dragsource: Fix cancellation
We need to properly end the drag.
2020-01-08 18:48:22 -05:00
Matthias Clasen
0224517806 filechooser: Stop using gtk_drag_source_get_drag 2020-01-08 18:48:22 -05:00
Matthias Clasen
27c521cce8 placessidebar: Update a comment 2020-01-08 18:48:22 -05:00
Matthias Clasen
62b87182c5 Remove an unused enum
We are not using GtkDragResult anymore.
2020-01-08 18:48:22 -05:00
Matthias Clasen
865fc9c925 dragsource: Rename ::drag-failed to ::drag-cancel
This matches the names of the GdkDrag signals.
2020-01-08 18:48:22 -05:00
Matthias Clasen
a1f4f52fcb dragsource: Tweak docs more 2020-01-08 18:48:22 -05:00
Matthias Clasen
bdb4bf00c5 dragsource: Document prepare 2020-01-08 18:48:22 -05:00
Matthias Clasen
aca252837d dragsource: Make ::prepare return a boolean
Make ::prepare return TRUE to start a drag.
The default handler simply checks that we
have a content provider and actions.
2020-01-08 18:48:22 -05:00
Matthias Clasen
8b058572f0 dragsource: Drop gtk_drag_get_source 2020-01-08 18:48:22 -05:00
Matthias Clasen
df050c51bb notebook: Stop using gtk_drag_get_source 2020-01-08 18:48:21 -05:00
Matthias Clasen
bd20ae4fa5 dragsource: Drop gtk_drag_source_get_origin 2020-01-08 18:48:21 -05:00
Matthias Clasen
818b456f9f filechooserwidget: Stop using gtk_drag_source_get_origin 2020-01-08 18:48:21 -05:00
Matthias Clasen
c1c8abf275 notebook: Stop using gtk_drag_source_get_origin 2020-01-08 18:48:21 -05:00
Matthias Clasen
134fca47e3 pathbar: Use gtk_widget_add_controller for drag source 2020-01-08 18:48:21 -05:00
Matthias Clasen
4630dd8d68 notebook: Use gtk_widget_add_controller for drag source 2020-01-08 18:48:21 -05:00
Matthias Clasen
d2f7d1b1d7 linkbutton: Use gtk_widget_add_controller for drag source 2020-01-08 18:48:21 -05:00
Matthias Clasen
cfa9e6da4a colorswatch: Use gtk_widget_add_controller for drag source 2020-01-08 18:48:21 -05:00
Matthias Clasen
ceca2f9202 colorbutton: Use gtk_widget_add_controller for drag source 2020-01-08 18:48:21 -05:00
Matthias Clasen
8e8254feae filechooserwidget: wip 2020-01-08 18:48:21 -05:00
Matthias Clasen
90cda9e307 treeview: Use gdk_drag_begin 2020-01-08 18:48:21 -05:00
Matthias Clasen
fdfa371d90 iconview: Use gdk_drag_begin
This is a little more involved here.
2020-01-08 18:48:21 -05:00
Matthias Clasen
deb16c1a00 Make GtkDragSource a gesture 2020-01-08 18:48:21 -05:00
Matthias Clasen
8c3736709e notebook: Use gdk_drag_begin
Use gdk_drag_begin for one-off drags.
2020-01-08 18:48:21 -05:00
Matthias Clasen
f459164f8a placessidebar: Use gdk_drag_begin
Use gdk_drag_begin for one-off drags.
2020-01-08 18:48:21 -05:00
Matthias Clasen
00169a06bf textview: Use gdk_drag_begin
Use gdk_drag_begin for one-off drags.
2020-01-08 18:48:21 -05:00
Matthias Clasen
e09f2b8b56 entry: Use gdk_drag_begin
Use gdk_drag_begin for one-off drags.
2020-01-08 18:48:21 -05:00
Matthias Clasen
092c115ff0 text: Use gdk_drag_begin
Use gdk_drag_begin directly for one-off drags.
2020-01-08 18:48:21 -05:00
Matthias Clasen
5144d15168 calendar: Use gdk_drag_begin
Use gdk_drag_begin directly for one-off drags.
2020-01-08 18:48:21 -05:00
Matthias Clasen
5a6ab8cbd3 label: Use gdk_drag_begin
Use gdk_drag_begin directly for one-off drags.
2020-01-08 18:48:21 -05:00
Matthias Clasen
8c73f882af dragsource: Use public drag icon api 2020-01-08 18:48:21 -05:00
Matthias Clasen
78832c65b5 Make GtkDragIcon public
This is needed if we want to use gdk_drag_begin
for one-off drags, without a GtkDragSource.
2020-01-08 18:48:21 -05:00
Matthias Clasen
e8b830a3dd dragsource: Reshuffle api a bit
Remove arguments from the constructor.

For actions, we now default to COPY, which is the most common one
that we should enable by default (MOVE requires handling deletion
on the the source side, and ASK only makes sense if we have
multiple actions).

For the content provider, we add a new ::prepare signal where
it should be provided just-in-time.
2020-01-08 18:48:21 -05:00
Matthias Clasen
38974d7d2b dragsource: Tweak api, update all callers
Add GdkDrag back to signals, drop ::drag-data-delete,
and replace it with a boolean in ::drag-end.
2020-01-08 18:48:21 -05:00
Carlos Garnacho
dbb3727b03 popover: Use g_signal_connect_object on parent widget signal
The popover may be destroyed, leaving this dangling signal. This
may cause crashes on future parent widget resizes.
2020-01-08 18:48:21 -05:00
Matthias Clasen
508570864d Remove gtk_drop_target_get_target
Now that drop targets are event controllers,
we can just use gtk_event_controller_get_widget.
Update all callers.
2020-01-08 18:48:21 -05:00
Matthias Clasen
96c77b61c1 Remove an unused signal 2020-01-08 18:48:21 -05:00
Matthias Clasen
2b819c830b docs: Tweak GtkDropTarget docs 2020-01-08 18:48:21 -05:00
Matthias Clasen
f3be49838f Move code over
Move remaining code from gtkdnd.c to gtkdragdest.c
and nuke gtkdnd.c and gtkdndprivate.h.
2020-01-08 18:48:21 -05:00
Matthias Clasen
e9067ae2db Replace gtk_drop_target_attach/detach
Since drop targets are now just event controller,
gtk_widget_add/remove_controller works just fine
for them.
2020-01-08 18:48:21 -05:00
Matthias Clasen
f898bee032 Use normal event propagation for DND events
This works just fine, now that drop targets are
event controllers. There is only a very vestigial
gtk_drag_dest_handle_event() left that deals with
corner cases.
2020-01-08 18:48:21 -05:00
Matthias Clasen
6a7f39e6d2 Get rid of GtkDragDestInfo
We can just attach the GtkDropTarget directly to
the GdkDrop.
2020-01-08 18:48:21 -05:00
Matthias Clasen
dfb2cbdfdb Turn GtkDropTarget into an event controller
We are still propagating the drag events manually,
but we are now calling gtk_widget_run_controllers
to pass them to drop targets.
2020-01-08 18:48:21 -05:00
Matthias Clasen
f960eb6ab4 More internal restructuring 2020-01-08 18:48:21 -05:00
Matthias Clasen
60fc2c6a7a dnd: Another internal refactoring step 2020-01-08 18:48:21 -05:00
Matthias Clasen
532fdde720 dnd: More internal restructuring 2020-01-08 18:48:21 -05:00
Matthias Clasen
f8399588e9 dnd: Some internal restructuring
Nudge the code towards being like event controllers.
2020-01-08 18:48:20 -05:00
Matthias Clasen
ad019be75b Drop an unused define 2020-01-08 18:48:20 -05:00
Matthias Clasen
e505dab487 Stop passing timestamps around
We were not using these in a useful way in the end,
so stop passing them around.
2020-01-08 18:48:20 -05:00
Matthias Clasen
1262184269 droptarget: Drop the track-motion property
It does not have any effect anymore.

Update all callers
2020-01-08 18:48:20 -05:00
Matthias Clasen
46f42fc53d droptarget: Drop defaults flags
These no longer have any effect.

Update all callers.
2020-01-08 18:48:20 -05:00
Matthias Clasen
cb26cd7391 Simplify some drag dest internals
Change things around to make the default handler
of GtkDropTarget::drag-motion implement the default
handling. Always emit ::drag-motion and ::drag-leave,
and always arm the drop target.

This makes the GTK_DEST_DEFAULT_MOTION flag and
the ::track-motion property unnecessary.

Drop targets that are purely after track-motion
handling for ui switching purposes, such as
GtkStackSwitcher, will have to undo the automatic
arming in a notify::armed handler.
2020-01-08 18:48:20 -05:00
Matthias Clasen
1a3eeb1233 Drop GTK_DEST_DEFAULT_HIGHLIGHT
Redo highlight handling slightly. GtkDropTarget now has
a ::armed property that can be tracked to do custom highlighting,
and we always add the dnd style class to armed drop sites.
2020-01-08 18:48:20 -05:00
Matthias Clasen
e1f74c8f69 dragdest: Clean up internals
Remove the no-longer needed GtkDragDest struct
and just attach the GtkDropTarget directly.
2020-01-08 18:48:20 -05:00
Matthias Clasen
1e000c3dac Remove gtkdnd.h 2020-01-08 18:48:20 -05:00
Matthias Clasen
19ee9b4c57 Remove gdk_drag_get_data
This is not used anymore, so we can remove it,
and the GtkDropTarget::drag-data-received signal
that it emits.
2020-01-08 18:48:20 -05:00
Matthias Clasen
1075607528 treeview: Stop using ::drag-data-received 2020-01-08 18:48:20 -05:00
Matthias Clasen
d2bd9b0850 iconview: Avoid drag-data-received 2020-01-08 18:48:20 -05:00
Matthias Clasen
b9034015d7 filechooser: Convert to GtkDropTarget 2020-01-08 18:48:20 -05:00
Matthias Clasen
c7b70b122a placessidebar: Port to GtkDropTarget 2020-01-08 18:48:20 -05:00
Matthias Clasen
6e01a49d10 iconview: Port to GtkDropTarget
A small api change here is that
gtk_icon_view_enable_model_drag_dest now returns
a GtkDropTarget that can be used to connect signals.
2020-01-08 18:48:20 -05:00
Matthias Clasen
c290bd6367 Add an async read function for selection
This is meant as a replacement for ::drag-data-received
in cases where a #GtkSelectionData object is still needed,
such as when using GtkTreeModel DND support.
2020-01-08 18:48:20 -05:00
Matthias Clasen
853063bea7 Remove old drag dest api 2020-01-08 18:48:20 -05:00
Matthias Clasen
69e3fee5e2 Move some remaining api over 2020-01-08 18:48:20 -05:00
Matthias Clasen
aa276a181e listbox: Remove unhighlighting
This will have to be done differently, if necessary.
2020-01-08 18:48:20 -05:00
Matthias Clasen
583705b4ae notebook: Convert to GtkDropTarget 2020-01-08 18:48:20 -05:00
Matthias Clasen
4ea18a22e6 treeview: Port to GtkDropTarget
A small api change here is that
gtk_tree_view_enable_model_drag_dest now returns
a GtkDropTarget that can be used to connect signals.
2020-01-08 18:48:20 -05:00
Matthias Clasen
746dc5c3a2 textview: Port to GtkDropTarget 2020-01-08 18:48:20 -05:00
Matthias Clasen
17131f1137 filechoserbutton: Convert to GtkDropTarget 2020-01-08 18:48:20 -05:00
Matthias Clasen
07c889c5ea stackswitcher: Port to GtkDropTarget 2020-01-08 18:48:20 -05:00
Matthias Clasen
b0d9a6ff20 expander: Port to GtkDropTarget 2020-01-08 18:48:20 -05:00
Matthias Clasen
802c7975e2 window: Port to GtkDragDest 2020-01-08 18:48:20 -05:00
Matthias Clasen
6e602e052b text: Port to GtkDropTarget 2020-01-08 18:48:20 -05:00
Matthias Clasen
025eee112c colorswatch: Port to GtkDropTarget 2020-01-08 18:48:20 -05:00
Matthias Clasen
70cdd4e951 colorbutton: Port to GtkDropTarget 2020-01-08 18:48:20 -05:00
Matthias Clasen
75b789f20f calendar: Port to GtkDropTarget 2020-01-08 18:48:20 -05:00
Matthias Clasen
45679d7bc3 dragdest: doc improvements 2020-01-08 18:48:20 -05:00
Matthias Clasen
6dc8fc3a4d Add a GtkDropTarget object
Add an explicit GtkDropTarget object, and move the destination-side
DND signals here. The object is used by connecting to its signals
and attaching it to a widget with gtk_drop_target_attach().
2020-01-08 18:48:20 -05:00
Matthias Clasen
37b849b808 Move the rest of the drag-source api over
Just reshuffling some source.
2020-01-08 18:48:20 -05:00
Matthias Clasen
9b01d9a784 Remove traditional drag source API
gtk_drag_source_set, gtk_drag_begin, related apis
and the GtkWidget source-side signals have all been
replaced by GtkDragSource.
2020-01-08 18:48:20 -05:00
Matthias Clasen
78a0913f0f notebook: Port to GtkDragSource 2020-01-08 18:48:19 -05:00
Matthias Clasen
74722fb10e filechooser: Port to GtkDragSource 2020-01-08 18:48:19 -05:00
Matthias Clasen
3891ce36fe treeview: Port to GtkDragSource
A small api change here is that
gtk_tree_view_enable_model_drag_source now returns
a GtkDragSource that can be used to connect signals.
2020-01-08 18:48:19 -05:00
Matthias Clasen
5a940408fe placessidebar: Port to GtkDragSource 2020-01-08 18:48:19 -05:00
Matthias Clasen
efce8c2899 iconview: Port to GtkDragSource
A small api change here is that
gtk_icon_view_enable_model_drag_source now returns
a GtkDragSource that can be used to connect signals.
2020-01-08 18:48:19 -05:00
Matthias Clasen
24ef9df0f1 pathbar: Convert to GtkDragSource 2020-01-08 18:48:19 -05:00
Matthias Clasen
5d49b11ffd colorswatch: Convert to GtkDragSource 2020-01-08 18:48:19 -05:00
Matthias Clasen
8e3db48482 colorbutton: Port to GtkDragSource 2020-01-08 18:48:19 -05:00
Matthias Clasen
b15c31a3f7 textview: Port to GtkDragSource 2020-01-08 18:48:19 -05:00
Matthias Clasen
a52757874e textbuffer: Add a content provider api
We need a content provider for the selection,
to implement DND, and the text buffer already
has one. Just add an api to get it.
2020-01-08 18:48:19 -05:00
Matthias Clasen
e9203eeef7 text: Convert to GtkDragSource 2020-01-08 18:48:19 -05:00
Matthias Clasen
337057eb35 entry: Port icon dnd to GtkDragSource
This requires a small change in the api,
since we need to provide a GdkContentProvider now.
2020-01-08 18:48:19 -05:00
Matthias Clasen
2803a15a51 calendar: Port to GtkDragSource 2020-01-08 18:48:19 -05:00
Matthias Clasen
d145032cb6 linkbutton: Port to GtkDragSource 2020-01-08 18:48:19 -05:00
Matthias Clasen
2612331282 label: Port to GtkDragSource 2020-01-08 18:48:19 -05:00
Matthias Clasen
d3fd071809 dnd: Patch up gtk_drag_get_source_widget
This is temporary until gtk_drag_dest_set users
have been ported over.
2020-01-08 18:48:19 -05:00
Matthias Clasen
303c9becf8 Add a GtkDragSource object
Add an explicit GtkDragSource object, and move the source-side
DND signals here. The object can be used on the spot, by calling
gtk_drag_source_drag_begin() yourself, or for static drag-source
configuration, by calling gtk_drag_source_attach(). In the latter
case, we set up and conect a drag gesture to trigger the drag_begin
call.
2020-01-08 18:48:19 -05:00
Matthias Clasen
6bf46c8f30 marshalers: Add another 2020-01-08 18:48:19 -05:00
Matthias Clasen
173952cbc8 fixed layout: Actually set child transforms
The code was unintentionally appending to the
existing child transform, leading to ever-moving
children when you call gtk_fixed_put.
2020-01-08 10:40:44 -05:00
Timm Bäder
8e4f0b9484 sizerequest: Remove _gtk_widget_get_preferred_size_and_baseline
Private and unused function.
2020-01-07 17:27:19 +01:00
Timm Bäder
a3f14a3395 rendernodepaintable: ceil() bounds for intrinsic size
Otherweise we floor() implicitly when casting to int, resulting in
slight scaling later.
2020-01-07 17:27:19 +01:00
Timm Bäder
73b8212bf3 label: Fix assumptions regaring link 2020-01-07 17:27:18 +01:00
Timm Bäder
726909d735 Window: Avoid some redundant assignments 2020-01-07 17:27:18 +01:00
Timm Bäder
04899e3707 colorswatch: Avoid redundant assignment 2020-01-07 17:27:18 +01:00
Timm Bäder
73ce437459 widget: Use cssnode api to get the filter value
it's confusing that we use GtkStyleContext here while we use the CssNode
directly elsewhere.
2020-01-07 17:27:18 +01:00
Timm Bäder
21a7dfae96 snapshot: Only normalize rectangle if we have to
We can even replace the comment this way.
2020-01-07 17:27:18 +01:00
Timm Bäder
6c188f7c93 bin: Move vfunc implementations before class_init
And avoid every single function prototype.
2020-01-07 17:27:18 +01:00
Timm Bäder
c30e0f78ad bin: Avoid some type checks 2020-01-07 17:27:18 +01:00
Timm Bäder
c38c5c4ce1 text: Reset cursor opacity when unmapping
Otherwise we might get mapped again with a half-transparent cursor.
2020-01-07 17:27:18 +01:00
Timm Bäder
108aac9ee3 scrolledwindow: Don't snapshot junction if we use indicators
The junction doesn't make sense when we use indicators, since the
scrollbars overlap anyway. Not snappshotting it anymore has no visual
effect since it's being drawn below the scrollbars anyway.
2020-01-07 17:27:18 +01:00
Timm Bäder
c427c2b22a cssimagelinear: Don't call get_start_end if !repeating
This makes it clear that the !repeating case is easier.
2020-01-07 17:27:18 +01:00
Timm Bäder
59111d100f cssimagelinear: Avoid computing the length if we know it
We handlet the common easy cases manually anyway, so don't bother
sqrt()ing the x/y coords in those cases.
2020-01-07 17:27:18 +01:00
Timm Bäder
cee8f78c6e toolitem: Remove unused members 2020-01-07 17:27:18 +01:00
Timm Bäder
0fc35b2124 toolitem: Plug memory leak 2020-01-07 17:27:18 +01:00
Timm Bäder
982d73df0b adwaita: Solve junction problem without border image
This genius piece of CSS colors only the top left (or top right in RTL)
pixel of the scrollbar junction.
Doing it this way is better because we don't have to upload a cairo node
every frame.
2020-01-07 17:27:17 +01:00
Timm Bäder
1e55e01692 scrolledwindow: Remove a useless local variable 2020-01-07 17:27:17 +01:00
Timm Bäder
412fcb0330 scrolledwindow: Avoid using gtk_widget_get_preferred_size
This way we only measure in the direction we need.
2020-01-07 17:27:17 +01:00
Timm Bäder
4fb519f04d renderborder: Only get border width if we really need to
We did this unconditionally before the if statement, but we don't need
to do it if any of the early-out checks in the not-border-image branch
hits.
2020-01-07 17:27:17 +01:00
Timm Bäder
4788f88840 snapshot: Repeat color nodes by creating a larger color node 2020-01-07 17:27:17 +01:00
Timm Bäder
d490d8f1f3 renderbackground: Try to omit a save/restore pair 2020-01-07 17:27:16 +01:00
Timm Bäder
cb2f523994 rendernodes: Use floats for everything 2020-01-07 17:27:16 +01:00
Timm Bäder
075a0ccb5e renderbackground: Save a snapshot_translate() call
Just add the values manually when really using the snapshot later. Also
unifies the two if branches by pulling out getting the x/y values.
2020-01-07 17:27:16 +01:00
Timm Bäder
6a9bc5daef Avoid a few state changes
We can't optimize the save/restore calls away in the snapshot code, so
do it from the caller side.
2020-01-07 17:27:16 +01:00
Timm Bäder
095a378dbc GdkRGBA: Use floats instead of doubles 2020-01-07 17:27:15 +01:00
Timm Bäder
0956c30ee5 progressbar: Remove unnecessary snapshot implementation 2020-01-07 17:27:15 +01:00
Matthias Clasen
448a402353 widget: Remove an unused signal
HIERARCHY_CHANGED is no longer used.
2020-01-06 08:19:01 -05:00
Matthias Clasen
df58d0acf3 Adwaita: Make dnd marks in text views green
We already do this in entries, this just updates
text views to match.
2020-01-03 13:00:53 -05:00
Matthias Clasen
9c2c5665df textview: Render visible marks better
The only other visible mark that is in common use
besides insert and selection_bound is dnd_mark, and
we don't want it to blink or be affected by 'cursor'
visibility.

Therefore, cache not just the cursor positions, but
also whether they are insert or selection_bound,
and take that into account when rendering them.
2020-01-03 13:00:53 -05:00
Matthias Clasen
1be9c6aa3f Merge branch 'remove-xim' into 'master'
Remove the XIM input method

See merge request GNOME/gtk!1195
2020-01-03 17:56:26 +00:00
Matthias Clasen
7a1aefc7f3 Fix the previous commit
We need to actually use the right coordinates.
2020-01-02 00:43:27 -05:00
Matthias Clasen
f7f06f810b stackswitcher: Fix switch-while-drag functionality 2020-01-02 00:24:54 -05:00
Matthias Clasen
e02fd80adb dnd: Be safer
The contents of the selection are documented
to not be NULL if size is non-negative. So
use an empty string instead of NULL for size 0,
avoiding a crash.
2020-01-01 12:51:19 -05:00
Matthias Clasen
f8a19506ab Merge branch 'drag-icon' into 'master'
Drag icon

See merge request GNOME/gtk!1274
2019-12-30 21:20:26 +00:00
Matthias Clasen
67d1d5ec80 mountoperation: Handle D-Bus missing
Still not great to make sync calls here, but
at least we should handle failure without criticals.
2019-12-30 16:03:47 -05:00
Matthias Clasen
772ac2b0c5 tooltip: Never set a window to be its own parent
We do get events on the tooltip window too, and
we better ignore them, or bad things may happen,
such as widgets that are their own parents and
cause infinite loops.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2339
2019-12-30 09:52:13 -05:00
Matthias Clasen
68b3b66c03 tooltipwindow: Cosmetic fix 2019-12-30 09:28:22 -05:00
Matthias Clasen
baf99bb868 Remove gtk_window_set_hardcoded_surface
It is not used anymore.
2019-12-30 00:31:32 -05:00
Matthias Clasen
538efd0cc6 container: Be more careful with roots
We were warning if we hit non-container
roots. Instead, call suitable naive api.
2019-12-30 00:30:01 -05:00
Matthias Clasen
9ba184adf7 widget: Be more careful with roots
We were assuming that all roots are windows,
and calling GtkWindow apis on them.
2019-12-30 00:29:52 -05:00
Matthias Clasen
710b8d7f40 dnd: Use GtkDragIcon
Use the new GtkDragIcon instead of a window
of type GTK_WINDOW_POPUP and
gtk_window_set_hardcoded_surface.
2019-12-30 00:29:10 -05:00
Matthias Clasen
a6244a95be Add GtkDragIcon
This is a GtkRoot implemntation for drag icons,
using the surface provided by GdkDrag. This lets
us avoid GTK_WINDOW_POPUP and
gtk_window_set_hardcoded_surface.
2019-12-30 00:28:02 -05:00
Matthias Clasen
133b6f2f23 tooltipwindow: Cosmetic fix 2019-12-29 22:48:25 -05:00
Matthias Clasen
f31a016efb tooltips: Stop using GTK_WINDOW_POPUP
Make GtkTooltipWindow a GtkNative implementation,
instead of using a GTK_WINDOW_POPUP window.
2019-12-29 22:09:13 -05:00
Matthias Clasen
de694958b5 Drop custom tooltip windows
We want to put tooltips into something other than
windows, so this needs to go. Custom widgets are
still possible.
2019-12-29 20:52:08 -05:00
Matthias Clasen
52e0eef6cb docs: Touch up menu button docs 2019-12-29 20:31:58 -05:00
Matthias Clasen
b06331218d docs: Rewrite popover menu docs
These were outdated and did not reflect current api.
2019-12-29 20:31:58 -05:00
Matthias Clasen
9b165c8bec treeview: Use a popover for search
This is a more modern way of doing things, and avoids a window
of type GTK_WINDOW_POPUP. With a popover, it doesn't make sense
to have a positioning function, so remove that api.
2019-12-29 20:31:58 -05:00
Matthias Clasen
3fd427cfce win32: Use a regular window for printing
We never show this window, so it should not matter.
Ideally, we'd just create a surface to get handle,
anyway.
2019-12-29 20:31:58 -05:00
Matthias Clasen
3dd6cc405e accelcellrenderer: Stop grabbing
Standalone grabs are going away.
2019-12-29 20:31:58 -05:00
Matthias Clasen
06860bb2be accelcellrenderer: Fix editing 2019-12-29 20:31:58 -05:00
Matthias Clasen
7ee5779efc gtk: Remove menu code
GtkMenu, GtkMenuBar, GtkMenuItem and their subclasses
and supporting classes are replaced by model-based popover
implementations.
2019-12-29 20:31:58 -05:00
Matthias Clasen
a2aefa83bb accellabel: Don't mention GtkMenuItem in the docs 2019-12-29 20:31:58 -05:00
Matthias Clasen
0854140b22 label: Stop referring to GtkMenuItem in the docs 2019-12-29 20:31:58 -05:00
Matthias Clasen
57a861723c buildertool: Drop menu properties 2019-12-29 20:31:58 -05:00
Matthias Clasen
b59521bb82 inspector: Remove menu special-casing 2019-12-29 20:31:58 -05:00
Matthias Clasen
7e8393ba0f widget: Remove menu special-casing 2019-12-29 20:31:58 -05:00
Matthias Clasen
9e15f3df75 label: Remove menu support code 2019-12-29 20:31:58 -05:00
Matthias Clasen
27543120f2 menubutton: Stop supporting menus 2019-12-29 20:31:57 -05:00
Matthias Clasen
901518ec25 headerbar: Stop using GtkMenuButton::use-popover
This property is going away.
2019-12-29 20:31:57 -05:00
Matthias Clasen
4c9b0d82af menutoolbutton: Stop supporting menus 2019-12-29 20:31:57 -05:00
Matthias Clasen
2c5f4c5871 menutoolbutton: Fix sensitivity handling
We don't need to set the arrow button explicitly
to insensitive, GtkMenuButton handles that automatically.
2019-12-29 20:31:57 -05:00
Matthias Clasen
8ee44d200d toolbar: Simplify overflow implementation
Do away with the proxy menu items, and instead
just have toolitems provide a label for overflow
items. We create the overflow widgets ourselves
already, as model buttons.
Also replace the toggle button used for overflow
with a menubutton, simplifying things further.
2019-12-29 20:31:57 -05:00
Matthias Clasen
e424246134 combobox: Replace GtkTreeMenu with a popover
This does not currently try to reproduce the exact
placement, since GtkPopover doesn't have to have
the necessary placement hints.
2019-12-29 18:45:40 -05:00
Matthias Clasen
5d821425b3 accellabel: Remove an example using menus 2019-12-29 18:45:40 -05:00
Matthias Clasen
3d4acf6360 window: Move F10 handling to popover menubars 2019-12-29 18:44:26 -05:00
Matthias Clasen
0cf1e1e106 applicationwindow: Stop using a menu bar
We have a replacement with popovers now.
2019-12-29 17:10:16 -05:00
Matthias Clasen
b23fbe1f39 notebook: Remove menu remnants 2019-12-29 17:10:16 -05:00
Matthias Clasen
f5e79b9bc5 appchooserwidget: Remove ::populate-popup
We are no longer doing menus this way; if a menu turns out to be
needed at all here, we can add a menu model later.
2019-12-29 17:10:16 -05:00
Matthias Clasen
94e238c467 placesview: Use a popover
Replace the context menu with a popover.
2019-12-29 17:10:16 -05:00
Matthias Clasen
22f6787283 mountoperation: Use a popover
Replace the context menu with a popover.
2019-12-29 17:10:16 -05:00
Matthias Clasen
6255dcd8ec filechooserbutton: Be smarter about 'None'
Don't refilter the model while the combo box is popped up,
that wreaks havoc with layout and does not really work.
Instead, repurpose one of the separator rows for the 'none'
case. This works because the row separator function is not
consulted for the cellview in the button.
2019-12-29 17:10:16 -05:00
Matthias Clasen
6f80eee962 window: Complete the popover conversion 2019-12-29 17:10:16 -05:00
Matthias Clasen
fd0f01bcad popovermenubar: Cosmetics 2019-12-29 17:10:16 -05:00
Matthias Clasen
0b6e521dc5 popovermenu: Use a weak ref for active item
Otherwise, we can end up with a dangling pointer,
leading to badness.
2019-12-29 17:10:15 -05:00
Matthias Clasen
a73947e54f Remove more mir remnants
The mir backend was removed a while ago, so
GDK_WINDOWING_MIR is never defined.
2019-12-28 21:52:34 -05:00
Matthias Clasen
7525271de1 tooltip: Remove some unneeded includes 2019-12-28 21:49:09 -05:00
Matthias Clasen
0bc65f0bde popover: Remove some dead code 2019-12-28 21:46:39 -05:00
Matthias Clasen
9543a5daeb popovermenu: Fix keynav with submenus
When we right-arrow all the way into a submenu
and then cycle to the next menu in a menubar,
we need to reset all open submenus, so that
left-arrowing back to the menu puts the focus
on the first item again.
2019-12-27 22:54:11 -05:00
Matthias Clasen
28b91a4450 modelbutton: Be focusable
This got lost when modelbuttons stopped being
derived from buttons. It is necessary, since
the GTK focus machinery takes this flag seriously
nowadays, and won't let us grab focus to non-focusable
widgets.
2019-12-27 21:58:54 -05:00
Matthias Clasen
6b89d8a199 inspector: Add a focus overlay
It helps to see what is going on.
2019-12-27 17:35:09 -05:00
Matthias Clasen
08d4bb4785 widget: Fix a memory leak
The transform passed to gtk_widget_allocate is
transfer full, so we must consume the reference
before returning.
2019-12-25 09:47:22 -05:00
Matthias Clasen
a02e25ffff widget: Avoid a crash in event handling
I was seeing crashes in gtk_widget_run_controllers.
We were accessing the controller after calling out
to application code that might remove it. Better
be safe and do the access before.
2019-12-25 09:47:22 -05:00
Matthias Clasen
280bdb0567 inspector: Fix a small memory leak
We were leaking overlays.
2019-12-25 09:47:22 -05:00
Matthias Clasen
1a94e5fb0e inspector: Fix a small memory leak
The property editor was leaking a few GValues.
2019-12-25 09:47:22 -05:00
Matthias Clasen
b6cfe59460 inspector: Small cleanup 2019-12-25 09:47:22 -05:00
Matthias Clasen
7db2abf918 widget: Fix a small memory leak 2019-12-25 09:47:22 -05:00
Matthias Clasen
b398af914f eventcontroller: Fix name property
This never worked. Oops.
2019-12-25 09:47:22 -05:00
Matthias Clasen
77c57b4b14 Adwaita: update the README 2019-12-24 12:30:54 -05:00
Matthias Clasen
10d260ec71 HighContrast: print dialog fixes
Fix up the paper drawing.
2019-12-24 12:30:44 -05:00
Matthias Clasen
1ac8bb0128 Adwaita: print dialog tweaks
Fix up the paper drawing.
2019-12-24 12:30:35 -05:00
Matthias Clasen
28539ba838 print dialog: Fix up page drawing
This fixes up page drawing enough to appear properly
with the builtin themes.
2019-12-24 12:30:28 -05:00
Matthias Clasen
87502b4f2e Fix the build 2019-12-24 09:58:56 -05:00
Matthias Clasen
3644d3a100 Merge branch 'gtk-demo-fixes' into 'master'
Gtk demo fixes

See merge request GNOME/gtk!1266
2019-12-24 08:47:28 +00:00
Matthias Clasen
9e3147f78d treeview: Fix embedding cell renderers
We need to manually set up the css node,
since the treeview has children whose css
node is not a direct child of the treeview
css node (header buttons).
2019-12-24 03:39:02 -05:00
Matthias Clasen
cc3ecac6d8 cell renderer spin: Bring this back
GtkSpinButton lost its cell editable implementation
when it stopped being a GtkEntry subclass. Add it
back, and make it work.
2019-12-24 03:33:02 -05:00
Matthias Clasen
72932d2776 cell renderer text: Fix this to work again
We were showing the entry, and removing it right
away when the focus moved to the text child.
Avoid that.
2019-12-24 03:13:58 -05:00
Matthias Clasen
58bc9452f6 paper dialog: Make this look less horrible 2019-12-24 03:12:30 -05:00
Matthias Clasen
2a7b5d8229 accelgroup: Fix a buffer overrun
gtk_accelerator_parse_with_keycode can
overrun its buffer for certain inputs.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2325
2019-12-23 23:17:29 -05:00
Matthias Clasen
245546de61 Merge branch 'drop-GtkTreeViewPrivate' into 'master'
tree-view: Drop GtkTreeViewPrivate

See merge request GNOME/gtk!1240
2019-12-24 03:49:48 +00:00
Matthias Clasen
a3793ff137 Merge branch 'drop-gtk-tree-selection-private' into 'master'
tree-selection: Drop GtkTreeSelectionPrivate

See merge request GNOME/gtk!1256
2019-12-24 03:48:18 +00:00
Matthias Clasen
0a98817a6f Merge branch 'wip/oholy/placesview-default-location' into 'master'
placesview: Always open default location after mounting

See merge request GNOME/gtk!1263
2019-12-24 03:47:15 +00:00
Matthias Clasen
c924b48a6c builder-tool: Validate templates again
This wasn't working because it was expecting
some no-longer-existing error message.
2019-12-23 18:32:37 -05:00
Matthias Clasen
519ff576cd colorchooser: Document actions
This is mainly a trial balloon for gtk-doc
support for this syntax.

See https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/30
2019-12-23 13:39:05 -05:00
Matthias Clasen
442f13ef6f inspector: Give better advice
Provide the meson syntax for building a debug-enabled GLib.
2019-12-21 21:09:18 -05:00
Christoph Reiter
95aeadf36c Merge branch 'ci-msys2-newer-pango' into 'master'
CI: Install a newer MSYS2 pango package; Don't allow failures again

Closes #2243

See merge request GNOME/gtk!1258
2019-12-19 17:59:40 +00:00
Ondrej Holy
267ea7552b placesview: Always open default location after mounting
The default location (obtained over g_mount_get_default_location) is
opened after mounting volume, or when opening mounts from sidebar, but
not after mounting over "Connect to Server". Let's unify the behavior
and always open the default location.

https://gitlab.gnome.org/GNOME/nautilus/issues/1319
2019-12-19 17:28:35 +01:00
Yariv Barkan
0604924c20 gtkgesturerotate: Fix a memory leak
On touchpads gtk_gesture_get_sequences() was called without a
corresponding g_list_free(). The same was true for touchscreens
if due to some reason only a single sequence was found.
2019-12-18 23:03:19 +02:00
Christoph Reiter
8f8229dcd2 Fix various new mingw compiler warnings
These are the result of us missing CI for some time now and
MSYS2 having a newer GCC now I guess.
2019-12-18 09:25:06 +01:00
Peter Bloomfield
a5b5657e96 tree-selection: Drop GtkTreeSelectionPrivate
GtkTreeSelection is now private (since commit 79940b32),
so it doesn't need an instance-private structure.
2019-12-16 20:54:23 -05:00
Peter Bloomfield
46d960ddfd tree-view: Drop GtkTreeViewPrivate
GtkTreeView is now private, so it doesn't need an instance-private
structure.
2019-12-15 19:19:42 -05:00
Benjamin Otte
ed24f93fb9 popover: Remove unneeded vfunc
The vfunc is identical to the GtkWidget implementation it replaces. So
just keep using that one.
2019-12-15 21:07:54 +01:00
Benjamin Otte
c4043a8eef treelistmodel: Improve docs
- Move into its own section
- Split GtkTreeListRow into its own document

Trees are weird with listmodels and they deserve their own treatment,
they shouldn't be mushed up with the rest of the list machinery.
2019-12-15 21:07:54 +01:00
Benjamin Otte
dff86c0e12 eventcontrollermotion: Add getters for the properties
... and use them.

Also, rename them from is/contains-pointer-focus to is/contains-pointer,
that's clear enough and not too long.

Finally, adapt the semantics of contains-pointer to mirror
GtkEventControllerKey::contains-focus. If is-pointer is set, so is
contains-pointer, they are not exclusive.
Which is what all users of this property wanted, too.
2019-12-15 21:07:54 +01:00
Matthias Clasen
47285c6642 builder: Improve type name mangling
When looking for the get_type function for GThemedIcon,
try both g_themed_icon_get_type and gthemed_icon_get_type
The former is what gio has, the latter is still supported
to avoid breaking gweather_location_get_type.

Update tests to cover this new case.
2019-12-13 14:21:44 -05:00
Matthias Clasen
e4fb4116fd builder-tool: Don't try to find default boxed values
This doesn't work and yields an ugly, unnecessary
error message.
2019-12-13 14:21:44 -05:00
Matthias Clasen
6d3373cb2c gtk-builder-tool: More helpful error messages
Include line numbers in the error messages we
report, so it is possible to find the error.
2019-12-13 14:21:44 -05:00
Matthias Clasen
9bbacd3e4c Run gtk-builder-tool simplify over our ui files
This was done mainly to verify that the tool does not
make any unwarranted changes. The changes included here
are all cosmetic.
2019-12-12 18:37:39 -05:00
Matthias Clasen
050eb9ba73 Fix up GtkBuilderScope docs
They were not hooked into the document generation.
2019-12-12 18:18:49 -05:00
Matthias Clasen
4fa5f5497a builder: Another small docs fix 2019-12-12 17:59:24 -05:00
Matthias Clasen
43c943e48a Merge branch 'issue-179' into 'master'
Use a separate gesture for middle clicks on PlaceView rows

Closes #179

See merge request GNOME/gtk!1199
2019-12-12 22:53:36 +00:00
Matthias Clasen
d6dc5da6db textbuffer: Minor doc fixes
Fix parameter name mismatches.
2019-12-12 17:31:13 -05:00
Matthias Clasen
12d787286e builder: Minor doc fixes
Fix parameter name mismatches.
2019-12-12 17:30:36 -05:00
Matthias Clasen
c33a7670d0 Merge branch 'wip/otte/builder' into 'master'
More builder work

Closes #2267

See merge request GNOME/gtk!1230
2019-12-12 20:36:08 +00:00
Matthias Clasen
0eb2b382a2 Merge branch 'master-gitlab-HC-tooltip' into 'master'
Set HighContrast tooltip back to black text over white background

See merge request GNOME/gtk!1242
2019-12-12 19:18:06 +00:00
Benjamin Otte
5015730212 builder: Turn last dlsym() function into a scope API
Looking up a get_type function by its name is now also part of
GtkBuilderScope.
2019-12-12 19:39:36 +01:00
Benjamin Otte
f8a7f30a0d builder: Add GtkBuilderScope
GtkBuilderScope is an interface that provides the scope that a builder
instance operates in.
It creates closures and resolves types. Language bindings are meant to
use this interface to customize the behavior of builder files, in
particular when instantiating templates.

A default implementation for C is provided via GtkBuilderCScope (to keep
with the awkward naming that glib uses for closures). It is derivable on
purpose so that languages or extensions that extend C can use it.

The reftest code in fact does derive GtkBuilderCScope for its own scope
implementation that implements looking up symbols in modules.

gtk-widget-factory was updated to use the new GtkBuilderCScope to add
its custom callback symbols.
So it does it different from gtk-demo, which uses the normal way of
exporting symbols for dlsym() and thereby makes the 2 demos test the 2
ways GtkBuilder uses for looking up symbols.
2019-12-12 19:39:23 +01:00
Benjamin Otte
1f94028ff7 builder: Add gtk_builder_set_current_object()
Use it as the default object for expression binds and when connecting
signals. It is intended to work kind of as the "this" object while
parsing. In fact, the term "current object" was stolen from the Java
docs and various C++ tutorials for the this pointer.

Set the current object in gtk_widget_init_template() and
GtkListItemBuilder.

This more-or-less replaces the object passed to
gtk_builder_connect_signals() in GTK3.
2019-12-12 19:12:11 +01:00
Benjamin Otte
512c4c13a6 builder: Add gtk_builder_lookup_object()
... and use it. This function looks up an object like
gtk_builder_get_object() but generates an error on failure.

Unlike the evil function _gtk_builder_lookup_object() which also
generates an error but hides it for later lookup.

Use this to avoid continuing applying properties when an error was
encountered.
2019-12-12 19:12:11 +01:00
Benjamin Otte
552db7cb08 types: Move GTK_INVALID_LIST_POSITION here
I have no idea where it should go really - maybe glib?

It certainly shouldn't require everybody including selectionmodel code
just to get at this value.
2019-12-12 19:10:45 +01:00
Dorota Czaplejewicz
e331b39ca5 imwayland: Suppport terminal purpose 2019-12-12 14:37:51 +00:00
Jonathan Michalon
e6270ca43f Set HighContrast tooltip back to black text over white background
8abdbfee16 pulled Adwaita tooltip selectors,
but in the meantime the colors were also set to Adwaita's. Push back the same
behaviour as before because it's better for visually-impaired users.
2019-12-12 09:51:40 +01:00
Benjamin Otte
336d652be5 a11y: We can peek here
Avoids instantiating a11y objects when we don't need to.
2019-12-09 16:35:41 +01:00
Benjamin Otte
d3e8678955 treeview: Don't create a cyclic reference
TreeRowReference refs the proxy object, so don't use proxies.
2019-12-09 16:35:41 +01:00
Benjamin Otte
503d988c1b label: Compute label baselines correctly
When we were switching smallest and widest, we were not switching the
baselines.
2019-12-09 16:35:41 +01:00
Matthias Clasen
d683d085c0 tree list model: Add a missing annotation
The GtkTreeListModelCreateModelFunc returns
a new reference.
2019-12-08 00:30:32 -05:00
Matthias Clasen
92ab450983 inspector: Avoid critical warnings
We were still using this but it's not defined in the UI xml.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2295
2019-12-07 19:39:02 -05:00
Matthias Clasen
c89c652401 inspector: Make the css tree respect inspected display
The display is used here to force reparsing the theme
on the right settings object.
2019-12-07 18:07:44 -05:00
Matthias Clasen
f0f57d156b inspector: Make logs respect inspected display 2019-12-07 18:07:05 -05:00
Matthias Clasen
cecf4f2763 inspector: Make inspect button use inspected display
This may not matter, but just for cleanliness.
2019-12-07 18:07:05 -05:00
Matthias Clasen
4eeed47c7b inspector: Make general respect inspected display 2019-12-07 18:07:05 -05:00
Matthias Clasen
bd1f7e057a inspector: Make visual settings respect the inspected display
This is not quite complete, GTK and GSK debug flags
are not per display, and slowdown and text direction
are not either.
2019-12-07 18:07:05 -05:00
Matthias Clasen
174d8b72a5 inspector: Make css editor respect inspected display
Stop using gdk_display_get_default and use the
inspected display instead.
2019-12-07 18:07:05 -05:00
Matthias Clasen
1437b0856c inspector: Make object tree respect inspected display
Stop using gdk_display_get_dfault and use the
inspected display instead.
2019-12-07 14:59:49 -05:00
Matthias Clasen
917181cb67 window: Get rid of the inspector_window static
Use the new per-display inspector plumbing and
stop relying on a static variable.
2019-12-07 14:59:49 -05:00
Matthias Clasen
a207a4b3cd inspector: Attach inspector window to display
Give the inspector window a ::inspected-display
property, and pass a display when obtaining an
inspector window. Update the caller.
2019-12-07 14:59:49 -05:00
Matthias Clasen
39a1d27960 window: Inspector cleanups
Reduce the use of the inspector_window static.
The goal is to have one inspector window per
display, so we need to get rid of the static.
2019-12-07 14:59:49 -05:00
Matthias Clasen
5ef4a64084 window: Remove inspector updating fully
Commit 05e752e096 left some ruins behind.
Clean that up.
2019-12-07 14:59:49 -05:00
Matthias Clasen
baacd9efbf inspector: Init yourself
No need to have GTK call this from the outside.
2019-12-07 14:59:49 -05:00
Matthias Clasen
abde37a4d7 inspector: Cleanup
Remove an unused enum.
2019-12-07 14:59:49 -05:00
Hubert Figuière
585397937d doc: Cleanup doc removing mentions of gdk_surface_shape_combine_region() 2019-12-05 11:33:09 -05:00
Benjamin Otte
33bd8f322c builder: Improve error message 2019-12-03 18:12:25 +01:00
Benjamin Otte
bfe4255807 builder: Allow objects in gtk_builder_value_from_string_type()
Instead of throwing an error, lookup objects with
gtk_builder_get_object().
2019-12-03 18:12:25 +01:00
Benjamin Otte
292371932b css: Handle invalid :not() selectors
We weren't correctly ending the ( ) block when encountering an error.

Testcases added.

Fixes #2281
2019-12-03 18:12:25 +01:00
LutzLue
e4b8481dd0 Annotate GtkTreeModelSort.new_with_model() appropriately
The new_with_model() method is a constructor, and it returns a GtkTreeModelSort
instance, even if the C API returns a GtkTreeModel for the convenience of C
developers.

Fixes: #1077
2019-12-03 15:36:42 +00:00
Timm Bäder
a75523da68 cssshadowvalue: Simplify inset shadow nodes to color nodes if possible
inset shadows like this are frequently used to implement highlights in
CSS without crowing them min size of the element.
2019-12-03 08:40:34 +01:00
Timm Bäder
83ec7d562a window: Don't set invalid csd input shape
This might happen if the CSS values of the decoration node are broken,
e.g. if people *accidentally* type large negative values for the
margins.

Fixes #2268
2019-12-03 08:40:34 +01:00
Timm Bäder
05e9a9b572 snapshot: Reorder color matrix nodes containing a transform node
A color matrix node that contains a transform node can also be expressed
the other way around, as a transform node containing a color matrix
node.

In the general case, the color matrix node will have to draw its
child to a texture so it can color every pixel of that texture, but the
renderers can short-cut this if the child of the color matrix node is
already a texture node. So if we have a node tree like

Color Matrix
    - Transform
        - Texture

The renderer would have to either check the grandchild of the color
matrix or simply fall back to rendering the transform node to a texture.

In the new configuration:

Transform
    - Color Matrix
        - Texture

The renderer can easily see that the child node of the color matrix node
is a texture, and skip rendering it to a texture.

This is for example happening in current Adwaita for spinners, which are
rotated symbolics.
2019-12-03 08:40:34 +01:00
Timm Bäder
bc7b37d307 snapshot: Factor out color matrix merging
We will use that elsewhere in the next commit.
2019-12-03 08:40:34 +01:00
nana-4
23d8aa40fe Adwaita: Remove unused popover check/radio styling 2019-12-02 20:48:10 +09:00
nana-4
0933630ee5 Adwaita: Flatten circular buttons in popover.menu
Just reuse the list button style.

https://gitlab.gnome.org/GNOME/gtk/issues/1824
2019-12-02 20:48:09 +09:00
nana-4
797cecd9ae Adwaita: Make check & radio symbolic icon style in popover.menu
The disabled modelbutton color needs to be specified explicitly
in order for check & radio to properly read the color with
currentColor.

https://gitlab.gnome.org/GNOME/gtk/issues/1824
2019-12-02 20:48:09 +09:00
nana-4
4c2707916c Adwaita: Improve popover.menu styling
Based on the mockup:
https://gitlab.gnome.org/Teams/Design/os-mockups/blob/master/menus/menu-design-patterns.png

- Remove horizontal padding from popover.menu contents
- Remove roundness from modelbutton
- Adjust sizing to match the mockup
- Fix visual glitches on button.image-button.model
- Add missing mergin to arrow icons
- Fix accelerator position in rtl direction
- Fix accelerator color

https://gitlab.gnome.org/GNOME/gtk/issues/1824
2019-12-02 20:48:09 +09:00
Matthias Clasen
ab32b1bba2 Merge branch 'wip/muktupavels/opaque-region-master' into 'master'
window: fix opaque region

See merge request GNOME/gtk!1222
2019-12-01 15:11:00 +00:00
nana-4
87ea0253aa themes: remove various @extend with compound selectors
They are no longer supported by sass and broken with libsass 3.6.3
(https://github.com/sass/libsass/issues/3033)

This removes them by replacing them with a placeholder selector. This at
least brings the resulting CSS size down a bit so gtk can be build
again.

`%button.flat.suggested-action` has been replaced by
`%selection_mode_button_flat`, which is a more appropriate selector for
`.selection-mode button.titlebutton`.

The CSS was generated with libsass 3.5.5.

Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>

See https://gitlab.gnome.org/GNOME/gtk/issues/2237
2019-12-01 10:43:16 +09:00
Alberts Muktupāvels
e81a90c432 window: fix opaque region
Decoration node for drawing is used only for client side decorated
windows, but corners from opaque region is subtracted also for
normal windows.

Rename function to better reflect what it does and do not subtract
corners if decoration node was not used for drawing.
2019-11-30 20:19:26 +02:00
Timm Bäder
fe385c28f6 Merge branch 'gtk-link-color' into 'master'
Adwaita: always use link specific colors for link selector

See merge request GNOME/gtk!1201
2019-11-30 07:40:48 +00:00
Matthias Clasen
85950afbbd builder-tool: Fix handling of layout properties
We were not properly identifying layout properties
that need to be kept, causing GtkGrid left-attachment
to go missing in widget-factory.ui.
2019-11-29 08:47:35 -05:00
Timm Bäder
9d94627f75 Merge branch 'dont-color-labels-directly-gtk4' into 'master'
Adwaita: Avoid directly coloring labels wherever possible (GTK4)

Closes #1643

See merge request GNOME/gtk!1209
2019-11-29 11:53:07 +00:00
Carlo Lobrano
7bb8a480f1 Adwaita: always use link specific colors for link selector
link target uses `$selected_bg_color` and `$selected_fg_color` for the
definition of some selectors (e.g. selected).

While `$link_color` and `$link_visited_color` are based on
`$selected_bg_color`, this does not seem coherent.

Replacing `$selected_*g_color` in link target style with link colors
defined in `_colors.scss file`.
2019-11-29 07:32:16 +01:00
Matthias Clasen
c5d24fc5cd Merge branch 'single-compilation-symbol' into 'master'
Use a single compilation symbol

See merge request GNOME/gtk!1216
2019-11-27 15:14:54 +00:00
Emmanuele Bassi
def700739d Use a single compilation symbol
We use a compilation symbol in our build to allow the inclusion of
specific headers while building GTK, to avoid the need to include only
the global header.

Each namespace has its own compilation symbol because we used to have
different libraries, and strict symbol visibility between libraries;
now that we have a single library, and we can use private symbols across
namespaces while building GTK, we should have a single compilation
symbol, and simplify the build rules.
2019-11-27 13:33:43 +00:00
nana-4
5590bcb9cc HighContrast: Add missing color to entry
So entries don't inherit color from the parent element anymore.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1646
2019-11-27 22:22:11 +09:00
Robert Ancell
0df45f0de0 builder: Fix broken annotation
Missing a ':', was introduced in 0627bba5a0.
2019-11-27 16:06:36 +13:00
Emmanuele Bassi
04bb5aad36 Use a separate gesture for middle clicks on PlaceView rows
The click gesture in GtkListBox is exclusively for primary button
clicks; this means we're never going to get a click from the middle
button. We need to use a separate GtkGestureClick controller for middle
clicks, in order to activate rows with the 'open-in-tab' flag.

Fixes: #179
2019-11-25 16:02:40 +00:00
nana-4
4f82a0de89 Adwaita: Avoid directly coloring labels wherever possible
Directly coloring labels can create a lot of unintended behaviors.
Unfortunately we can't avoid directly coloring `label:disabled` because
it can be used individually. This, however, tries to inherit color from
the parent element of labels wherever possible.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1643
2019-11-26 00:39:33 +09:00
Benjamin Otte
7523a3f2f2 cssprovider: Don't add empty rulesets
This change was lost during the parser changes, but the newly added test
exposes it.

And fix the expected error, the syntax has changed.
2019-11-23 19:02:36 +01:00
Alexandr Miloslavskiy
fd1630e049 Fix crash in parse_border()
The bug was introduced in commit:
	9b7640b8 by Benjamin Otte, 2012-03-26 17:24:02
	styleproperty: Make _gtk_style_property_parse_value() return a CssValue

In that commit, `values` changed from `GValue*` to `GtkCssValue**`,
but one `!G_IS_VALUE (&values[8])` was left untouched. As a result,
if `border` shorthand contains anything after color, it might crash,
depending on memory layout.

New test included.

Fixes: #751
2019-11-23 18:15:19 +01:00
Benjamin Otte
4fbb0d7ce4 builder: Make the struct private
We don't want anyone to subclass it - if we want to allow bindings to
extend GtkBuilder, we will be using delegate objects/functions for it.
2019-11-22 17:42:32 +01:00