Commit Graph

45665 Commits

Author SHA1 Message Date
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
Jiri Grönroos
7d0173763e Updated Finnish translation 2016-01-09 21:39:37 +00:00
Matthias Clasen
12bc8ddb93 Fix dobule border rendering
This is the same fix that was applied for ridge and groove
style in 9f27ee7f5a.
2016-01-09 14:37:04 -05:00
Lapo Calamandrei
152171e60c Adwaita: transparent background for progressbar.osd
Hopefully fixes https://bugzilla.gnome.org/show_bug.cgi?id=760331
Added the .osd style class to the progressbar docs.
2016-01-09 20:05:41 +01:00
Lapo Calamandrei
6da0a0a106 gtkheaderbar: add titlebutton styleclass to the separator
...of the window control buttons
2016-01-09 19:27:15 +01:00
Lapo Calamandrei
99365753bf Adwaita: shortcut window related fixes 2016-01-09 18:03:26 +01:00
Lapo Calamandrei
44e0e1359c Adwaita: avoid colorswatch growing when drop targets 2016-01-09 15:30:20 +01:00
Lapo Calamandrei
239303b3f8 Adwaita: more scss cosmetics 2016-01-09 14:36:05 +01:00
Lapo Calamandrei
2050ed04dd Adwaita: rely on background-image for paned wide separators
this workaround fixes the rendering issue coming out using borders
2016-01-09 13:35:48 +01:00
Lapo Calamandrei
4355cb45d7 Adwaita: make the paned wide separator scss code correct
unfortunatelly the results are not, borders behaves in a weird way
here as well, if this don't get fixed I'll rely on background here
too.
2016-01-09 13:04:27 +01:00
Lapo Calamandrei
2b57ba61d5 Adwaita: some scss cosmetic changes 2016-01-09 12:38:49 +01:00