Commit Graph

45825 Commits

Author SHA1 Message Date
Benjamin Otte
d74c1bfd84 notebook: Remove outdated style properties from themes
No replacement provided, the notebook will have to be redone anyway.
2016-01-11 17:06:46 +01:00
Benjamin Otte
8020d5f93a notebook: Don't store gadget allocation twice
If we care about a gadget's allocation, we can ask it. There's no need
to store it in GtkNotebookPage.allocation.
2016-01-11 17:05:24 +01:00
Benjamin Otte
2ef3b01442 notebook: No need to recompute remaining space
The value is correct.

In particular, subtracting width on notebooks with tabs on left/right is
a very bad idea.
2016-01-11 17:05:24 +01:00
Benjamin Otte
4c083f8182 notebook: Port arrows to be gadgets
Also deprecate the arrow-spacing style property.
2016-01-11 17:05:24 +01:00
Benjamin Otte
326fda1b0e notebook: Pass full allocation instead of min and max value 2016-01-11 17:05:24 +01:00
Benjamin Otte
96f0cf7677 notebook: Pass allocation as argument
... instead of querying it later.
2016-01-11 17:05:23 +01:00
Benjamin Otte
6b8c191096 notebook: Simplify allocation code 2016-01-11 17:05:23 +01:00
Benjamin Otte
0e48216c48 notebook: Identify existence of arrows differently
Instead of having gbooleans in the priv struct, just look at the
existence of priv->arrow_node[i].
2016-01-11 17:05:23 +01:00
Benjamin Otte
a12e1328e9 notebook: Convert tab nodes to gadgets
The code does many bad things, so we get a lot of warning spew. Ignore
this for now, fixes will follow.
2016-01-11 17:05:23 +01:00
Benjamin Otte
d780ce3ff3 notebook: Assume tab allocations always change
This causes more redraws, but saves a bunch of code.
2016-01-11 17:05:23 +01:00
Benjamin Otte
7e0c7f7deb notebook: Remove weird hack where the current page was special-cased
I don't even know what it does, but it assumed that the current page was
always as large or larger than any other page. And that isn't true.
2016-01-11 17:05:23 +01:00
Benjamin Otte
3cda7e9503 boxgadget: Handle css nodes
Automatically insert the cssnode into the box gadget's node's children at
the right place and remove it again when done.
2016-01-11 17:05:23 +01:00
Benjamin Otte
a9320d93f6 notebook: Replace redraw_tabs() with gadget_queue_draw(tabs_gadget) 2016-01-11 17:05:23 +01:00
Benjamin Otte
f83c1fedbc notebook: Don't queue redraw of tabs junction
There is no junction anymore, so don't try to redraw it.
2016-01-11 17:05:23 +01:00
Benjamin Otte
f1e277969a gadget: Add queue_resize/allocate/draw() functions 2016-01-11 17:05:23 +01:00
Benjamin Otte
e1722baf57 notebook: Convert tabs node to a gadget
And in turn, convert the header gadget to a box gadget.
2016-01-11 17:05:23 +01:00
Benjamin Otte
acc534ebfa boxgadget: Add
Adds a GtkBoxGadget that is a Gadget that behaves like a GtkBox.

Use this gadget to implement the notebook base gadget.
2016-01-11 17:05:23 +01:00
Benjamin Otte
749855c1d1 notebook: Remove unused function call 2016-01-11 17:05:23 +01:00
Benjamin Otte
70b9aacfc2 notebook: Simplify event window position computation
The event window should overlay the header gadget, so just return its
position.
2016-01-11 17:05:23 +01:00
Benjamin Otte
ad245e0226 notebook: Introduce gtk_notebook_has_current_page()
GtkNotebook does not switch the current page if all pages are hidden. So
it may be that no visible page exsits, but there still is a current
page set.

We culd clear the current page, but I'm unsure about backwards
compatibility.

So instead, this new function handles that case.
2016-01-11 17:05:23 +01:00
Benjamin Otte
0d72055b89 notebook: Use gtk_container_class_handle_border_width() 2016-01-11 17:05:23 +01:00
Benjamin Otte
f34059c3b6 notebook: Convert header node to a gadget
This allows reworking the content node to do real height-for-width.

The content node also takes care of border width, but we might want to
have the toplevel do it or just get rid of it.
2016-01-11 17:05:22 +01:00
Benjamin Otte
8c1a73326c gadget: Add helpers for modifying state
They will be used in future commits.

