Benjamin Otte
19ffb40b27
cssboxes: Introduce
...
Split out the code for computing CSS boxes from given variables from the
background render code. This way, it can be shared between different
codebases.
Also, make that code completely be contained of static inline functions.
That ensures that it can be 100% inlined in cases where only parts of
the rectangle are needed (like in gtk_widget_get_width() in the future).
This will require some more patches to actually work, but those will
follow.
2019-02-15 06:53:22 +01:00
Benjamin Otte
86978d2654
widget: Store the render node in the widget's coordinate system
...
Also require gtk_widget_snapshot() to be in the widget's coordinate
system.
2019-02-15 06:53:17 +01:00
Benjamin Otte
694d7c378b
root: Move the renderer to the root
2019-02-15 06:53:17 +01:00
Benjamin Otte
446713fb8b
root: Add gtk_root_get_surface_transform()
...
The function isn't used yet, so this is just infrastructure.
2019-02-15 06:53:17 +01:00
Benjamin Otte
2fbdd8b849
root: Add GtkRoot:get_display vfunc
...
And use it.
2019-02-15 06:53:17 +01:00
Benjamin Otte
ddf2a3681d
widget: Add a GtkWidget::root property and gtk_widget_get_root()
...
The property is just for API completeness, the getter is meant to
replace toplevel usage.
2019-02-15 06:53:17 +01:00
Benjamin Otte
4ca1f7e29f
widget: Add GtkWidgetClass:root and :unroot functions
...
They get added whenever a widget gets added into a hierarchy with a root
widget.
2019-02-15 06:53:17 +01:00
Benjamin Otte
aeda099f47
widget: Remove toplevel flag
...
Instead, rely on GTK_IS_ROOT().
Also implement GtkRoot on GtkWindow and GtkInvisible, the two widgets
that used to set the toplevel flag before.
2019-02-15 06:53:17 +01:00
Benjamin Otte
2e5bc9fbc3
gtk: Add the GtkRoot interface
...
So far, this doesn't do anything.
2019-02-15 06:53:17 +01:00
Benjamin Otte
d65a60e0bd
widget: Move compuatation of what changed further up
...
This way, we can compare with literally the previous allocation and the
size will not be influenced by an adjusted allocation.
But more importantly, we can now use the transform/width/height values
for other stuff.
2019-02-15 06:53:17 +01:00
Benjamin Otte
d3a2218ff4
widget: Split up priv->allocation
...
It's not priv->transform (to be turned into a graphene matrix),
priv->width and priv->height.
The numbers are still the same.
The only difference is that unallocated widgets will now have x/y set to
0, not to -1.
2019-02-15 06:53:17 +01:00
Benjamin Otte
e0ec5caaf8
container: Drop gtk_container_check_resize()
...
Instead, hardcode GtkWindow for now.
The code for non-windows was entirely broken.
2019-02-15 06:53:17 +01:00
Benjamin Otte
2ba928e142
window: Properly detect if size allocation is needed
...
Instead of looking at the allocation, just look at the alloc_needed
widget flag that tracks if an allocation is needed.
2019-02-15 06:46:04 +01:00
Benjamin Otte
07722582ef
simpleselection: Improve items-changed
...
Make items-changed never emit 2 signals, instead, always emit only one,
potentially by extending the range reported in items-changed.
And be a lot more exhaustive about autoselect tests.
2019-02-15 06:46:04 +01:00
Benjamin Otte
1f56f5c2e9
selectionmodel: Change prototype of query_range()
...
1. Do not make position an inout variable
The function is meant to return a range for a given position, not modify
a position. So it makes no conceptual sense to use an inout variable.
2. Pass the selected state as an out variable
Using a boolean return value - in particular in an interface full of
boolean return values - makes the return value intuitively feel like a
success/failure return. Using an out variable clarifies the usage.
3. Allow passing every position value
Define what happens when position >= list.n_items
4. Clarify the docs about how this function should behave
In particular, mention the case from point (3)
5. Add more tests
Again, (3) needs testing.
2019-02-15 06:28:35 +01:00
Benjamin Otte
cd37b872ca
overlay: Remove hack for scrolled windows
...
It's not needed now that we don't use scrollbars or overlays inside
scrolled windows anymore.
2019-02-15 06:28:11 +01:00
Matthias Clasen
89d8ae0431
stack: Fix a crash
...
We need to remove the weak pointer, as the stack switcher can
keep the list model alive beyond the stack. This was observed
to cause crashes:
==16870== Invalid write of size 8
==16870== at 0x5168A4E: g_nullify_pointer (gutils.c:2284)
==16870== by 0x522C500: weak_refs_notify (gobject.c:2791)
==16870== by 0x50FE7BC: g_data_set_internal (gdataset.c:407)
==16870== by 0x50FECA7: g_datalist_id_set_data_full (gdataset.c:670)
==16870== by 0x5227EB4: g_object_real_dispose (gobject.c:1056)
==16870== by 0x522D295: g_object_unref (gobject.c:3309)
==16870== by 0x4AF849F: unset_stack (gtkstackswitcher.c:428)
==16870== by 0x4AF892E: gtk_stack_switcher_dispose (gtkstackswitcher.c:527)
2019-02-14 12:24:22 -05:00
Matthias Clasen
fb44491926
assistant: Add a pages property
...
This is mainly useful to make the page objects
accessible in the inspector.
2019-02-13 18:27:25 -05:00
Matthias Clasen
2866a13f30
inspector: Support list model properties
...
This is just a very quick hack for a property editor
that allows to drill down into list models.
2019-02-13 15:08:17 -05:00
Matthias Clasen
6ef775dbcb
stack: Add a pages property
...
This makes the list model available in the inspector.
2019-02-13 14:14:54 -05:00
Matthias Clasen
927e983ff8
inspector: Make object property inspection work again
...
This was lost when porting to GtkListView.
2019-02-13 13:41:15 -05:00
Matthias Clasen
fbe0db4007
inspector: Add an api to activate an object
...
This will be used to make object property inspection
work again.
This will be used to make object property inspection
work againn
2019-02-13 13:40:40 -05:00
Matthias Clasen
8de8b8eebc
inspector: Fix selecting objects with a next tab
...
This was causing criticals.
2019-02-13 13:04:00 -05:00
Matthias Clasen
82fdd483d2
Add a missing icon
...
The view-refresh-symbolic icon is used in the data list
of the inspector. So ship it in gtk. No need to have
it in the demos, then.
2019-02-13 12:49:31 -05:00
Matthias Clasen
8c0b70691b
stack: Don't emit bad ::selection-changed signals
...
We have to be careful to not pass bad numbers to
this signal, which was happening in cases where
we have on old or new selected item.
2019-02-13 09:01:07 -05:00
Matthias Clasen
1750922631
stack: Fix a corner-case
...
When the stack goes empty, we were failing to reset
the visible_child member to NULL, causing problems later
on, since we don't have a ref for it.
2019-02-13 09:00:00 -05:00
Matthias Clasen
2dd85b826f
stack: Don't leak a reference
...
The page holds a reference to the widget, so can't just clear
this pointer.
2019-02-13 08:42:58 -05:00
Matthias Clasen
c0c6c87781
stack: Avoid some ugly unrefs
...
Instead of using the list model api that forces us
to drop the ref, just work with the list we have.
2019-02-13 08:40:13 -05:00
Matthias Clasen
f4b26af255
selection model: Add sanity checks
...
It is easy to emit wrong ::selection-changed signals,
and then bad things will usually happen later. Add
some sanity checks to gtk_selection_model_selection_changed
to make this easier to track down.
2019-02-13 08:38:30 -05:00
Matthias Clasen
2bd93303c4
Merge branch 'included-icons' into 'master'
...
Included icons
See merge request GNOME/gtk!580
2019-02-13 03:33:16 +00:00
Matthias Clasen
16026b6898
page setup dialog: Use theme icons
...
We have non-gtk-specific icons in the icon theme for this
now, so drop the gtk-orientation icons and use the theme
ones instead.
2019-02-12 21:37:02 -05:00
Matthias Clasen
7207c82c39
spin button: Use guaranteed icons
...
We guarantee value-increase/decrease-symbolic now, no need
for fallback anymore.
2019-02-12 21:37:02 -05:00
Matthias Clasen
bcafd20529
resources: Include more icons
...
Include all the icons that gtk is using itself.
For now, we include size 16 and scalable, to keep
the size limited.
2019-02-12 21:37:02 -05:00
Matthias Clasen
6c4e088620
resources: Include more icon directories
...
We are going to include all the icons that are
used by gtk itself. Prepare for that by including
the necessary subdirectories from the icon theme.
2019-02-12 19:34:19 -05:00
Matthias Clasen
4df2a4c82c
icon theme: Remove fallbacks
...
We want to include all needed icons as resources,
so disable the fallbacks and see what comes up.
2019-02-12 17:34:43 -05:00
Matthias Clasen
92d6f5e8fd
Add image-missing to the internal icons
...
We assert if image-missing is missing,
so life is better if
we can guarantee that it is available.
2019-02-12 17:34:18 -05:00
Timm Bäder
aa71b6c405
Rever more of the icon shadow commit
...
Even adjusting the icon size is wrong for GTK4.
2019-02-12 06:33:41 +01:00
Matthias Clasen
2d57cb6ce3
Revert a non-working addition
...
Cell rendererers don't support <style> in ui files.
2019-02-12 06:20:14 +01:00
Jakub Steiner
756e8f3189
Theme: add helper class names for Adwaita
...
- helps legibility of app icons
Addresses https://gitlab.gnome.org/GNOME/gtk/issues/1434
2019-02-12 06:19:22 +01:00
Matthias Clasen
52b83ac553
about dialog: Adapt to new stack visiblity handling
...
We need to set the visible property of the stack pages
now.
2019-02-12 00:10:54 -05:00
Matthias Clasen
916508f3db
stack: Drop the position property
...
GtkStackSwitcher and GtkStackSidebar no longer
use the GtkStackPage::position property, so we
don't need to maintain it anymore.
2019-02-10 18:43:59 -05:00
Matthias Clasen
9255a12493
stack sidebar: Use the selection model
...
Make GtkStackSidebar and GtkStack communicate via
the selection model that GtkStack now exposes.
This is parallel to the GtkStackSwitcher changes
in the previous commit.
2019-02-10 18:43:59 -05:00
Matthias Clasen
8595665524
stack switcher: Use the selection model
...
Make GtkStackSwitcher and GtkStack communicate via
the selection model that GtkStack now exposes.
2019-02-10 18:43:59 -05:00
Matthias Clasen
7b08d13aea
stack: Provide a selection model
...
Make GtkStack expose a selection model for its pages.
The model can be used to track changes to the pages,
and to change what child is visible.
2019-02-10 18:43:59 -05:00
Matthias Clasen
dc0750f6ef
stack: Add a GtkStackPage::visible property
...
This will let GtkStackSwitcher track visibility
without having to interact with the widgets directly.
2019-02-10 18:43:59 -05:00
Benjamin Otte
30386bbaca
gtk: Add GtkSingleSelection
...
GtkSingleSelection is a GtkSelectionModel that allows selecting a single
item.
2019-02-10 18:43:59 -05:00
Benjamin Otte
16024fba7c
gtk: Add GtkSelectionModel
...
The selection model is a list model interface that takes care of
selections and is to be used by the list model widgets to manage their
selections.
2019-02-10 18:43:59 -05:00
Timm Bäder
14feafe3a9
window: Remove GList link directly
...
Instead of walking the list again and looking for the GList pointer we
already have.
2019-02-10 10:31:27 +01:00
Timm Bäder
d1ea591f18
rendericon: Ignore transparent icons
...
If the recoloring would end up multiplying the alpha component with 0
anyway, just skip drawing anything altogether.
This increases the icon count in the switch demo of the fishbowl from
~260 to ~280 on my system.
2019-02-10 10:31:27 +01:00
Carlos Garnacho
37d218b160
imwayland: Toggle OSK more sparingly
...
Specifically it is avoided to be toggled if:
- Just received focus (in order to preserve OSK state across focus changes)
- Moving cursor around. Still allow some jitter as perfect accuracy is not
possible.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1277
2019-02-09 01:08:35 +01:00
Matthias Clasen
7cb505a395
Avoid introspection warnings
...
Unless we keep the parameter names in headers sources and
docs the same, some tools will complain.
2019-02-08 13:49:17 -05:00
Piotr Drąg
cf5f577834
Use Unicode typography in new translatable strings
...
See https://developer.gnome.org/hig/stable/typography.html
2019-02-08 19:24:53 +01:00
Benjamin Otte
3f2934bff9
revealer: Use gtk_widget_set_overflow()
2019-02-08 18:26:43 +01:00
Benjamin Otte
3d05e6777a
treeview: Use gtk_widget_set_overflow()
...
We need to clip again so we don't overdraw the headers, but setting
overflow does the right thing with header widgetry.
2019-02-08 18:26:42 +01:00
Benjamin Otte
e522641920
textview: Use gtk_widget_set_overflow()
2019-02-08 18:26:42 +01:00
Benjamin Otte
3517eb7c54
magnifier: Use gtk_widget_set_overflow()
2019-02-08 18:26:42 +01:00
Benjamin Otte
b72ee00539
iconview: Use gtk_widget_set_overflow()
2019-02-08 18:26:42 +01:00
Benjamin Otte
c07cd23aa9
paned: Use gtk_widget_set_overflow()
2019-02-08 18:26:42 +01:00
Benjamin Otte
8ef417dad1
viewport: Use gtk_widget_set_overflow()
2019-02-08 18:26:42 +01:00
Benjamin Otte
49cbf2a16b
widget: Add gtk_widget_set_overflow()
...
This adds a simple abilities for widget implementations to clip their
content. See future commits for users of this.
2019-02-08 18:26:42 +01:00
Matthias Clasen
915acce470
builder-tool: Fix preserving properties
...
We were looking at the wrong class names here, we need
to look at the owner type to match against our list.
This fixes problems where gtk-builder-tool simplify
inadvertedly loses hexpand or vexpand settings, messing
up layout, as recently happend in gtk4-widget-factory.
2019-02-08 10:34:32 -05:00
Matthias Clasen
c16a861f68
assistant: Fix a refcounting oversight
...
The assistant needs to hold a ref on the pages.
2019-02-08 09:51:45 -05:00
Matthias Clasen
b8903a4aba
stack: Fix up property notification
...
This was showing up in testsuite failures.
2019-02-08 09:03:45 -05:00
Matthias Clasen
d8a5f41aab
assistant: Fix up property notification
...
This was showing up in testsuite failures.
2019-02-08 09:03:18 -05:00
Matthias Clasen
1632cc7929
stack: Make the child meta work without stack
...
We have tests that expect this to work, like defaultvalue.
2019-02-08 08:22:35 -05:00
Matthias Clasen
a7eae67228
shortcuts window: Fix a leftover use of child properties
...
These properties are gone, use the child meta here.
2019-02-08 08:22:06 -05:00
Matthias Clasen
c7467b4e76
assistant: Fix the default value of has-padding
...
This was showing up in the defaultvalue test.
2019-02-08 08:21:42 -05:00
Matthias Clasen
81055ca7d9
Fix compiler warnings
...
Fallout from recent GtkStackPage changes.
2019-02-08 07:55:41 -05:00
Matthias Clasen
b675597075
builder-tool: Convert assistant pages too
...
Do the same transformation for GtkAssistantPage that
we already do for GtkStackPage, to transform GTK 3 .ui
files to GTK 4 ways of doing things.
2019-02-08 00:09:44 -05:00
Matthias Clasen
ce60089f46
assistant: Convert child properties to a child meta object
...
Turn GtkAssistantPage into a public object holding the
former child properties.
2019-02-08 00:09:44 -05:00
Matthias Clasen
4ace873046
Update ui files to new stack syntax
...
This conversion was done with the help of gtk4-builder-tool.
2019-02-08 00:09:44 -05:00
Matthias Clasen
72b6644223
builder tool: Operate on multiple files
...
There is no strong reason to disallow this, when
the --replace option is used.
2019-02-08 00:09:44 -05:00
Matthias Clasen
59152b8a8d
builder tool: Rewrite the simplify command
...
Rewrite the builder-tool simplify command to have
a full parse tree around, and perform simplifications
on that tree. This lets us rewrite GtkStack and turn
child properties into child meta objects.
2019-02-08 00:09:44 -05:00
Matthias Clasen
addcf2e526
tools: Split gtk-builder-tool
...
Put each command into its own file. This is in
preparation for redoing the simplify command.
2019-02-08 00:09:44 -05:00
Matthias Clasen
ed3b9669b3
builder: Allow specifying objects inline
...
In addition to <property name="foo">bar</property> referring
to an object with ID bar, we now also parse
<property name="foo"><object>...
to specify a property 'inline'.
2019-02-08 00:09:44 -05:00
Matthias Clasen
ad9c2a624f
stack: Convert child properties to a child meta object
...
Create a GtkStackPage public object which holds the former
child properties of GtkStack.
Adjust all callers.
2019-02-08 00:09:44 -05:00
Jakub Steiner
a3e517aa9c
Adwaita: menu border-radius fix from gtk3
...
- avoid painting over the rounded corners with background
2019-02-06 14:34:55 +01:00
Jakub Steiner
8d537379ed
Adwaita: sync with stable styling
...
- fold over changes in teh stable brnch to get the same look
fixes issue #1656
2019-02-06 14:01:38 +01:00
Emmanuele Bassi
1668496359
docs: Fix GTK links and locations
2019-02-06 10:39:27 +01:00
Rico Tzschichholz
d2d35e52c3
Adjust some more pkg-config references for gtk+ to gtk rename
...
See https://gitlab.gnome.org/GNOME/gtk/issues/1439
2019-02-06 09:56:08 +01:00
Matthias Clasen
e91144f6c9
Make GtkInvisible private
...
We can't quite get rid of its use in the inspector,
but we can make it private.
2019-02-06 02:06:19 -05:00
Matthias Clasen
a75dcce707
Make the invisible invisible
...
The change to make widgets visible by default broke GtkInvisibles
special-cased state handling and that in turn caused picking in
the inspector to break with another recent change.
This change makes the inspector pick button work again.
2019-02-05 16:55:07 -05:00
Matthias Clasen
785373ce2a
printoperation-win32: Stop using an invisible
...
We can just as well use a GtkWindow here. We just need
a handle. Untested.
2019-02-05 10:56:40 -05:00
Matthias Clasen
aad44999f3
filechoosernativeportal: Stop using an invisible
...
A label works just as well here, it turns out.
2019-02-05 10:46:48 -05:00
Matthias Clasen
721e598e99
Reduce includes of gtkinvisible.h
...
We want to get rid of GtkInvisible.
2019-02-05 10:46:33 -05:00
Timm Bäder
9d950087ef
inspector: Remove window icon
...
The property does not exist anymore and the window icon has never been
used on non-x11 backends.
2019-02-05 15:14:19 +01:00
Timm Bäder
1674b6e269
main: Prefer implicit grab widget to target widget for motion events
...
When an implcit grab is going on, we don't need to consider other
widgets for motion (etc.) events.
2019-02-05 15:13:01 +01:00
Timm Bäder
33ac41bc94
infobar: Remove an unused variable
2019-02-05 15:09:59 +01:00
Timm Bäder
057144cfdd
window: Inline function into only caller
2019-02-05 08:11:43 -05:00
Timm Bäder
9b91041025
window: Remove remaining icon_list handling
2019-02-05 08:11:43 -05:00
Timm Bäder
b215384064
window: Remove default_icon_serial
...
Now unused.
2019-02-05 08:11:43 -05:00
Timm Bäder
e6c5b9348d
window: Remove default icon list
2019-02-05 08:11:43 -05:00
Timm Bäder
55b99e9916
window: Remove icon list
2019-02-05 08:11:43 -05:00
Timm Bäder
131e8d8905
Remove some unnecessary gtkwindow.h includes
2019-02-05 08:11:43 -05:00
Timm Bäder
e82d97f069
window: Remove set_default_icon
2019-02-05 08:11:43 -05:00
Timm Bäder
490bb4c2ea
window: Remove icon property
2019-02-05 08:11:43 -05:00
Timm Bäder
79664567c4
window: Remove _set_default_icon_from_file
2019-02-05 08:11:43 -05:00
Timm Bäder
7abcd5ba3b
window: Remove set_icon_from_file
...
Not all backends support setting window icons from raw pixel data, so
remove the public API in GtkWindow for it.
2019-02-05 08:11:43 -05:00
Matthias Clasen
3489ed087d
Merge branch 'kill-buttonbox' into 'master'
...
Drop GtkButtonBox
See merge request GNOME/gtk!554
2019-02-05 13:06:09 +00:00
Matthias Clasen
32e61b955a
Drop gtkboxprivate.h
...
Not needed anymore.
2019-02-05 07:54:35 -05:00
Emmanuele Bassi
f6c07a0ddb
glade: Drop the "plus"
...
From documentation and catalog description.
2019-02-05 11:26:54 +01:00
Emmanuele Bassi
25fd230327
gtk: Drop the "plus"
...
Source names should use "[gtk]" without the plus.
2019-02-05 11:26:20 +01:00
Emmanuele Bassi
866d0c4fb9
themes: Drop the "plus"
...
Comments and documentation.
2019-02-05 11:25:41 +01:00
Emmanuele Bassi
4569bc6358
inspector: Drop the "plus"
...
From user-visible strings, mostly.
2019-02-05 11:25:15 +01:00
Matthias Clasen
179e85f803
about dialog: Stop setting secondary
...
We no longer use a button box, so this is not available.
2019-02-05 03:46:31 -05:00
Matthias Clasen
99c5a3d72c
gtk: Stop using deprecated pango api
2019-02-04 18:28:31 -05:00
Matthias Clasen
dbd360262c
Add an explicit fribidi dep
...
We will use fribidi api to determine text direction.
2019-02-04 18:28:31 -05:00
Matthias Clasen
5120748981
Drop GtkButtonBox
...
This widget does not seem worth keeping,
and we want to get rid of child properties.
2019-02-04 12:44:55 -05:00
Timm Bäder
257df1d8b5
tooltip: Get the pointer position relative to the toplevel widget
...
Since we position the tooltip window relative to the toplevel widget and
not actually relative to the effective_toplevel, we shouldn't get the
pointer position relative to the effective_toplevel.
We previously used the pointer position (relative to the
effective_toplevel) and the anchor rect (relative to the toplevel
widget) together to calculate x_distance. This leads to wrong values in
cases where get_surface (new_tooltip_widget) != get_surface (toplevel)
Fixes #1427 in master
2019-02-04 17:05:30 +01:00
Timm Bäder
47ba423eca
tooltip: Use gtk_widget_compute_bounds to get tootip widget anchor
...
Instead of using gtk_widget_get_allocated_width/height, which might
return the wrong box for the tooltip widget.
2019-02-04 17:05:30 +01:00
Timm Bäder
489e87baea
main: Rename local variable
...
Make it a little clearer that this is the event widget and not just any
widget.
2019-02-04 17:05:30 +01:00
Timm Bäder
43234eec42
gtkmain: Rename event_widget to target_widget in do_event
...
The event_widget is the widget that the surface belongs to which got
this event. The target widget is the one that will receive the event.
The previous terminology was confusing.
2019-02-04 17:05:30 +01:00
Matthias Clasen
268fcbb838
Drop GtkPopoverMenu::position
...
This is another unnecessary position child property.
2019-02-04 10:47:18 -05:00
Emmanuele Bassi
4040f76529
Use @basename@ in enumeration type templates
...
The @filename@ directive will use the full path of the file being parsed
for enumeration types; we should use @basename@, instead, as it improves
the reproducibility of the build by using only the file name.
2019-02-04 14:02:45 +01:00
Timm Bäder
4dca2f9604
recorder: Don't try to print info about a NULL list model
2019-01-31 17:00:50 +01:00
Timm Bäder
5852a5ece8
switch: Notify :state by pspec
2019-01-30 17:46:08 +01:00
Emmanuele Bassi
a7fa1cf6f2
Merge branch '1480-critical-csd-close-button' into 'master'
...
gtkmain: Avoid critical messages on closing window
Closes #1480
See merge request GNOME/gtk!442
2019-01-30 11:53:12 +00:00
Timm Bäder
d9d4879623
Merge branch 'wip/carlosg/texthandles-position' into 'master'
...
gtkentry: Fix text handle coordinates calculation
See merge request GNOME/gtk!542
2019-01-29 13:36:43 +00:00
Carlos Garnacho
a15325ef44
gtkentry: Fix text handle coordinates calculation
...
The text allocation is already in widget-local coordinates, involving the
GtkAllocation here is not right.
2019-01-29 12:00:07 +01:00
Jakub Steiner
5765d47568
Merge branch 'expander-row-padding' into 'master'
...
adwaita: Fix the greediness of row:not(.expander)
See merge request GNOME/gtk!526
2019-01-29 09:46:34 +00:00
Jakub Steiner
7286ede490
Merge branch 'adwaita-osd-spinbutton-entry-fix-master' into 'master'
...
Horizontal OSD spinbutton entry fix
See merge request GNOME/gtk!332
2019-01-29 09:39:57 +00:00
Timm Bäder
4a333f826a
Merge branch 'wip/matthiasc/event-signal' into 'master'
...
Remove vestigial ::event support
See merge request GNOME/gtk!538
2019-01-29 08:33:40 +00:00
Timm Bäder
8c4dc3de4d
widget: Also propagate ACTIVE state when unsetting
2019-01-29 07:19:54 +01:00
Timm Bäder
0a5362a7d9
gtkmain: Remove comment mentioning GDK_PROPERTY_NOTIFY
...
... which doesn't exist anymore.
2019-01-29 07:19:54 +01:00
Timm Bäder
245cebec1d
widget: Ignore events on unmapped widgets
...
There was a special case for GtkSearchBar, so remove that one.
2019-01-29 07:19:54 +01:00
Benjamin Otte
bde2332a1a
main: Report correct target for button release events
...
Button release events should not go to the widget below the pointer, but
to the widget that received the original button press.
Fixes #24
2019-01-29 07:19:54 +01:00
Timm Bäder
20429f4764
Remove :active state handling on widgets
2019-01-29 07:19:54 +01:00
Timm Bäder
1b504a3303
Automatically set :active state on button press/release
2019-01-29 07:19:54 +01:00
Timm Bäder
61ec2ab5c9
widget: Propagate PRELIGHT state when unsetting it
...
Without this, disabling a widget that's being hovered and is a child
widget of the widget we're disabling (e.g. the GtkImage child of a
GtkButton) will retain its :hover state even though it should be
insensitive to any sort of input now.
2019-01-29 07:19:54 +01:00
Timm Bäder
611964d915
widget: Avoid some type checks when picking
2019-01-29 05:03:26 +01:00
Timm Bäder
16481734c1
csstransformvalue: Convert skew values to radians
2019-01-29 05:03:26 +01:00
Timm Bäder
d54cccfdd5
label: Use pango_layout_get_log_attrs_readonly
...
No need to memdup the log attrs in this case.
2019-01-29 05:03:26 +01:00
Timm Bäder
7f4b7c48e8
cssparser: Make _gtk_css_parser_try a macro
...
We almost always pass a constant string to it, so use a macro and try to
trick the compiler into evaluating the 2(!) strlen() calls at compile
time.
2019-01-29 05:03:26 +01:00
Timm Bäder
df1f036a95
cssanimatedstyle: Avoid some type checks and unnecessary work
2019-01-29 05:03:26 +01:00
Timm Bäder
f3c51cdf5f
scrolledwindow: Don't NULL the indicator widget in unmap
...
We still have the widget, so just keep the pointer to it.
2019-01-29 05:03:26 +01:00
Matthias Clasen
8a667a5f1d
Remove vestigial ::event support
...
The signal is gone, no need to keep the vfunc around.
2019-01-26 15:36:55 -05:00
Matthias Clasen
a3801299f5
Merge branch 'tabular-menus' into 'master'
...
Drop tabular menus
See merge request GNOME/gtk!527
2019-01-25 17:32:41 +00:00
Matthias Clasen
c5f90fc20d
switch: Use icons
...
This works better than glyphs, avoiding the
uncertainties of font availability and fallback..
2019-01-24 20:43:12 -05:00
Matthias Clasen
1528e7eabf
Add switch icons
...
These will be used in GtkSwitch in the future.
2019-01-24 20:43:12 -05:00
Matthias Clasen
9dee863217
menu: Drop the child properties
...
These were only there in support of tabular menus.
2019-01-23 23:36:04 -05:00
Matthias Clasen
e31a96123e
Drop gtk_menu_attach
...
We no longer support tabular menus.
2019-01-23 23:30:18 -05:00
Matthias Clasen
a65f5c2e73
tree menu: Drop support for grids
...
This was only used in GtkComboBox, and it no longer
supports grids,
2019-01-23 23:20:22 -05:00
Matthias Clasen
a5ba0d46c2
combobox: Drop support for grids
...
This is pretty much unued, and we want to get rid of it.
This removes support for wrap-width, row-span-column
and column-span-column properties.
2019-01-23 22:52:36 -05:00
Matthias Clasen
d339a43634
header bar: Drop the position child property
...
There is no particular need to have this, and we want
to get rid of child properties.
2019-01-23 20:05:28 -05:00
Matthias Clasen
003eefe8bf
action bar: Drop the position child property
...
There is no particular need to have this, and we want
to get rid of child properties.
2019-01-23 19:30:47 -05: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
Matthias Clasen
883d5d8584
box: Remove the position child property
...
The position child property is problematic, since it
requires us to emit notification for all children when
inserting a child early in the list of children.
Remove the property from all ui files.
2019-01-23 19:30:47 -05:00
Timm Bäder
e9e40ddb42
box: Remove gtk_box_pack_start
2019-01-23 19:30:46 -05:00
Timm Bäder
a543ed84f6
box: Remove gtk_box_pack_end
2019-01-23 19:30:46 -05:00
Timm Bäder
3d34b91453
box: Simplify documentation
...
Remove all references to any sort of "packing".
2019-01-23 19:30:46 -05:00
Timm Bäder
1ccba26de9
box: Remove children list
...
GtkWidget saves a widget list for us, so we don't need to keep track of
them ourselves. This is okay now that we don't have a pack-type child
property anymore.
2019-01-23 19:30:46 -05:00
Timm Bäder
28c51175d8
box: Remove pack-type child property
2019-01-23 19:30:46 -05:00
Timm Bäder
99738e7059
assistant: Fix button order in ui file
2019-01-23 19:30:46 -05:00
Timm Bäder
494e9d750a
dialog: Expose the content area as a separate GtkBox child
...
This way, the "vbox" internal child does not contain anything by
default. It previously did contain "internal" widgetry like the action
area.
2019-01-23 19:30:46 -05:00
Timm Bäder
3a13515777
Stop using GtkBox's pack-type child prop in UI files
2019-01-23 19:30:46 -05:00
Timm Bäder
ab6a67dbeb
combobox: Stop using GtkBox's pack-type property
...
Reorder the child widgets accordingly instead.
2019-01-23 19:30:46 -05:00
Timm Bäder
d7756dc62b
scalebutton: Stop relying on GtkBox's pack-type child prop
2019-01-23 19:30:46 -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
4349e33d4e
shortcutssection: Use a center box as footer
2019-01-23 19:30:46 -05:00
Matthias Clasen
c1f79a935c
switch: Avoid problems with glyph availability
...
If none of the glyphs we want are available, fall
back to using empty strings here, rather than causing
critical warnings.
2019-01-23 15:47:02 -05:00
Adrien Plazas
636a9a6ea7
adwaita: Fix the greediness of row:not(.expander)
...
This avoids list rows (e.g. the ones in a stack sidebar) to be
accidentally selected and see their padding messed up.
2019-01-23 21:41:58 +01:00
Adrien Plazas
773efe41a9
adwaita: Fix the padding of row.expander
...
This will allow to implement the expanding rows pattern.
2019-01-22 12:44:33 +01:00
Benjamin Otte
359bc7695c
build: Reintroduce warning flags from autotools
...
Some of the flags got lost in the meson transition or were demoted from
error flags to warning flags.
This commit reintroduces them.
It also includes fixes for the code that had warnings with those flags.
The big one being -Wshadow.
2019-01-22 04:33:12 +01:00
Benjamin Otte
c875465477
imcontextwayland: Get rid of global variable
...
Attach it to the GdkDisplay.
Also fixes -Wshadow complaining about "global" being shadowed.
2019-01-22 04:33:11 +01:00
Benjamin Otte
7978e04963
immodule: Clean up loading code
...
Remove the unneeded is_platform() check and just go by extension point
priority.
Also g_error() out if no im module exists, because "simple" is compiled
in and should always exist.
2019-01-22 04:33:11 +01:00
Benjamin Otte
bbd1532f84
imcontext: Fix priorities of modules
...
All built-in backend modules get a priority of 0 because they are the
default ones.
GtkIMContextSimple gets a priority of G_MININT because it's the fallback
one.
This mirrors the media modules code.
2019-01-22 04:33:11 +01:00
Matthias Clasen
045b92abdd
slice model: Don't report excessive changes
...
We were not skipping an unchanged initial segment
of the slice in some cases. Fix that.
2019-01-20 06:11:48 +01:00
Benjamin Otte
af56f06b7b
rbtree: Fix a crash in insertion fixup
...
This got broken in commit a33ff4c6ab
.
Testcase included.
2019-01-20 06:09:40 +01:00
Benjamin Otte
5e00cdbd74
rbtree: Add a trivial way to add rbtree tests to the testsuite.
...
The format of the printout will be suitable for addition as a new test to
testsuite/gtk/rbtree-crash.c
by just grepping the printouts from the relevant rbtree.
2019-01-20 06:09:40 +01:00
Matthias Clasen
9baef5e101
Merge branch 'reference-include' into 'master'
...
Specify the C include for Unix printing API
See merge request GNOME/gtk!516
2019-01-19 01:13:42 +00:00
Michael Catanzaro
c7af14dea8
filechoosernativeportal: stuff the current filter into options
...
We need to tell the portal what filter is supposed to be selected by
default, or it will just pick the first one, which could be wrong and
annoying.
This will require updated xdg-desktop-portal and xdg-desktop-portal-gtk
to work properly.
Fixes #1492
2019-01-18 20:02:11 -05:00
Michael Catanzaro
f3f22b76dc
filechoosernativeportal: remove redundant casts
...
We are casting from GtkFileChooserNative to... GtkFileChooserNative.
Boo.
2019-01-18 20:01:52 -05:00
Michael Catanzaro
a0f750f7c9
filechoosernative: forward current_filter to delegate dialog
...
gtk_file_chooser_set_filter() doesn't work for GtkFileChooserNative. The
code forwards added and removed filters to the delegate dialog, but
doesn't do anything to set the selected one, so the wrong one gets
chosen. So fix that.
This only fixes the fallback dialog. The portal will be fixed in a
subsequent commit.
Partial fix for #1492
2019-01-18 20:01:37 -05:00
Emmanuele Bassi
3543a54545
Specify the C include for Unix printing API
...
Instead of using the INCLUDE directive inside the sections file, we can
specify the default C include in the gtkdoc-mkdb arguments, and override
it inside the C sources that need it.
2019-01-19 00:00:34 +00:00
Emmanuele Bassi
95c0f07295
Merge branch 'master' into 'master'
...
A11y: export gtk_cell_accessible_parent_get_(row|column)_header_cells
See merge request GNOME/gtk!505
2019-01-18 23:13:31 +00:00
Matthias Clasen
8f697d6715
Merge branch 'switch-fallback' into 'master'
...
Add fallback glyphs for GtkSwitch states
See merge request GNOME/gtk!509
2019-01-18 22:43:54 +00:00
Matthias Clasen
28241cecff
about dialog: Use ::activate-link for license
...
This should behave the same as all the other links
in this dialog.
Closes : #1561
2019-01-18 17:31:56 -05:00
Timm Bäder
7843da1f2b
entry: Use pango_layout_get_log_attrs_readonly
...
Since we're not modifying anything...
2019-01-18 19:43:53 +01:00
Timm Bäder
7aad0896a7
entry: Use a label as placeholder
...
This gives us a better way of choosing the color of the placeholder text
(and enabled general css styling on it of course).
Closes #378 (If you want to keep the placeholder on focused and empty
entries, just don't set the placeholder opacity to 0 in
entry:focus>placeholder. This is the default behavior but this commit
includes a rule in Adwaita to hide it.
2019-01-18 19:43:53 +01:00
Timm Bäder
7c72712b0f
entry: Trivial indentation fix
2019-01-18 19:43:52 +01:00
Timm Bäder
a25d6b1dc7
tooltip: Use gdk_rectangle_contains_point
2019-01-18 19:43:52 +01:00
Timm Bäder
c8ec0f42a0
tooltip: Move tooltips enabled checks into tooltips_enabled
2019-01-18 19:43:51 +01:00
Timm Bäder
2353e0e03f
tooltip: Look at the event's target widget
...
Since we now have a widget whenever we query tooltips, we can as well
get the events target_widget if we have an event (which is what we do
when coming from gtkmain.c). This keeps us from searching the entire
widget hierarchy for the target event even though we've already done
that for pointing events in gtkmain.c
This reduced the work done in gtk_tooltip_handle_event in normal motion
events to basically nothing since we already did all the heavy lifting
when handling the pointing event in gtkmain.c
2019-01-18 19:43:51 +01:00
Timm Bäder
11f9ae8202
tooltip: Remove gtk_tooltip_trigger_tooltip_query
...
As stated by the documentation, this should be called when a widget gets
updated, but in that case, one can equally use
gtk_widget_trigger_tooltip_query.
2019-01-18 19:43:51 +01:00
Timm Bäder
0e07912231
tooltips: Remove keyboard mode tooltips
...
Keyboard mode was only used in gtk_widget_real_show_help before, but now
that's gone and so is any usage of keyboard mode tooltips.
2019-01-18 19:43:50 +01:00
Timm Bäder
c49cc977fa
gizmo: return void from snapshot func
...
This boolean return was from the old gadget code and we weren't using it
in the new gizmo code.
2019-01-18 19:43:50 +01:00
Timm Bäder
3ca688a6dd
scrolledwindow: Reset indicators in unmap()
...
This is unrelated to any windowing resources these days, so no need for
an unrealize handler.
2019-01-18 19:43:49 +01: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
dbc8d253c3
scrolledwindow: Fix a event widget/event target mixup
2019-01-18 19:43:47 +01:00
Timm Bäder
0f6e15cfa2
scrolledwindow: remove unused struct
2019-01-18 19:43:46 +01:00
Timm Bäder
ea2f66226a
iconview: Fix scrolled drawing
...
We were only drawing the scrolled away first few items
2019-01-18 19:41:19 +01:00
Emmanuele Bassi
58d9c3d5bd
switch: Update state labels when needed
...
If the text style changes, or the display settings do, we need to update
the state labels to ensure that the glyphs are available in the font
we're using.
2019-01-18 14:43:42 +00:00
Timm Bäder
9b15c6900a
colorscale: Redraw correct widget after setting rgba
...
The entire color scale hack is still done in GtkRange, which draws the
color scale in the range gizmo. So, to correctly redraw the color scale
when setting a new color, we need to redraw the proper widget and that's
the trough widget.
Fixes #1453
2019-01-16 19:20:53 +01:00
Timm Bäder
135cf16969
entry: Remove _gtk_entry_grab_focus
...
We have API for both the select and !select behavior these days, so use
that one.
Fixes #1457
2019-01-16 19:18:13 +01:00
Timm Bäder
374e93ef96
window: Directly find the cursor in the widget hierarchy
...
Instead of recording the way up from the target widget to the grab
widget (or toplevel) and then walking that path upwards, just walk the
parent chain and look at the cursor.
2019-01-16 19:01:40 +01:00
Timm Bäder
83f8056992
scrolledwindow: Remove unused drag_device member
2019-01-16 19:01:40 +01:00
Timm Bäder
cf1526cca6
snapshot: Add gtk_snapshot_from_parent
...
Most of the time, the GtkSnapshot objects we create while snapshotting
widgets don't end up containing all that many nodes or states in their
respective node or state stack. This undermines the amortized allocation
behavior of the G(Ptr)Array we use for the stacks. So instead, use the
(until now unused) parent_snapshot GtkSnapshot* passed to
gtk_widget_create_render_node and reuse its node and state stack.
We do not avoid allocating a new GtkSnapshot object, but we do avoid
allocating a ton of G(Ptr)Array objects and we also avoid realloc'ing
their storage.
2019-01-16 19:01:40 +01:00
Timm Bäder
c1c764255f
window: Don't manually queue a draw on the new focus widget
...
This is either unneeded and OK to remove, or it is needed and there's a
bug somewhere else.
2019-01-16 19:01:38 +01:00
Timm Bäder
7dd54b5789
treeview: Don't get separator_height more than once
...
Closes !209
2019-01-16 18:58:15 +01:00
Timm Bäder
697aa95c7e
treeview: cache expander size
...
We need to know it all the time and since we get it from CSS, doing that
is fairly expensive.
2019-01-16 18:58:15 +01:00