Garrett Regier
44460cd720
container: Don't add classes twice
...
_gtk_widget_create_path() already adds the style classes.
2015-09-11 17:56:44 +02:00
Alberts Muktupāvels
4539804086
gtkplug.c: remove draw function, not needed
...
Background will be rendered by parent class - GtkWindow.
https://bugzilla.gnome.org/show_bug.cgi?id=754854
2015-09-11 17:56:44 +02:00
Jakub Steiner
3ffef0ca03
HighContrast: make sidebar list rows taller
...
sync with Adwaita
https://bugzilla.gnome.org/show_bug.cgi?id=754866
2015-09-11 12:40:48 +02:00
Ross Lagerwall
4993b02da8
GtkFileSystem: Add to the list of remote filesystems
...
Add afp and google-drive to the list of remote filesystems.
https://bugzilla.gnome.org/show_bug.cgi?id=754746
2015-09-10 21:46:36 +01:00
Timm Bäder
a6982cc76e
GtkWidget: Fix typo in #ifdef
...
It's ENABLE, not ENABEL. Also fix the corresponding #endif comments.
2015-09-10 11:47:34 +02:00
Timm Bäder
3900700479
GtkContainer: Fix paramter name in doc comment
2015-09-10 11:34:44 +02:00
Matthias Clasen
cf0e087527
Optimize gtk_css_node_declaration_has_class
...
This function is getting called a lot. Statistics for the gtk3-demo
listbox example show most calls with 0-4 classes. Unrolling the cases
a bit brings the instruction count in callgrind from 93M to 52M.
2015-09-09 14:40:36 -04:00
Matthias Clasen
59797754b4
More bit manipulation speedups
...
The same trick that was applied to _gtk_css_change_for_child in
the previous commit can be applied to _gtk_css_change_for_sibling
as well, and that is what this commit does.
With both functions converted, gtk_css_change_translate is no
longer needed and gets dropped.
2015-09-09 14:09:21 -04:00
Matthias Clasen
d7dd6eccd5
Manipulate bits more efficiently
...
The function to translate GtkCssChange enum values to the PARENT
ones is called very frequently. This patch speeds it up tremendously.
The callgrind instruction count for this function in the listbox
demo goes from 108M to 7M.
2015-09-09 14:02:27 -04:00
Matthias Clasen
a9481cb410
match_all: Only allocate an array when needed
...
My statistics show that more than half of all calls end up
with 0 matches, so we can avoid some overhead by not allocating
an array at all in this case.
2015-09-09 11:17:13 -04:00
Matthias Clasen
2d29ae4159
Handle match_all returning NULL
...
This is in preparation for not allocating an array at all if there
are no matches.
2015-09-09 11:17:13 -04:00
Matthias Clasen
117b50f8fb
Optimize gtk_css_selector_match_all
...
We are dealing with really short lists here.
95% are < 10 matches, and the longest I've been able to record was 19.
So just do away with the hash table and do sorted insertion in
the array directly.
2015-09-09 11:17:13 -04:00
Lapo Calamandrei
f7894a7588
Adwaita: special case selection mode lists checks
...
...otherwise the special selection mode 40x40px checks are used
shrinked to 16x16.
See https://bugzilla.gnome.org/show_bug.cgi?id=754610
2015-09-09 16:37:49 +02:00
Matthias Clasen
9da0aa5d40
Use G_ENABLE_CONSISTENCY_CHECKS for template finalization checks
2015-09-09 06:32:47 -04:00
Matthias Clasen
0e86278fcc
css selector: Use the quarks we have
...
Unless I'm missing something, there is no reason to go from
quarks back to strings to implement hasing or comparison.
2015-09-09 06:32:47 -04:00
Matthias Clasen
c8072c89ba
style provider private: Use gtk_internal_return_if_fail
2015-09-09 06:32:47 -04:00
Matthias Clasen
3526b08e01
Clean up debug features
...
Introduce a GTK_DEBUG_CHECK() macro and use it to check for
GTK_DEBUG flags everywhere. Also guard all such places by
2015-09-09 06:32:46 -04:00
Matthias Clasen
1b15588732
widget: Use G_ENABLE_CONSISTENCY_CHECKS for invariants checking
...
The logic here is that G_ENABLE_DEBUG is for compiling out
debug spew that can be triggered at runtime with the GTK_DEBUG
environment variable, while G_ENABLE_CONSISTENCY_CHECKS is for
consistency checks that are applied unconditionally.
2015-09-09 06:32:46 -04:00
Matthias Clasen
bf9a72976f
size request: Redo the recursion checks
...
Use G_ENABLE_CONSISTENCY checks for the recursion checks
in gtksizerequest.c
2015-09-09 06:32:46 -04:00
Matthias Clasen
f4b53d4b0c
notebook: Drop use of G_DISABLE_CHECKS
...
Rewrite the one check that the G_DISABLE_CHECKS macro was used for
in terms of g_return_if_fail.
2015-09-09 06:32:46 -04:00
Matthias Clasen
ff530ae321
Drop an unused warning
...
It has been ifzeroed for many, many years.
2015-09-09 06:32:46 -04:00
Matthias Clasen
6f2fcce494
Use a getter for widget direction
2015-09-09 06:32:46 -04:00
Matthias Clasen
b8e82a1548
settings: Reuse a value
...
We've already gotten the value type, use it.
2015-09-09 06:32:45 -04:00
Matthias Clasen
96d66a11cf
builder: Avoid some type-checking overhead
2015-09-09 06:32:45 -04:00
Lapo Calamandrei
50983101d4
Adwaita: set -GtkRange-trough-border: 0 for scrollbars
...
which fixes firefox scrollbar not being fittsy when maximixed.
2015-09-08 22:12:12 +02:00
Jakub Steiner
eef64df5f2
HighContrast: remove edge highlight
...
https://bugzilla.gnome.org/show_bug.cgi?id=754551
2015-09-08 17:24:19 +02:00
Matthias Clasen
f7c0fcd074
widget path: Use gtk_internal_return_if_fail
2015-09-08 08:07:34 -04:00
Matthias Clasen
38e5a805dc
css style property: Use gtk_internal_return_if_fail
2015-09-08 08:07:34 -04:00
Matthias Clasen
e7a266ad95
css color: Use gtk_internal_return_if_fail
2015-09-08 08:07:33 -04:00
Matthias Clasen
9cd302407f
allocated bitmask: Use gtk_internal_return_if_fail
2015-09-08 08:07:33 -04:00
Matthias Clasen
0368cbd256
window: Use internal more internal getters
2015-09-08 08:07:33 -04:00
Matthias Clasen
2255400db1
Trivial cleanup
2015-09-08 08:07:33 -04:00
Matthias Clasen
64573ea979
widget: Use g_param_spec_get_name_quark
2015-09-08 08:07:33 -04:00
Matthias Clasen
0bee97de5c
stack: Convert to gtk_container_child_notify_by_pspec
2015-09-08 08:07:33 -04:00
Matthias Clasen
838d5beff7
notebook: Convert to g_object_notify_by_pspec
2015-09-08 08:07:33 -04:00
Matthias Clasen
2580c050d8
grid: Convert to gtk_container_child_notify_by_pspec
...
For the same reasons as g_object_child_notify_by_pspec.
2015-09-08 08:07:32 -04:00
Matthias Clasen
1e4369e8ef
box: Convert to gtk_container_child_notify_by_pspec
...
For the same reasons as g_object_child_notify_by_pspec.
2015-09-08 08:07:32 -04:00
Matthias Clasen
93f8f12e39
Add some more child property API
...
Add gtk_container_install_child_properties and
gtk_container_child_notify_by_pspec to mirror te corresponding
GObject APIs.
2015-09-08 08:07:32 -04:00
Matthias Clasen
e3025f2325
scrolled window: Convert to g_object_notify_by_pspec
2015-09-08 08:07:32 -04:00
Matthias Clasen
7cb53685cf
app chooser button: Convert to g_object_notify_by_pspec
2015-09-08 08:07:32 -04:00
Matthias Clasen
4785f460d3
settings: Convert more fully to g_object_notify_by_pspec
...
It turns out that we always have the pspec at hand already.
2015-09-08 08:07:32 -04:00
Matthias Clasen
97a29ab8c4
builder: Simplify _gtk_builder_boolean_from_string
...
We can do this without calling strlen() or allocating memory.
2015-09-07 12:54:16 -04:00
Matthias Clasen
3d01f29bd9
builder: Move a function
...
Move _gtk_builder_boolean_from_string in the same source file
as the other _from_functions.
2015-09-07 12:43:19 -04:00
Matthias Clasen
20079a9960
builder: Minor refactoring
...
Keep the GString in PropertyInfo around, instead of throwing it
away and just keeping the char*.
2015-09-07 12:25:29 -04:00
Matthias Clasen
15b9feda22
widget: Add more inline getters
...
Add a getter for state flags, and use it where appropriate.
2015-09-07 12:23:09 -04:00
Matthias Clasen
9b494df91e
settings: Avoid one case of g_object_notify
...
We already have the GParamSpec in hands, lets just use it instead
of looking it up again.
2015-09-07 11:36:37 -04:00
Matthias Clasen
7cd7257a07
Avoid a string copy
...
We have an api to create a quark from a static string, lets use it.
2015-09-07 11:36:36 -04:00
Benjamin Otte
e1ecdd3ef5
treeview: Donate a priv variable to gtk_tree_view_init()
2015-09-07 14:34:02 +02:00
Benjamin Otte
4daac59941
notebook: Don't needlessly cast in macros
...
That way we disable typechecks done by the compiler and won't notice
when we pass the wrong values to the macro. And that's bad.
2015-09-07 14:33:50 +02:00
Benjamin Otte
f138efa59a
notebook: Remove unused macros
2015-09-07 14:33:40 +02:00
Benjamin Otte
9020b5bd17
stylecontext: Remove line that is a no-op
...
Creating the transient node will already copy the widget type. So
copying again will not do anything.
2015-09-07 14:33:35 +02:00
Benjamin Otte
c8c666c87c
bitmask: Fix broken invert_range() implementation
...
The speed-up in 7da1f8a1ce
was wrong in
certain conditions, even though it didn't trigger the existing
testsuite.
New testcase /bitmask/invert_range_hardcoded included.
2015-09-07 14:32:09 +02:00
Matthias Clasen
0f92a43e10
Move GtkWidgetPrivate to gtkwidgetprivate.h
...
This lets us use inlined getters for members in there,
avoiding the type checks in the public getters.
2015-09-07 02:40:22 -04:00
Matthias Clasen
7da1f8a1ce
Speed up gtk_allocated_bit_mask_invert_range
...
It was showing up on profiles and has a comment asking for speed.
2015-09-07 02:02:07 -04:00
Matthias Clasen
4dc47c3714
Plug a leak
...
A type class reference gotten with g_type_class_ref must be released
with g_type_class_unref, or else we leak.
2015-09-06 19:16:43 -04:00
Matthias Clasen
32001ec638
menu button: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:13:50 -04:00
Matthias Clasen
29b9d48a1f
container: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:13:45 -04:00
Matthias Clasen
943c75fbec
frame: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:13:42 -04:00
Matthias Clasen
c0d9e3a1ad
menu item: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:13:38 -04:00
Matthias Clasen
8ee711bbc9
text buffer: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:13:34 -04:00
Matthias Clasen
65be0f5be9
text cell renderer: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:13:29 -04:00
Matthias Clasen
14c0ed8bae
builder: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:13:25 -04:00
Matthias Clasen
c60362ab10
tree view column: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:37 -04:00
Matthias Clasen
3077a7e025
gesture single: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:37 -04:00
Matthias Clasen
89ca0db7c5
event controller: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:36 -04:00
Matthias Clasen
143d3c1204
radio button: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:36 -04:00
Matthias Clasen
0e4589d902
toggle button: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:36 -04:00
Matthias Clasen
4c376d1a9c
style context: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:36 -04:00
Matthias Clasen
2da31e53b0
treeview: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:36 -04:00
Matthias Clasen
dfe1c63c9b
scale: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:36 -04:00
Matthias Clasen
c3038c2fe1
range: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:36 -04:00
Matthias Clasen
661e51a8e2
header bar: Use g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:35 -04:00
Matthias Clasen
38901acea3
image: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:35 -04:00
Matthias Clasen
5f458e4002
list box: Use g_object_notify_by_pspec everywhere
...
We already have the pspec at hand, so use it.
2015-09-06 17:11:35 -04:00
Matthias Clasen
f4068288e7
entry completion: Convert to g_object_notify_by_pspec
...
This avoid pspec lookup overhead in g_object_notify.
2015-09-06 17:11:35 -04:00
Matthias Clasen
e83ccecfab
entry buffer: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:35 -04:00
Matthias Clasen
dbd5513276
entry: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:35 -04:00
Matthias Clasen
0585780de1
application: Convert to g_object_notify_by_pspec
...
This avoid pspec lookup overhead in g_object_notify.
2015-09-06 17:11:35 -04:00
Matthias Clasen
bfe141c011
progressbar: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:35 -04:00
Matthias Clasen
97b8c2c0aa
label: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:34 -04:00
Matthias Clasen
fbc0012022
adjustment: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:34 -04:00
Matthias Clasen
3906d21f2f
widget: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:34 -04:00
Matthias Clasen
f3d92735ac
window: Convert to g_object_notify_by_pspec
...
This avoids pspec lookup overhead in g_object_notify.
2015-09-06 17:11:34 -04:00
Matthias Clasen
4e56dfad0e
tool button: Use G_DEFINE_TYPE
...
No need to do this manually.
2015-09-06 17:11:34 -04:00
Matthias Clasen
9ebebd48b0
print backend: Remove an unneeded variable
...
The G_DEFINE_TYPE macros automate the parent_class handling.
2015-09-06 17:11:34 -04:00
Matthias Clasen
d92a02f7a4
im module: Remvoe an unneeded variable
...
The G_DEFINE_TYPE macros automate the parent_class handling.
2015-09-06 17:11:34 -04:00
Matthias Clasen
fd682a58de
toggle action: Remove an unused variable
2015-09-06 17:11:33 -04:00
Benjamin Otte
63cefa199a
popover: Don't inherit style from parent
...
Instead, inherit style from toplevel (because that's the default way,
not because it makes lots of sense).
This way, popovers don't inherit the styling from the widget that popped
them up, which is a problem in selected listbox rows, selection-mode
headerbars.
It also doesn't inherit styling where we might want it, like the osd.
But we can only have one of the two things.
2015-09-04 18:59:51 +02:00
Jakub Steiner
5b7bed68a9
HighContrast: make linked entries align
...
- reshuffled the stylesheet to easily allow having a thicker
border, but decided to keep the 1px borders on entries
as it makes easier to spot the buttons despite being flat.
https://bugzilla.gnome.org/show_bug.cgi?id=753129
2015-09-04 15:26:19 +02:00
Rafal Luzynski
7a676cdc14
flow box: Fix bad children allocation with RTL locales
...
If the position of the children is always relative to the box
then we should not take the allocation of the box into account
when flipping the children for RTL text direction.
This patch also removes unused assignments to child_allocation.
https://bugzilla.gnome.org/show_bug.cgi?id=754559
2015-09-04 09:23:52 -04:00
Matthias Clasen
6457ee59be
text view: Drop an unused variable
2015-09-04 02:11:41 -04:00
Matthias Clasen
9f6f4b2004
path bar: Don't use prerendered surfaces
...
The current icon handling did not update icons for widget
state changes, causing black-on-black icons in HighContrast.
Instead, use the GIcon.
https://bugzilla.gnome.org/show_bug.cgi?id=753397
2015-09-04 02:09:43 -04:00
Matthias Clasen
55d6872616
file system: Add an api to get a GIcon
...
Using prerendered surfaces is not working well when it comes
to state changes, so make the GIcon available.
2015-09-04 02:08:59 -04:00
Matthias Clasen
1dc4eea096
text view: Improve cursor hiding logic
...
Same as we did for the entry in the previous commit.
Previously, we just hid the cursor if a key event was adding text,
but not when you used backspace, or Ctrl-V. Rearrange things so that
we obscure the cursor whenever the buffer contents change while we
are handling key events.
https://bugzilla.gnome.org/show_bug.cgi?id=754535
2015-09-03 14:00:27 -04:00
Matthias Clasen
587afb5b1c
entry: Improve cursor hiding logic
...
Previously, we just hid the cursor if a key event was adding text,
but not when you used backspace, or Ctrl-V. Rearrange things so that
we obscure the cursor whenever the buffer contents change while we
are handling key events.
https://bugzilla.gnome.org/show_bug.cgi?id=754535
2015-09-03 14:00:27 -04:00
Lapo Calamandrei
57894ec55b
HC: fix pathbar paddings.
...
See https://bugzilla.gnome.org/show_bug.cgi?id=753397 for
details.
2015-09-03 16:47:52 +02:00
Timm Bäder
1405bcb32d
GtkListBox: Allow a NULL callback in bind_model
...
When unsetting the bound model, one can pass NULL, but in that case the
create_func parameter should also be NULL.
2015-09-03 16:12:15 +02:00
Lapo Calamandrei
1cd9d8a474
Adwaita: fix documents and the like rubberband.
2015-09-02 19:35:35 +02:00
Lapo Calamandrei
b931852e1b
Adwaita: add .content-view:hover styling.
...
Just to make thumbs in various app hilight on hover.
2015-09-02 17:25:06 +02:00
Matthias Clasen
6064ed5181
places view: Avoid a crash in finalize
...
When the places view is finalized before the network loading
is finished, the async operation is cancelled, and the callback
accesses the places view while it is already in a state of
disrepair. Avoid that access.
2015-09-02 07:15:57 -04:00