Commit Graph

33469 Commits

Author SHA1 Message Date
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