Carlos Garnacho
c0477c2c52
GtkNotebook: Use gdouble in coordinate calculations
...
Otherwise rounding errors fool the "tab under coordinates" checks on
crossing events, which will be triggered close enough to the window
rectangle if the pointer moves slowly enough.
With this, the tab_prelight() function correctly figures out we've
moved the pointer outside the tab area when called in
gtk_notebook_leave_notify().
https://bugzilla.gnome.org/show_bug.cgi?id=759091
2015-12-07 17:40:01 +01:00
Matthias Clasen
4faef48410
notebook: Chain up in direction_changed
...
We do this everywhere else.
2015-11-13 06:41:14 -05:00
Matthias Clasen
c283315466
notebook: Update CSS docs
...
The .header style class is no longer used.
2015-11-09 13:33:58 -05:00
Matthias Clasen
4802b515e4
notebook: Use CSS nodes for arrows
...
This converts the drawing of scroll arrows to use separate CSS
nodes.
2015-11-08 21:08:38 -05:00
Matthias Clasen
5686853c6e
notebook: redo notebook styling
...
Add a header node, and put positional classes on it.
2015-11-08 21:08:38 -05:00
Benjamin Otte
e5ef7dc681
notebook: Fix copy/paste error
...
This is from the recent commit 2a1a483ede
2015-11-07 03:29:44 +01:00
Benjamin Otte
2a1a483ede
notebook: Query the right node's padding
2015-11-06 18:59:15 +01:00
Matthias Clasen
e440050134
Fix the build
2015-10-24 17:04:38 -04:00
Matthias Clasen
f1b7560938
notebook: Document css nodes and style class
...
This will have to be updates as we do further changes to the
way GtkNotebook does its rendering.
2015-10-24 10:54:56 -04:00
Matthias Clasen
8917ee5373
notebook: Drop unneeded code
...
We no longer need to set the position classes on the main css node,
since they are already set on the per-tab subnodes.
2015-10-24 10:39:18 -04:00
Matthias Clasen
f194b9608a
notebook: Use the element name notebook
...
Switch GtkNotebook from using the .notebook style class to
using the element name notebook for its main css node.
2015-10-24 10:39:18 -04:00
Matthias Clasen
e2bfe9e95a
notebook: Cosmetic cleanup
2015-10-24 10:39:17 -04:00
Benjamin Otte
6cf7c03334
notebook: On drag window hide, fix css nodes
2015-10-22 20:29:10 +02:00
Benjamin Otte
ed574408f2
notebook: Remove "prelight-page" class
...
Instead, just use the "tab:hover" selector
2015-10-22 16:42:48 +02:00
Benjamin Otte
182f9a7f39
notebook: Remove "active-page" class
...
Instead, just use the "tab:active" selector
2015-10-22 16:42:48 +02:00
Benjamin Otte
2720d97db3
notebook: Remove funciton by folding it into callers
2015-10-22 16:42:48 +02:00
Benjamin Otte
acd63a6019
notebook: Refactor internal function
...
Don't return the state anymore as the function doesn't even look at the
state. Instead, make the callers that need the state query it manually.
2015-10-22 16:42:48 +02:00
Benjamin Otte
7b9844288a
notebook: Make tab positions permanent
...
... on the tab CssNodes.
2015-10-22 16:42:48 +02:00
Benjamin Otte
dd3f2ec987
notebook: Remove last traces of regions
...
Now that we don't use regions anymore, there's no need to update
anything when the regions change.
2015-10-22 16:42:47 +02:00
Benjamin Otte
f713bcd742
notebook: Set reorderable-page style class properly
...
Set it when the reorderable state changes, not just when rendering.
2015-10-22 16:42:47 +02:00
Benjamin Otte
a4e86341e4
notebook: Set active state properly
...
Don't update it on save/restore, actually set it when it changes.
2015-10-22 16:42:47 +02:00
Benjamin Otte
541926089a
notebook: Set prelight state properly
...
Don't update it on save/restore, actually set it when it changes.
2015-10-22 16:42:47 +02:00
Benjamin Otte
3392d53f61
notebook: Use CssNodes instead of regions
...
This almost makes CSS work again with notebooks.
2015-10-22 16:42:47 +02:00
Benjamin Otte
01f7711307
notebook: Move style_context_save() into function
...
This is for future changes.
2015-10-22 16:42:47 +02:00
Alexander Larsson
d5f1754981
gtk: Stop setting GDK_EXPOSURE_MASK on random widgets
...
These days exposure happens only on the native windows (generally the
toplevel window) and is propagated down recursively. The expose event
is only useful for backwards compat, and in fact, for double buffered
widgets we totally ignore the event (and non-double buffering breaks
on wayland).
So, by not setting the mask we avoid emitting these events and then
later ignoring them.
We still keep it on eventbox, fixed and layout as these are used
in weird ways that want backwards compat.
2015-09-14 11:01:13 +02: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
838d5beff7
notebook: Convert to g_object_notify_by_pspec
2015-09-08 08:07:33 -04: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
Carlos Garnacho
3e60650fa8
notebook: Fix assert in ::drag-motion
...
The drag destination might be empty, we shouldn't be checking whether
it contains pages at all. Instead, check the source notebook, which
ought to have a selected page if you're dragging something from there.
https://bugzilla.gnome.org/show_bug.cgi?id=749893
2015-05-26 18:05:36 +02:00
Benjamin Otte
0529e15d61
notebook: Protect against invalid allocations
...
A widget can be mapped but not have a size allocated yet. In that case
avoid computing a broken rectangle.
https://bugzilla.gnome.org/show_bug.cgi?id=746301
2015-03-18 15:14:47 +01:00
Matthias Clasen
c7672699e9
Don't pass invalid rectangles to cairo
...
This causes pixman warnings, or worse.
Clearly, something is not quite right here, if we end up
redrawing tabs at a time when the allocation is set to (1, 1).
For now, avoid straining the error handling in the lower layers.
https://bugzilla.gnome.org/show_bug.cgi?id=746301
2015-03-16 12:51:56 -04:00
Philip Withnall
d65ccf96ee
gtknotebook: Add more non-NULL checks for cur_page
...
These were not spotted by scan-build, but from some brief mental
reasoning could potentially be problem areas.
https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-11 11:24:29 +00:00
Benjamin Otte
9e2cdce58e
notebook: Fix boolean check
...
Commit c352093bde
swapped the condition
when turning it into a return_if_fail().
2015-03-10 13:23:06 +01:00
Philip Withnall
c352093bde
gtknotebook: Fix potential use of uninitialised variables
...
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-10 07:32:19 +00:00
Philip Withnall
51971d56bc
gtknotebook: Remove dead variable assignments
...
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Philip Withnall
c7f5f10853
gtknotebook: Fix a potential NULL pointer dereference
...
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-09 13:41:37 +00:00
Matthias Clasen
8d7a235a04
notebook: Add api to complete tab dnd from the outside
...
This is necessary to avoid unwanted drag cancel animations,
now that GtkNotebook is careful about cancelling a drag
when the dragged tab disappears unexpectedly.
2015-02-12 17:33:10 -05:00
Matthias Clasen
3fc21b4f3f
notebook: Protect removal-from-within
...
When a tab is dropped, we have to remove it from the notebook to
insert it elsewhere. This is expected part of the tab dnd operation,
and we need to differentiate it from 'spontaneous' removals which
cause us to cancel the drag operation.
2015-01-30 10:13:28 -05:00
Matthias Clasen
63104944a3
notebook: Make dnd safe against tab disappearance
...
when the dragged tab is being removed during the drag operation,
we need to cancel the drag. To do so, we have to keep around
a reference to the drag context.
This should fix
https://bugzilla.gnome.org/show_bug.cgi?id=732051
2015-01-30 10:13:15 -05:00
Matthias Clasen
3a05d9b5a0
notebook: Make reordering safe for tab disappearance
...
If the dragged tab is removed during reordering, we need to
call gtk_notebook_stop_reorder(), to clean up and bring the
remaining tabs back in order.
2015-01-30 09:39:26 -05:00
Matthias Clasen
5127136723
GtkNotebook: Be a bit more safe against cur_page being NULL
...
https://bugzilla.gnome.org/show_bug.cgi?id=477454
2014-12-22 10:52:54 -05:00
Jasper St. Pierre
a78b18c565
Revert part of "gtknotebook: Optimize GtkStyleContext usage"
...
This reverts part of commit c71e213134
.
This part was unfinished and was pushed simply to avoid the warnings.
2014-11-25 11:21:21 -08:00
Jasper St. Pierre
c71e213134
gtknotebook: Optimize GtkStyleContext usage
2014-11-25 11:05:49 -08:00
Benjamin Otte
cde81e169b
notebook: Don't unset state flags on child removal
...
We don't set any state flags, so we shouldn't unset any either.
2014-07-19 23:48:06 +02:00
Benjamin Otte
93b3179042
widgetpath: Deprecate regions
...
This is a foolowup to d80bf0790d
2014-06-21 15:46:44 +02:00
Benjamin Otte
d80bf0790d
stylecontext: Deprecate regions
...
Regions are done in a very non-css way. They don't fit the DOM in that
they don't integrate into the CSS tree and they have very weird matching
behavior in selectors.
So I'm deprecating them now. GtkNotebook and GtkTreeview will continue
to use them and as long as they do, we can't remove the code for it.
But once those are ported it might be safe to remove the code as it will
clean up lots of places in the code by quite a bit.
2014-06-19 22:26:51 +02:00
Matthias Clasen
f0f9c2aa37
Revert "gtkbin: replace internal api"
...
This reverts commit 0f4751c08e
.
This causes warnings from the notebook and combobox code.
2014-06-16 17:31:56 -04:00
Paolo Borelli
c184458ab3
notebook: set tab position style class on the main frame
...
We want to have .top etc also on the notebook frame, not only on
the header frame.
The patch includes a reftest by Benjamin.
2014-06-14 21:37:07 +02:00
Stefan Sauer
0f4751c08e
gtkbin: replace internal api
2014-06-14 08:10:46 +02:00