I also was too lazy to convert existing widgets.
2016-01-11 17:05:22 +01:00
Benjamin Otte
e27551ddb2 notebook: Add a stack gadget
The stack gadget contains all the child widgets.
2016-01-11 17:05:22 +01:00
Benjamin Otte
c03fed4840 notebook: Remove extra calls to gtk_notebook_pages_allocate()
The function is called during size_allocate() and doesn't need to be
called elsewhere, as all other callers call queue_resize() already.
2016-01-11 17:05:22 +01:00
Benjamin Otte
33b6e30f68 notebook: Remove unnessecary gtk_widget_set_mapped()
We chain up, and the chainedup function calls this for us.
2016-01-11 17:05:22 +01:00
Benjamin Otte
dc4148c4e2 notebook: Simplify gtk_notebook_map()
We set visibility on our children properly, so we can simply chain up
and let the GtkContainer implementation do the mapping of children.
2016-01-11 17:05:22 +01:00
Benjamin Otte
22398ef459 notebook: Remove irrelevant case
The page is never the current page, because it was just created and the
current page wasn't changed yet.
2016-01-11 17:05:22 +01:00
Benjamin Otte
0e528ec74e notebook: No page switching in size request code
We have page switching under control now, we don't need to check every
get_preferred_size() call.
2016-01-11 17:05:22 +01:00
Benjamin Otte
1190efebce notebook: Set the current page when none is set
This case happens when you gtk_widget_show_all (notebook).
2016-01-11 17:05:22 +01:00
Benjamin Otte
0045e57e96 notebook: Draw the same things, no matter the show-border value
show-border modifies the "frame" style class on the notebook node, but
not what we actually draw.
2016-01-11 17:05:22 +01:00
Benjamin Otte
fd9ffe5d57 notebook: Turn the base notebook into a gadget 2016-01-11 17:05:22 +01:00
Benjamin Otte
92089ee29e notebook: Draw tab label while drawing tab
Instead of having special case code doing it.
2016-01-11 17:05:22 +01:00
Benjamin Otte
3d980da405 notebook: Don't translate before painting notebook
This will allow us to draw children directly from within the notebook
drawing code, which will remove a bunch of special casing.
2016-01-11 17:05:22 +01:00
Benjamin Otte
93dc364b02 notebook: Deprecate and stop supporting has-tab-gap style property 2016-01-11 17:05:22 +01:00
Benjamin Otte
71cc212eb5 notebook: Ignore and deprecate style properties
Deprecate initial-gap, tab-curvature and tab-overlap properties. All
their features can be achieved using CSS.

This CSS achieves the same effect as a 10px initial gap:
  notebook header {
    margin-left: 10px;
    margin-right: 10px;
  }

A tab overlap of 10px can be achieved via:
  notebook tabs {
    margin-left: 10px;
  }
  notebook tab {
    margin-left: -10px;
  }

And tab curvature is essentially the same as padding or border on a tab.
2016-01-11 17:03:07 +01:00
Benjamin Otte
0138af9f96 rendericon: Save and restore cairo matrix
... instead of requiring cairo_save()/cairo_restore().
2016-01-11 17:03:07 +01:00
Benjamin Otte
4e627e108e testnotebookdnd: Add an action widget
Just so we have some test that tests action widgets.
2016-01-11 17:03:07 +01:00
Benjamin Otte
fa7816d99c dnd: When setting a dnd icon widget, unset old one
Setting a DND icon twice should actually work and not cause warnings the
2nd time.
2016-01-11 16:56:16 +01:00
Jiro Matsuzawa
fb0a628975 Updated Japanese translation
Change B series paper names in accordance with the Japanese standards.
2016-01-11 23:58:16 +09:00
Krzesimir Nowak
67c6d24bb2 Fix a small mistake in stylecontext docs
Fix the "will be also be" to become "will also be".
2016-01-11 12:05:27 +01:00
Dušan Kazik
7a06e0102d Updated Slovak translation 2016-01-11 09:48:05 +00:00
Matthias Clasen
b035cc2cb6 Update style class docs
Instead of pointing to (outdated) widgets here, just refer to
widget docs in general.
2016-01-10 17:08:56 -05:00
Matthias Clasen
cffe2e2c93 Improve GtkStyleContext docs
Refer to the foreign drawing example in gtk3-demo, refer to
the widget documentation for style properties, remove
no-longer-used treeview regions.
2016-01-10 17:05:53 -05:00
Matthias Clasen
7ee65da0e3 Add foreigndrawing example to gtk3-demo
This makes it easier accessible and nicer to refer to
from the documentation.
2016-01-10 15:32:53 -05:00
Matthias Clasen
6d239cfba7 Add a css style test for adjacent states
This test checks that the selector E:state + F works as expected.

https://bugzilla.gnome.org/show_bug.cgi?id=722727
2016-01-10 14:51:36 -05:00
Ting-Wei Lan
0f120ea510 Cast the return value of g_array_free to void* before casting to char**
Let the compiler know that we don't want to use it as char*, so there is
no alignment error.

https://bugzilla.gnome.org/show_bug.cgi?id=760350
https://bugzilla.gnome.org/show_bug.cgi?id=755659
2016-01-11 00:23:46 +08:00
Rico Tzschichholz
2dc8d1f611 GdkSeat: Fix annotation of gdk_seat_grab() 2016-01-10 16:49:42 +01:00
Matthias Clasen
0ddc1eed19 Fix rendering of unsymmetric borders
There was an errant path that threw off our clipping for
the top section of the border.

https://bugzilla.gnome.org/show_bug.cgi?id=722937
2016-01-09 23:44:43 -05:00
Matthias Clasen
caaf537f94 Avoid division by 0 in the border rendering code
We skip sides with 0 border width in render_border, but when
we collect sides with the same style, we may pass the 0 width
down to render_frame_stroke anyway. So skip width 0 sides
there as well.
2016-01-09 23:44:43 -05:00