Commit Graph

25885 Commits

Author SHA1 Message Date
Timm Bäder
6e2c551896 entry: Fix icon areas
Do the same thing we already do in gtk_entry_get_text_area.
2016-01-31 20:05:52 +01:00
Timm Bäder
033c6c82d0 widget: Annotate out params of _translate_coordinates as optional 2016-01-31 20:05:52 +01:00
Matthias Clasen
073f8bc44b gtk-builder-tool: Expand the preview command
Make the preview command parse options properly, turn the ID into
an --id=ID option, and add a --css=FILE option that allows to
specify a css file to use for previewing.

This is useful for e.g. previewing the reftest .ui files with
their corresponding .css.
2016-01-31 13:09:43 -05:00
Matthias Clasen
bc882a679d gtk-launch: Add --version
Support --version. Also improve the --help output cosmetically.
2016-01-31 12:11:58 -05:00
Matthias Clasen
836bd65408 gtk-builder-tool: Accept --help
Saying 'Failed to open file '--help' is not polite or smart.
Catch this case and show usage information.
2016-01-31 11:02:53 -05:00
Matthias Clasen
f793da54a9 file chooser: Avoid a crash
Since 39c2d12330,
priv->operation_mode == OPERATION_MODE_BROWSE no longer
guarantees that priv->browse_files_model is the current
model of the list - we are only switching the models after
loading the new directory. Avoid triggering the assertion
in show_and_select_files by checking if we have right model
before calling it.

https://bugzilla.gnome.org/show_bug.cgi?id=761209
2016-01-30 23:07:56 -05:00
Matthias Clasen
6f74de5331 Don't include the builtin sequence table in multiple places
The table is defined as static const guint16 [], so it really
should only be included in one source file.
2016-01-30 22:52:13 -05:00
Matthias Clasen
3c4f36f622 combobox: Avoid a misleading indentation
gcc 6 warns about this sort of thing. There were also some
stray ; here.
2016-01-30 22:50:54 -05:00
Matthias Clasen
7d16b8df29 treeview: Draw background when empty
We have a function we call for drawing the empty case, but
it only renders a focus rectangle. Make it draw the background
as well.

https://bugzilla.gnome.org/show_bug.cgi?id=761309
2016-01-30 18:31:30 -05:00
Timm Bäder
16726e31f0 colorchooserwidgeet: Reset the selected swatch when removing
Otherwise, priv->current points to garbage and subsequently leads to a
crash, e.g. when adding another custom color.
2016-01-30 23:02:06 +01:00
Matthias Clasen
dd322f715f Document gtk_parse_args limitations
Mention that some things won't work without a display
connection.
2016-01-30 16:11:03 -05:00
Matthias Clasen
bbe48d0624 Throw an error when a display is missing
Creating style context won't work without a display, so
give a clear error message and abort instead of segfaulting
later on.

https://bugzilla.gnome.org/show_bug.cgi?id=761332
2016-01-30 16:06:59 -05:00
Matthias Clasen
051b6071b7 Adwaita: Add symbolic png assets
And use them as fallback for the svg ones. This lets us
avoid a hard dependency on librsvg - the theme will work
without svg support.
2016-01-30 00:29:04 -05:00
Matthias Clasen
e54549502e icontheme: Avoid a crash
gtk_icon_info_new_for_file with a size of 0 would fail for
symbolic pngs because we ended up scaling with 0. Avoid this.
2016-01-30 00:29:04 -05:00
Matthias Clasen
2e4b1e72f4 css: Support the image() notation
This lets us do fallback in case an image format is not
supported, and also lets us provide solid-color images.
We don't support image fragment notations.

See ttps://www.w3.org/TR/css3-images/#image-notation

https://bugzilla.gnome.org/show_bug.cgi?id=761318
2016-01-30 00:29:04 -05:00
Matthias Clasen
0fe468c789 Emit an error if image loading fails
Instead of spamming stderr with g_warning, use the new
emit_error method of the GtkStyleProviderPrivate interface
to emit an error if loading an image fails.
2016-01-30 00:29:04 -05:00
Matthias Clasen
2c7fdf6432 CSS provider: Add a way to emit errors
Currently, GtkCssProvider can emit ::parsing-error only during
the actual parsing, although the documentation hints that it might
happen at other times.

This commit adds a emit_error method to the GtkStyleProviderPrivate
interface that will let us emit errors from the compute() implementations
as well, which can be useful (e.g. if an image fails to load).
2016-01-30 00:29:04 -05:00
Matthias Clasen
176e85ffe5 file chooser: Make Escape close the dialog
In some situations (no header bar, save mode), hitting Escape
would not do anything because the entry ate the key event.
Fix this by telling the entry to only handle Escape when there
is something to do, such as switching back to the path bar.

https://bugzilla.gnome.org/show_bug.cgi?id=761026
2016-01-29 19:12:51 -05:00
Matthias Clasen
b281c9d740 css image recolor: Load images at the proper scale
We should not hardcode a scale of 1, this leads to
pixellated upscaled images at scale=2, even if the source
is an svg. By passing the proper scale, we can load the
svg at the correct size.
2016-01-29 17:30:10 -05:00
Matthias Clasen
001598a821 icon theme: Improve loading of unthemed files
When creating icon info objects for unthemed files, we don't
really have a nominal size, so we pass 0 to mean 'load at
original size'. However, this is not what was happening.
To make this possible, add variants of some pixbuf loading
functions that take a scale factor instead of a desired size,
and use those when we don't have a nominal size.
2016-01-29 17:27:35 -05:00
Matthias Clasen
68edc67bde image: use GtkMisc padding again
This was lost in the gadget conversion.
Thankfully, the misc-alignment reftest catches this.
2016-01-29 13:44:45 -05:00
Lapo Calamandrei
fac5ed6165 Adwaita: reset padding on notebook tab close button 2016-01-29 18:09:28 +01:00
Lapo Calamandrei
813cc34857 Adwaita: fix border radius on #editor-color-sample 2016-01-29 17:48:45 +01:00
Lapo Calamandrei
31cc642288 Adwaita: notebook style rewrite 2016-01-29 17:17:47 +01:00
Matthias Clasen
7d75d5ec66 builder tool: Add a preview command
This was somewhat missing, and is easy to add.
2016-01-29 09:39:41 -05:00
Matthias Clasen
7fc0600f92 infobar: Don't expose implementation details
Only export the documented widgets as internal children.
2016-01-28 22:49:36 -05:00
Matthias Clasen
3014aab25c searchbar: Don't expose implementation details
The various boxes and the revealer here should not be exposed
as internal children for subclasses to use in their .ui files.
2016-01-28 22:47:28 -05:00
Matthias Clasen
0bf987c611 actionbar: Don't expose implementation details
The box and revealer here should not be exposed as internal
children for subclasses to use in their .ui files.
2016-01-28 22:39:31 -05:00
Matthias Clasen
a7489153b0 dialog: Stop exporting action_box
This was not meant as an internal child that subclasses
can refer to in their .ui files.

https://bugzilla.gnome.org/show_bug.cgi?id=761254
2016-01-28 22:36:27 -05:00
Matthias Clasen
3dce876555 print dialog: Stop using action_box in .ui
We can just use CSS margins nowadays to achieve the desired
appearance.
2016-01-28 22:29:30 -05:00
Matthias Clasen
a99c69fd6b label: fix a case of misleading indentation
gcc 6 complains aobut things like this.
2016-01-28 20:50:50 -05:00
Carlos Garnacho
0125aa0a41 gtkdnd: Fix deprecation compile warnings
Grabbing must stay a bit longer until all other backends than x11/wayland
catch up with GDK DnD, so ignore deprecation flags are used on those. The
uses of GdkDeviceManager can be entirely avoided though.
2016-01-28 12:50:49 +01:00
Christoph Reiter
27263f2387 label: use GtkMisc padding again
this was lost in the gadget conversion in a81267c28e

https://bugzilla.gnome.org/show_bug.cgi?id=760522
2016-01-28 11:04:48 +01:00
Matthias Clasen
79fb921ffc spin button: Document sizing peculiarities
Document that it is best to explicitly set width-chars and
max-width-chars to avoid surprises.

https://bugzilla.gnome.org/show_bug.cgi?id=727294
2016-01-27 23:30:25 -05:00
Matthias Clasen
03f4666994 composetable: Don't abort on unsupported escape sequences
People might put all sorts of gunk in their .XCompose file, in
the hope that XLib makes sense of it. Even if we don't make sense
of it, we shouldn't abort, but instead ignore the lines we can't
understand. Pointed out in
https://bugzilla.redhat.com/show_bug.cgi?id=1301254
2016-01-27 23:22:02 -05:00
Matthias Clasen
b8a0f3582b Update README.glade
Update the README.glade file to use current .ui file
names and locations as example.
2016-01-27 15:20:15 -05:00
Matthias Clasen
625f3e5f39 window: Always disconnect signal handlers
We connect to the titlebar widgets change notification regardless
whether it is internally created or not, so don't make the signal
handler disconnection conditional on that either.
2016-01-27 13:09:40 -05:00
Matthias Clasen
88c3456d2f assistant: Avoid tripping template tests
We need to unset the titlebar manually before chaining up
in destroy, otherwise we trigger the template invariant
checking - GtkWindow would eventually unset it, but too late
for the invariants checking code in gtk_widget_destroy.
2016-01-27 13:09:40 -05:00
Allison Ryan Lortie
0d109867d2 Tweak startup-notification after the first window
Presently, Gtk will only send a startup notification completion message
for the first window that is shown.  This is not good for the case of
GtkApplication, where we are expected to participate in
startup-notification for all windows.

We have avoided this problem by manually emitting the startup complete
message from after_emit in GtkApplication.

Unfortunately, this causes problems for windows that are shown with a
delay.  It is also a dirty hack.

The reason for the original behaviour is simple: there is a static
boolean in gtkwindow.c which controls it.  We remove this.

Instead, clear the startup notification ID stored in GDK when sending
the completion message.  GtkApplication will re-set this the next time
an event comes in which needs startup-notification handling.  In the
non-GtkApplication case, newly shown windows will still not send the
message, since the cookie will have been cleared.

Finally, we remove the hack from GtkApplication's after_emit.

This will probably cause some regressions in terms of lingering startup
notification messages.  The correct solution here is to always use
gtk_window_present(), including when merely opening a new document (with
a new tab, for example).

https://bugzilla.gnome.org/show_bug.cgi?id=690791
2016-01-27 18:14:40 +01:00
Timm Bäder
299b32438d modelbutton: Use indicator state for button gadget if iconic 2016-01-27 16:34:22 +01:00
Krzesimir Nowak
09677f7331 entry: Fix a typo 2016-01-27 14:29:40 +01:00
Benjamin Otte
c4f7fbecfa entry: Fix a case of disagreeing coordinate systems
gesture_get_current_point() returned x/y in layout coordiantes, but
callers assumed it in textarea coordinates.
2016-01-27 14:04:21 +01:00
Cosimo Cecchi
2533289b62 Adwaita: fix spinbutton styling
Spinbuttons were quite broken after the latest changes. This commit
brings the style back around what it was for 3.18.
2016-01-27 12:26:21 +01:00
Matthias Clasen
4c192ea4c3 Adwaita: Add some themeing for entry undershoot
This is just copying what we do for scrolled windows.
It will need some tweaks to look good for entries.
2016-01-26 23:36:18 -05:00
Matthias Clasen
a9222146d3 entry: give a visual clue that content is scrolled
This has been requested long ago, and we now have the
machinery to implement it easily.
2016-01-26 23:36:18 -05:00
Matthias Clasen
8991f17d49 box gadget: Improve assertion message
Include the owner of the gadget in the assertion message,
to improve the chances of tracking down whats actually
going wrong here.
2016-01-26 22:11:54 -05:00
Matthias Clasen
745624235b color button: Allow skipping the palette
Allow skipping the palette in the dialog, and going directly
to the editor. This is useful when the color button is already
part of a palette.
2016-01-26 21:27:12 -05:00
Matthias Clasen
cf3a781d32 Fix a typo 2016-01-26 20:57:50 -05:00
Benjamin Otte
a222aa66d5 entry: Compute selection range correctly
gtk_editable_get_selection_bounds() returns UTF-8 character offsets,
but gdk_pango_layout_get_clip_region() wants byte ranges, so convert
from one to the other.
With English, this is especially visible for passwords, which use ●
as the invisible character.

https://bugzilla.gnome.org/show_bug.cgi?id=761128
2016-01-27 02:11:06 +01:00
Benjamin Otte
84b788c4a5 window: Deprecate gtk_window_parse_geometry()
Geometry handling in GTK is deprecated.
2016-01-27 02:11:06 +01:00
Benjamin Otte
b22fdf24e0 window: Deprecate gtk_window_set_default_geometry()
We don't support geometries anymore.
2016-01-27 02:11:06 +01:00
Benjamin Otte
ae31c00092 spinbutton: Don't expand the buttons
When the spinbutton grows larger, distribute horizontal size to the
entry and vertical size to the buttons.

Obviously, horizontal size only matters for horizontal spinbuttons and
vertical for vertical spinbuttons.
2016-01-26 17:59:08 +01:00
Benjamin Otte
2c350f4469 stack: realize windows in correct position 2016-01-26 16:40:27 +01:00
Benjamin Otte
8ea697c434 pathbar: Use CSS node ordering
Instead of the custom get_path_for_child() function.
2016-01-26 15:53:56 +01:00
Benjamin Otte
9d0e8401ca stack: Turn into no-window widget
Having priv->view_window be the same as widget->window does not make
sense.

And because we need to clip the content area, we need the view window.
2016-01-26 15:53:56 +01:00
Benjamin Otte
fefc370f6c entry: Chain up in realize()
... instead of copy/pasting what gtk_widget_real_realize() does.
2016-01-26 15:53:56 +01:00
Benjamin Otte
5a3a86ec4b spinbutton: Add a base gadget
This really messes up rendering in Adwaita because the code now renders
the spinbutton's entry node when it didn't before.
2016-01-25 16:14:23 +01:00
Benjamin Otte
ad7bbbf9d8 entry: Use cleverer method to get the entry node 2016-01-25 15:49:17 +01:00
Benjamin Otte
3982f05be4 entry: Move spinbutton size hack
If we want to do special sizing for the text, we need to do it for the
text. Otherwise paddings, borders and entyr icons will screw up
everything.
2016-01-25 15:49:17 +01:00
Benjamin Otte
02fab14b3b entry: Move code
This movement is necessary for future gadgetization of GtkSpinButton.
2016-01-25 15:49:17 +01:00
Benjamin Otte
b52b4068af entry: Redo textarea handling
(1) Keep priv->text_allocation for the area used by the text
(2) Compute all text coordinates with the help of priv->text_allocation

As a side effect the get_text_area_size and get_frame_size vfuncs are
now unused. If we wanted them back, they should get a single use durig
size_allocate() and then their results should be stored for further
processing.
2016-01-25 15:49:17 +01:00
Benjamin Otte
c709072567 entry: Use gtk_render_layout()
It's funny that nobody has yet noticed that we don't draw the text using
the theme.

We had no text-shadow in entries!!!!!
2016-01-25 15:49:17 +01:00
Benjamin Otte
a363fd5fd3 entry: Draw selection the same way as GtkLabel 2016-01-25 15:49:17 +01:00
Benjamin Otte
ca690162af entry: Fold function into only caller 2016-01-25 15:49:17 +01:00
Benjamin Otte
0ae8b30210 entry: Don't allow different text over progress
This complicates refactorings, so remove that feature. It's not used
anywhere and doesn't play well with nodes the way it's implemented.
If we want it back, we can add it back later.
2016-01-25 15:49:17 +01:00
Matthias Clasen
e8ad47498b path bar: Don't hide arrows
Changing the visibility of child widgets in size-allocate does
not work well with out current allocation and layout machinery.
To avoid the visual fallout, just keep the arrow buttons visible
and only change their sensitivity.

https://bugzilla.gnome.org/show_bug.cgi?id=754868
2016-01-24 16:29:40 -05:00
Matthias Clasen
761120a5e2 inspector: Show CSS pseudoclass names for node state
This is a better fit for showing CSS node state, since one
commonly looks at this information to devise CSS selectors,
where the CSS names are needed.
2016-01-24 10:59:46 -05:00
Matthias Clasen
33bb1af277 css: Privately export a function to get pseudoclass names
This function centralizes the mapping for widget states
to pseudoclass names in one place, for easier maintenance.
2016-01-24 10:59:46 -05:00
Timm Bäder
d6f989f59c Inspector: Plug a few leaks 2016-01-24 08:01:36 +01:00
Matthias Clasen
43747a6b30 paned: Initialize max_position
As pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=608865
max_position should be set to G_MAXINT.
2016-01-24 00:22:31 -05:00
Matthias Clasen
a80b555274 color editor: Ensure spin buttons are wide enough
If we don't explicitly ask for 2 chars to be visible, we might
get less, and it doesn't look great.
2016-01-23 18:26:09 -05:00
Sebastien Lafargue
526fd89ec5 GtkColorChooser: make set_rgba work in editor mode
When using the color chooser in editor mode,
gtk_color_chooser_set_rgba need to be propaged
to the editor

https://bugzilla.gnome.org/show_bug.cgi?id=761005
2016-01-23 18:16:51 -05:00
Matthias Clasen
8ba996a6db container: Clarify the forall/foreach documentation
Try to make the difference between these two functions
clearer.
2016-01-23 18:16:51 -05:00
Timm Bäder
ddbafa023a overlay: Don't access priv pointer before typ check 2016-01-23 10:30:53 +01:00
Matthias Clasen
8096740ea4 levelbar: Document CSS node ordering 2016-01-22 23:30:36 -05:00
Matthias Clasen
2cf983eb30 notebook: Document CSS node order 2016-01-22 23:14:09 -05:00
Matthias Clasen
73307f78dc box gadget: Don't allow shifting too far
We don't want to let baseline adjustment shift the child
out of the original allocation. This is purely a sanity
measure - in practice, the baseline should always be bigger
than the child_baseline.
2016-01-22 22:49:01 -05:00
Matthias Clasen
50e923349e box gadget: Fix baseline calculation
Careful comparison with GtkBox revealed that the box gadget
code was confusing up and down, and thus shifted baselines
vertically.
2016-01-22 22:47:47 -05:00
Matthias Clasen
57baf6804b inspector: Show baseline value
The misc info page already shows the allocation and clip areas,
the baseline fits right in.
2016-01-22 22:24:46 -05:00
Matthias Clasen
e26300625f box gadget: Fix baseline allocation for widgets
We were adjusting the allocation to line up baselines before
calling gtk_widget_size_allocate_with_baseline, but that function
is doing this alignment internally anyway and expects to be given
a 'fill' allocation.

Move the allocation adjustment code down into
gtk_box_gadget_allocate_child where it only affects child gadgets,
not child widgets.
2016-01-22 22:08:38 -05:00
Matthias Clasen
029d568b04 gadget: Add baseline debugging
This should help to understand whats going wrong with
baselines.
2016-01-22 21:34:54 -05:00
Matthias Clasen
5469f26260 Adwaita: Move .ssd class around
Make the theme follow our documentation for the various .csd and
.ssd style classes: They all go on the window node. For now, just
add the new selector; the old one will be removed when mutter has
been updated.

https://bugzilla.gnome.org/show_bug.cgi?id=760714
2016-01-22 19:23:54 -05:00
Matthias Clasen
3d52fd3992 box gadget: Fix height-for-width handling
When measuring children while distributing a given height,
we must measure them for the given width that goes with
the height. Otherwise, things will go wrong if some of the
children do actual width-for-height. This was showing up
as misaligned images in anaconda.

https://bugzilla.gnome.org/show_bug.cgi?id=760967
2016-01-22 17:15:33 -05:00
Carlos Garnacho
f32a54fb70 GtkTreeView: Update prelight row after revalidating rows
It might have changed (eg. after a row being expanded, and the child
rows revalidated), so just update it here based on the last pointer
position.

Based on a patch by Maxim Reznik <reznikmm@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=760891
2016-01-22 21:18:24 +01:00
Carlos Garnacho
a5f9dc1284 GtkTreeView: Avoid device query on collapsing rows
The pointer position is queried to properly trigger the prelight
updates on the new row below it. We store the last coordinates
though, and track crossing events to unset these, so it's safe
to just update_prelight() here on these.
2016-01-22 21:18:24 +01:00
Benjamin Otte
0a9e9db9f4 shortcuts: Don't forall() widgets that aren't children 2016-01-22 20:39:14 +01:00
Benjamin Otte
efc899bd2b widget: Improve gtk_cairo_should_draw_window()
Check that non-native window are indeed children of the event window and
only then confirm that they should be drawn.

Fixes Glade thinking that it's okay to have the draw function do
different things depending on what window to draw. (This should really
be fixed in Glade.)
2016-01-22 14:18:15 +01:00
Benjamin Otte
74c3468d64 cssstyleproperty: Don't allow assigning min-width/min-height 2016-01-22 14:18:15 +01:00
Benjamin Otte
d4f853dc64 container: Turn assert into return_if_fail()
There's no reason to insta-crash when something goes wrong. Just don't
do anything stupid.

Also, remove the SPCIAL_CONTAINER() exception. Every case where special
containers needed this, it is wrong and made containers draw children
multiple times.
2016-01-22 14:17:28 +01:00
Benjamin Otte
6bb8da5564 stack: Clip animation drawing
We use cairo_paint() when doing that and we don't want to overdraw the
content area.
2016-01-22 13:46:01 +01:00
Benjamin Otte
a6845091f9 spinbutton: Make the entry gadget be the entry's gadget
This is a big and somewhat evil hack: We replace the entry's gadget's
node with the spinbutton's entry node.
2016-01-22 13:46:01 +01:00
Lapo Calamandrei
c7c17abdb9 Adwaita: fix checks and radios on selected row 2016-01-22 13:29:35 +01:00
Matthias Clasen
6a1722f689 text view: Don't leak cairo transforms
The text view draw function was leaving its cairo context
with a transformation after drawing to all the border windows,
which lead mis-drawing in gitg. Avoid this by moving the
gtk_cairo_transform_to_window call inside the existing
cairo_save/restore calls.

https://bugzilla.gnome.org/show_bug.cgi?id=760942
2016-01-21 23:39:16 -05:00
Carlos Garcia Campos
0f7b4dad0f cssstyleproperty: Make it possible to query CSS opacity with gtk_style_context_get()
Add a query implementation to opacity property. Also fix the assert in
gtk_css_style_property_register() to allow registering properties with
query but without assign function.

https://bugzilla.gnome.org/show_bug.cgi?id=760933
2016-01-21 14:58:57 +01:00
Lapo Calamandrei
bd4aaa1285 Adwaita: first css check/radio implementation
draw checks and radios with css istead of relying on png assets.
2016-01-21 14:48:47 +01:00
Matthias Clasen
77a6d976b2 css: Fix refcounting thinko in -gtk-recolor
gtk_css_style_get_value does not return a reference.
So don't unref the return value without taking one.
2016-01-21 08:42:55 -05:00
Matthias Clasen
b4bfba00c4 Handle svg image assets in Adwaita
The build glue for collecting all the assets in Adwaita as
resources was assuming that they are all pngs, and tried to
preprocess them into embedded GdkPixbufs.
Fix it to leave svgs unmolested, so they can be recolored
at runtime.
2016-01-21 08:20:06 -05:00
Matthias Clasen
419f2c670d css: Handle image loading errors graciously
If we fail to load the image for a -gtk-recolor() expression,
fall back to using the image-missing icon instead of crashing,
and include more details in the warning message.
2016-01-21 08:19:37 -05:00
Matthias Clasen
ffc4f8ee11 Forgotten file 2016-01-21 08:18:28 -05:00
Matthias Clasen
52326e909a Adwaita: Set a text color for lists
Symbolic icons in list boxes came out white-on-white in the
inspector. Set an explicit text color to prevent that.
2016-01-20 22:53:47 -05:00
Matthias Clasen
e33bda3078 inspector: Show full allocation + clip
Previously, we were only showing the size of the allocation
and clip area. But there is no good reason to hide the position
of these rectangles, so add them, in the traditional format
of X geometry strings: wxh+x+y
2016-01-20 22:52:05 -05:00
Matthias Clasen
449a9c419a inspector: Refine typography
Use thin spaces in the formatting of monitor sizes.
2016-01-20 22:51:25 -05:00
Matthias Clasen
c2d4fd6b93 Fix GtkShortcutsWindow crash
GtkShortcutsWindow is among the 'cheating' containers that iterate
over indirect children in forall, and this is now triggering
an assertion in gtk_container_propagate_draw.

For now, just exclude the cheating containers from the assertion.
Eventually, this needs a better solution.
2016-01-20 19:33:16 -05:00
Carlos Garnacho
6c1bee2377 GtkNotebook: Unify two private variables
Button state was being kept in two separate variables, which lead
to slight confusions in DnD that caused the notebook to ignore the
first click after DnD happened from (within) it. Unify these two
into one, which helps us keep better track of the really pressed
buttons.
2016-01-20 19:57:23 +01:00
Matthias Clasen
da31eb4f64 container: Don't create too-large clips
gdk_rectangle_union will happily add all the worlds pixels
to the union if the initial rectangle is initialized to all
zeros. Therefore, explicitly check for an empty rectangle
before calling it.
2016-01-20 13:44:34 -05:00
Carlos Garnacho
261622733c gtkdnd: Disconnect GdkDragContext signals on gtk_drag_source_info_free()
Otherwise it may still be tricked into emitting further signals at a
time we've already destroyed the GtkDragSourceInfo passed as callback
user data.
2016-01-20 18:53:03 +01:00
Benjamin Otte
f535251507 notebook: Get rid of during_reorder variable
Use operation == OPERATION_REORDER instead.
2016-01-20 17:37:37 +01:00
Benjamin Otte
c162a0cca8 notebook: Properly hide drag window
Move code to properly reinsert the tab label to where it belongs.
The if has the distinction between reparented-to-dnd-window and
just-changed-the-gdk-window-to-draw-to right there.

https://bugzilla.gnome.org/show_bug.cgi?id=760754
2016-01-20 17:37:37 +01:00
Benjamin Otte
099662998a notebook: Get rid of during_detach member
use operation == OPERATION_DETACH instead.
2016-01-20 17:37:37 +01:00
Matthias Clasen
5fd7b85d2b Add a function to get affected area for background
The new function, gtk_render_background_get_clip answers the
question: what pixels are affected if I call gtk_render_background ?

The long-term goal is to have APIs that answer this question for
all rendering primitives.
2016-01-20 09:41:01 -05:00
Ondrej Holy
b2eaed62f6 file chooser: Allow saving even if executable attribute is not set
Commit 8e975b2 (Bug 753969) introduced check of parent accessibility.
Consequently it is not possible to save file if executable attribute
is not set, which might happen for some gvfs backends. Let's assume
that the folder is accessible even if the attribute is not set.

https://bugzilla.gnome.org/show_bug.cgi?id=760881
2016-01-20 14:09:46 +01:00
Benjamin Otte
e3f8316d08 viewport: Don't destroy pixelcache while it's still used
Removing the child unsets the pxielcache's style context...
2016-01-20 05:10:16 +01:00
Benjamin Otte
9cb0a97bb5 viewport: Set the pixel cache background from the child
The viewport itself doesn't move, so we cannot use it as the pixel
cache's background. Use the bottommost using element instead, which is
the viewport's child.

This might need adaptations in themes as we want the backgroud to be
opaque to speed up pixel cache performance.
2016-01-20 04:37:05 +01:00
Matthias Clasen
bb92428112 notebook: Implement rtl flipping for CSS nodes
Use gtk_box_gadget_reverse_children and gtk_css_node_reverse_children
to flip the children of the header_gadget and the tabs_gadget when
appropriate.

Add new CSS node tests to verify that the node order is updated
as expected in all cases.
2016-01-19 21:40:47 -05:00
Benjamin Otte
0304817d81 css: AFFFECTS_TEXT causes a resize, not a redraw
And we schedule the resize conditionally only when text is rendered but
don't do that check for the redraw.
2016-01-20 02:37:45 +01:00
Benjamin Otte
065aa296ed widget: Properly invalidate when CSS font properties change. 2016-01-20 02:19:42 +01:00
Carlos Garnacho
1045dda035 wayland: Implement DnD actions as per wl_data_device v3
Implement as a managed GdkDragContext, which actually fits nicely
with the drag-and-drop model in wayland.
2016-01-19 14:17:36 +01:00
Carlos Garnacho
8d47617623 gtkdnd: Reset widget controllers when starting DnD.
Otherwise there's no full guarantees that this will happen.
2016-01-19 14:17:36 +01:00
Carlos Garnacho
2b703b61cf gtk: Add private gtk_widget_reset_controllers()
This is a one-shot call that can be called on the places we
know we're taking input away.
2016-01-19 14:17:35 +01:00
Carlos Garnacho
e4f5e31b8b gtkdnd: Optionally use gdk_drag_context_manage_dnd()
When this is in use, there's essentially a bunch of dead code here.
When all backends are ported, we'll be able to remove grab/cursor
management plus a bunch of source-side event handlers.
2016-01-19 14:17:35 +01:00
Benjamin Otte
a50baba160 widget: Call gdk_window_mark_paint_from_clip() again
The proper window to call it is the event window, as the call itself
ignores non-native windows anyway.
2016-01-19 14:12:53 +01:00
Marek Černocký
f64bb38aa7 Fixed typo childen->children 2016-01-19 12:52:58 +01:00
Benjamin Otte
409760babf container: Properly reorder no-window children
... that are setup with gtk_widget_set_parent_window().

Fixes scrollbars not being drawn in GtkScrolledWindow.
2016-01-19 04:33:09 +01:00
Benjamin Otte
ab5dbfd1f1 widget: Add forgotten push_group code
... and remove the also forgotten void function that lingered around
with it.

Fixes opacity=0 parts like inactive spinners or sort indicators in
treeview headers being drawn since last commit.

Oops.
2016-01-19 04:24:32 +01:00
Benjamin Otte
580ea227a6 widget: Redo drawing code
Previously, we had a special cae to draw subwindows of widgets.

This is not necessary as conformant widgets should be able to properly
render themselves when all windows need to be painted.
From now on assume that is the case.

We therefore paint nonnative GDK windows "inline" by just returning TRUE
for gtk_cairo_should_draw_window() for those windows.

This speeds up hilighting different rows in the listbox gtk-demo example
tremendously (by a factor of 10 or more) as the previous code was
O(<number of non-window subwidgets> *
<number of subwindows>) which in the listbox example were ~15,000 and
~2,000 respectively.
2016-01-19 03:45:27 +01:00
Benjamin Otte
402cecf9a2 actionbar: Don't forall() widgets twice
When using forall(), only list the revealer, which lists the box
containing all the children. When using foreach(), bypass revealer and
box and list all children added to the box.
2016-01-19 03:45:26 +01:00
Matthias Clasen
1821c2df60 text view: Expose cursor blink control
Derived classes like GtkSourceView with their own ::key-event
handler need access to this, in order to make their keynav
as nice as the builtin one, wrt to caret visibility.

https://bugzilla.gnome.org/show_bug.cgi?id=760748
2016-01-18 16:27:43 -05:00
Peter Hutterer
48aa1bb08f wayland: add gdk_event_is_scroll_stop_event()
And use it to handle kinetic scrolling in the GtkScrolledWindow.

However, dropping the delta check causes the X11-based kinetic
scroll to break since we don't have the stop event here. Correct handling of
xf86-input-libinput-based scroll events is still being discussed.

https://bugzilla.gnome.org/show_bug.cgi?id=756729
2016-01-18 21:36:23 +01:00
Matthias Clasen
ac95bac5b8 Drop a reference to regions
Regions don't work anymore, so don't recommend them in the docs.
2016-01-18 14:31:37 -05:00
Matthias Clasen
b3b048906c im context simple: Protect shared data structures
Since a41f02f9b1, GtkIMContextSimple
uses threads to load X Compose files. It does that every time a new
im context object is initialized, so we can easily end up with multiple
threads accessing the shared global_tables list at the same time.

Use a lock to prevent that.

https://bugzilla.redhat.com/show_bug.cgi?id=1276432
2016-01-18 13:57:39 -05:00
Benjamin Otte
e150ea85bb cssnode: Don't leak the style cache on destruction 2016-01-18 18:06:41 +01:00
Matthias Clasen
ff5d14f1a8 text view: Update selection node visibility
Make the node invisible if we don't have a selection.
2016-01-18 11:05:53 -05:00
Matthias Clasen
b08fe985cc entry: Expand the css node docs
Mention the context menu.
2016-01-18 10:52:26 -05:00
Matthias Clasen
07eda5920f text view: Expand CSS node docs
Mention the selection node, and the context menu.
2016-01-18 10:51:54 -05:00
Benjamin Otte
3281d1a284 notebook: Don't crash when dnd'ing tabs out
https://bugzilla.gnome.org/show_bug.cgi?id=760754
2016-01-18 15:39:02 +01:00
Benjamin Otte
eca1b3cba3 accellabel: Remove unused variable 2016-01-18 15:39:02 +01:00
Timm Bäder
d73f6b8c50 entry: Deprecate shadow-type
Things like that should be handled using css. Also, the property value
is unused inside GtkEntry.
2016-01-18 12:53:53 +01:00
Matthias Clasen
2a665715b6 expander: Flip the alignment of the vertical box
To ensure that the title moves to the other side as expected
in RTL, use GTK_ALIGN_START/END instead of GTK_ALIGN_FILL
when packing the title gadget into the vertical box, and
flip the alignment when the text direction changes.
2016-01-18 00:19:31 -05:00
Matthias Clasen
296f80a580 expander: Handle rtl changes again
Now that the box gadget has api for it, use it here to
change the order of the gadgets for right-to-left.
2016-01-18 00:11:54 -05:00
Matthias Clasen
a32b39c60f checkbutton: Handle rtl changes again
Now that the box gadget has api for it, use it here to
change the order of the gadgets for right-to-left.
2016-01-18 00:11:50 -05:00
Matthias Clasen
5265db5dd6 box gadget: Add a function to reverse children
This can be used to handle text direction changes.
2016-01-18 00:03:39 -05:00
Matthias Clasen
7859f8ee91 checkbutton: Use a box gadget
Now that builtin icons have a baseline, we can just use
a box gadget with baseline alignment for the indicator
and the label.
2016-01-17 21:16:33 -05:00
Matthias Clasen
da30858ee4 builtin icon: set a baseline
Most uses of builtin icons (check and radio buttons,
expanders, etc) are placed next to labels, so they should
be properly positioned wrt to the baseline. Lacking anything
better, give the builtin icons a baseline that places the
center of the icon at the strikethrough position.
2016-01-17 21:02:18 -05:00
Matthias Clasen
9c3907dab0 box gadget: Deal with optional arguments
The baseline arguments to the preferred size callback can
be NULL. Don't crash if they are.
2016-01-17 19:48:40 -05:00
Matthias Clasen
44d94a4aeb Trivial formatting fix 2016-01-17 15:35:14 -05:00
Matthias Clasen
a7387e2641 Document restrictions on gtk_style_context_get
This makes it official that passing a different state
is not generally supported in the getters for CSS properties.
2016-01-17 15:31:37 -05:00
Matthias Clasen
6bf9715ce4 notebook: show tabs when asked to
gtk_notebook_set_show_tabs must make the header gadget
visible when show_tabs is TRUE, not the other way around.

https://bugzilla.gnome.org/show_bug.cgi?id=760596
2016-01-17 14:35:58 -05:00
Matthias Clasen
9e2a1685c5 accel label: Fix RTL handling
The 'mad hack' that GtkAccelLabel used to affect the GtkLabel
draw function broke with the introduction of gadgets, since
the positioning is no longer relative to the widgets' allocation
at the time of the call, but rather to the gadgets allocation.

Instead of coming up with an even madder hack to keep this
working, give the GtkLabel draw function knowledge about accel
labels.

https://bugzilla.gnome.org/show_bug.cgi?id=760663
2016-01-17 14:08:22 -05:00
Matthias Clasen
d28959c6db inspector: Make cursor-size combo wider
Cursor sizes typically have 2 digits, lets not clip them.
2016-01-17 13:23:49 -05:00
Matthias Clasen
00aca5d689 Expand window style class documentation a bit 2016-01-17 12:13:59 -05:00
Matthias Clasen
9d26038a10 Adwaita: Keep entry progress visible
When the entry is focused, make the progress one pixel wider
so it doesn't get swallowed by the focus outline.
2016-01-16 19:23:26 -05:00
Benjamin Otte
6e6cbd7316 stylechange: Do the right thing when old and new style are equal
We don't need to compare all their CSS values to figure out that nothing
changed. We know that.
2016-01-16 23:58:37 +01:00
Benjamin Otte
c904efef53 cssnode: Redo GTK_DEBUG=no-css-cache
Previously this setting would just invalidate the whole CSS tree and
thereby hopefully avoid all cache usage.

Now, we actually don't cause extra invalidations anymore, but instead
avoid ever inserting anything into the cache when this setting is set.
2016-01-16 23:58:37 +01:00
Benjamin Otte
024429f76f cssnode: Implement the style cache
This essentially copies the previous cache implementation. With one
caveat: It is now attached to and maintained by the CssNode, not by the
CssStyle.

And this is important because styles may be reused in incompatible
situations which would cause cache collisions and lead to broken CSS in
weird situations.
2016-01-16 23:58:37 +01:00
Benjamin Otte
5d562b6a2a cssnode: Split out the style cache
For now, the split out style cache doesn't cache anything. This is
mostly to make sure that bisections of wrong caching behavior will
bisect down to the commit that actually adds caching.
2016-01-16 23:58:37 +01:00
Lapo Calamandrei
93f8fa7576 Adwaita: stop axing toolbar separators 2016-01-16 04:16:55 +01:00
Lapo Calamandrei
d0f83d46a0 Adwaita: style textview derived widgets 2016-01-16 04:15:30 +01:00
Matthias Clasen
e7fc87e4ac color scale: Improve themability
Add the .color class, so themes can style scale.color.
Clip the trough rendering to the content path, so that
themes can set rounded corners.
2016-01-15 20:08:57 -05:00
Matthias Clasen
a0d91a3a71 treeview: Use foreground color to draw dnd marker
This is still not perfect, but makes the dnd marker better visible
in HighContrastInverse.
2016-01-15 19:39:12 -05:00
Matthias Clasen
2cf810c4c9 frame: Don't overlap label and child
We didn't do this previously, so don't start now.

https://bugzilla.gnome.org/show_bug.cgi?id=760528
2016-01-15 19:16:23 -05:00
Lapo Calamandrei
f32e1d42e6 Adwaita: combo style cleanup and fixes
fixes https://bugzilla.gnome.org/show_bug.cgi?id=760524
2016-01-16 01:03:08 +01:00
Matthias Clasen
e8b9aacfc1 combo: Add .linked class when appropriate
Add the .linked style class to combo boxes which have
an entry, since that is what they are.
2016-01-15 17:55:44 -05:00
Matthias Clasen
54a6e032ca combobox: Document the popup window CSS node 2016-01-15 17:48:39 -05:00
Matthias Clasen
0049be4e58 application: Protect against double shutdown
It is not something that can happen normally.
But if it does, we shouldn't crash.

https://bugzilla.gnome.org/show_bug.cgi?id=760680
2016-01-15 17:37:55 -05:00
Matt Watson
d8bb228d3b widget: remove queue_resize in set_sensitive
Calling gtk_widget_propagate_state is enough to queue a resize if
needed

See da7a4089fe
2016-01-15 11:07:47 -08:00
Lapo Calamandrei
04f6f38b56 Adwaita: remove messagedialog label squashing hack
since Matthias fixed this properly.
2016-01-15 18:37:49 +01:00
Matthias Clasen
78162c5e88 message dialog: Prevent empty title from being shown
We don't want to grow the titlebar by showing an empty label.
2016-01-15 11:59:33 -05:00
Lapo Calamandrei
fc804bba2d Adwaita: some dialog love
addresses https://bugzilla.gnome.org/show_bug.cgi?id=760525
2016-01-15 17:57:25 +01:00
Matthias Clasen
6d18b77ca7 expander: Destroy gadgets after child widgets
With child widgets now being sorted into box gadgets, bad things
happen if those gadgets disappear prematurely.
2016-01-15 10:30:08 -05:00
Benjamin Otte
6e4d65d227 notebook: Destroy gadgets after chaining up
While chaining up, we might still call into the notebook code. And that
code expects the gadgets to be there.

https://bugzilla.gnome.org/show_bug.cgi?id=760640
2016-01-15 16:22:22 +01:00
Matthias Clasen
2e27c0af25 expander: Convert to use box gadgets
Use a vertical box gadget for the overall expander, and a
horizontal one for the title row. This lets us get rid of
all the custom allocation code here.
2016-01-15 09:43:51 -05:00
Matthias Clasen
5f5dc10820 expander: Deprecate spacing property
The same can be achieved with margins on the child, and
the spacing property gets in the way of converting the
expander to use box gadgets.
2016-01-15 09:43:51 -05:00
Matthias Clasen
87171469b7 box gadget: Implement cross-axis alignment
So far, the box gadget is always allocating all children the
full size in the cross axis. This behavior corresponds to the
align-items: stretch behavior in
https://www.w3.org/TR/css-flexbox-1/#align-items-property
This commit implements the other modes described there.

While widgets have halign/valign properties that we can use for
this, the API for inserting gadgets has to change to take an
extra align parameter. All callers have been updated to pass
GTK_ALIGN_FILL, since that corresponds to the previous behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=760668
2016-01-15 09:43:12 -05:00
Tom Schoonjans
967ecc80d3 Windows library manager fix
The Makefile.am's had a dependency on incorrectly named libtool
archives for the generation of the .lib files.

https://bugzilla.gnome.org/show_bug.cgi?id=760388
2016-01-15 11:16:32 +01:00
Alberts Muktupāvels
c60cea3037 gtkwidgetpath: update gtk_widget_path_to_string
From gtk_widget_path_iter_set_object_name documentation:
"When set, the object name overrides the object type when matching CSS"

Update gtk_widget_path_to_string to match this behaviour.
2016-01-15 00:36:23 +02:00
Eric Williams
276101a3bc Fix typo in previous documentation fix for gtk_css_provider_load_from_data() 2016-01-14 17:01:26 -05:00
Matthias Clasen
beec55a22b Add a way to load recolored icons in CSS
This can come in handy to load images that are not in an icon theme,
but still benefit from symbolic recoloring.

https://bugzilla.gnome.org/show_bug.cgi?id=760536
2016-01-14 13:51:15 -05:00
Matthias Clasen
1b0ef71696 icon theme: Export recoloring function
This will be used in subsequent commits.

https://bugzilla.gnome.org/show_bug.cgi?id=760536
2016-01-14 13:51:09 -05:00
Matthias Clasen
7d717c8113 icon theme: Add a way to create GtkIconInfos from files
This is sometimes needed, and calling into actual icon theme
code just for it is confusing - the resulting icon does not
depend on the icon theme at all.

https://bugzilla.gnome.org/show_bug.cgi?id=760536
2016-01-14 13:50:58 -05:00
Lapo Calamandrei
c667f9f1d1 Adwaita: pathbar style cleanup 2016-01-14 17:54:31 +01:00
Florian Müllner
ea69bf8c17 cssstyleproperty: Expose min-width/height 2016-01-14 17:20:51 +01:00
Lapo Calamandrei
bc2355e0b1 Adwaita: remove superfluous selector on keycap styling
now that keys are made directly with labels istead of frames.
2016-01-14 16:26:22 +01:00
Timm Bäder
4703d2bbf0 boxgadget: Don't use g_assert
Use g_return_if_fail instead so nothing abort()s.
2016-01-14 16:02:36 +01:00
Timm Bäder
a5fabee202 entry: Don't draw icons twice 2016-01-14 16:02:12 +01:00
Timm Bäder
49d251a330 entry: Remove unused code 2016-01-14 16:02:12 +01:00
Timm Bäder
2397d76137 label: Remove some unneeded conditionals
We are never passing NULL here.
2016-01-14 16:02:12 +01:00
Timm Bäder
6a97b2563b shortcutlabel: Use a label directly
We can everything we need without the frame around it now.
2016-01-14 16:02:12 +01:00
Руслан Ижбулатов
e44b420617 Ensure that the fstat fix is not applied on x86_64 2016-01-14 12:52:04 +00:00
Matthias Clasen
0acc6578d8 expander: center the arrow
In lieu of more sophisticated alignment, we need to at least
center the arrow allocation wrt to the label.
2016-01-14 07:35:59 -05:00
Руслан Ижбулатов
59f1b87409 W32: Ensure that correct statting function is used by iconcache
With Mingw-w64 fstat() can be an inline function that
calls _fstat32() or _fstat64(), depending on some macros.
And if LFS is enabled, fstat() is defined to turn into
_fstat32i64() or _fstat64(). And some/all of the above
might also be macros as well. Side-step all that mess
and excplicitly re-define fstat as _fstat32, which is
guaranteed to use a version of "stat" struct that
has 32-bit size and time fields, which is what we want.

https://bugzilla.gnome.org/show_bug.cgi?id=760615
2016-01-14 09:44:22 +00:00
Matthias Clasen
d2e80a7993 font chooser: Add a CSS name
The CSS name for GtkFontChooserWidget is fontchooser.
2016-01-13 23:42:35 -05:00
Matthias Clasen
c80adc33a4 app chooser: Set a CSS name
The CSS name for GtkAppChooserWidget is appchooser.
2016-01-13 23:41:38 -05:00
Matthias Clasen
9657ec9331 print dialog: Set a CSS name
The CSS name for GtkPrintUnixDialog is printdialog.
2016-01-13 23:41:38 -05:00
Matthias Clasen
704b41b504 file chooser: Set a CSS name
The CSS name for GtkFileChooserWidget is ... filechooser.
2016-01-13 23:41:38 -05:00
Matthias Clasen
2f169a493b color chooser: Set a CSS name
The CSS name for GtkColorChooserWidget is ... colorchooser.
2016-01-13 23:41:38 -05:00
Matthias Clasen
dc5c82e29c inspector: Don't select 'randomly'
While rescanning the object tree, we were emitting ::object-selected
signals, possibly causing wild blinking in the application window.
Don't do that.

https://bugzilla.gnome.org/show_bug.cgi?id=760572
2016-01-13 23:24:38 -05:00
Matthias Clasen
1009c88186 Make -gtk-icontheme() use -gtk-icon-palette
This makes it possible to recolor themed icons with -gtk-icon-palette,
regardless whether they are loaded by the theme or the application.
2016-01-13 16:17:44 -05:00
Matthias Clasen
34c263683c Move the -gtk-icon-palette property up
Other properties will start depending on it in subsequent
commits, so move it up to prevent ordering problems.
2016-01-13 16:16:39 -05:00
Matthias Clasen
1f65f1b746 color swatch: Use right allocation for window
Generally, input-only windows that correspond to CSS boxes
should be sized to the border allocation of the gadget.
2016-01-13 14:00:10 -05:00
Cosimo Cecchi
897126ae2b notebook: fix a GCC warning 2016-01-13 08:30:02 -08:00
Matthias Clasen
fb77ebe17e paned: Update node ordering according to text direction
This was overlooked in the initial node conversion.
2016-01-13 00:40:11 -05:00
Matthias Clasen
7743944124 GtkBox: Documentation tweak 2016-01-13 00:39:53 -05:00
Matthias Clasen
93aac8a86c notebook: Document the .dnd style class
We should aim to document all style classes that themes
can encounter during the normal operation of a widget.
2016-01-13 00:24:40 -05:00
Matthias Clasen
ea4cff1ea4 Use convenience API that was introduced recently
Use gtk_css_gadget_set_state in all the places where we previously
were getting a node from a gadget, just to call gtk_css_node_set_state.
2016-01-13 00:19:31 -05:00
Matthias Clasen
64b499be66 builtin icon: Don't save/restore cairo state
The reason why this was introduced is now handled in
gtk_css_stylke_render_icon since commit
0138af9f96.
2016-01-13 00:01:14 -05:00
Matthias Clasen
c71089a038 box gadget: Add some documentation 2016-01-12 23:57:35 -05:00
Matthias Clasen
2677eee720 box: Document child node ordering 2016-01-12 23:40:28 -05:00
Timm Bäder
b8db48079f switch: Fix text positioning
https://bugzilla.gnome.org/show_bug.cgi?id=760509
2016-01-12 21:56:53 +01:00
Timm Bäder
a8ceeb1766 switch: Don't include margins in input window size
https://bugzilla.gnome.org/show_bug.cgi?id=760509
2016-01-12 21:56:53 +01:00
Timm Bäder
ff7e2797f6 modelbutton: Don't include margins in input window size
https://bugzilla.gnome.org/show_bug.cgi?id=760509
2016-01-12 21:56:49 +01:00
Timm Bäder
788ee466b8 button: Don't include margins in input window size
And do the same thing for GtkCheckButton

https://bugzilla.gnome.org/show_bug.cgi?id=760509
2016-01-12 21:56:44 +01:00
Timm Bäder
19fa893067 entry: typo 2016-01-12 21:54:45 +01:00
Matthias Clasen
c5d3556f98 HighContrast: Fix selection in .views
Copy Adwaita fixes from 21a2fce8ba.
2016-01-11 23:20:26 -05:00
Matthias Clasen
52a34d32bb Fix corner manipulation when growing rounded rects
This addresses problems with uneven border radius',
pointed out by Lapo.
2016-01-11 22:49:40 -05:00
Ben Iofel
7e5952c4ea GTK Notebook: use the right enum type 2016-01-11 19:16:36 -05:00
Lapo Calamandrei
1c3bad3d90 Adwaita: popover style fixes 2016-01-12 01:03:47 +01:00
Lapo Calamandrei
21a2fce8ba Adwaita: make selection visible in treeview derived widgets
See https://bugzilla.gnome.org/show_bug.cgi?id=757503
2016-01-12 00:16:12 +01:00
Hashem Nasarat
473433c93d Adwaita: fix separator margin in popovers
Commit 0b96b8a1 set margins via css, but accidentally changed the
semantics of margins for separators in popovers so that any separator
in a gtkpopover had a margin. This meant that the separators in
GtkListBoxes in popovers also had a margin around their separators, and
this is not what we want because it doesn't match separators in
listboxes not in popovers.

https://bugzilla.gnome.org/show_bug.cgi?id=760427
2016-01-11 23:40:25 +01:00
Carlos Garnacho
0167f7c65c GtkWidget: Fix motion event consumption detection for touch-only gestures
If a GtkGestureSingle is set as touch-only, pointer events would be
discarded without giving an opportunity to the regular GtkGesture
handler to manage those.

Because the pointer events weren't actually managed by the gesture,
gtk_gesture_get_sequence_state() (rather unhelpfully here) will resort
to returning GTK_EVENT_SEQUENCE_NONE, which is in turn interpreted
by _gtk_widget_consumes_motion() as "may be handling the events for
this sequence", because gestures in this state presumably handle
the events, just that it's not "claimed" yet.

Instead, use gtk_gesture_handles_sequence(), which will perform the
expected check on the event sequence being managed, as we expect
here.
2016-01-11 20:16:06 +01:00
Matthias Clasen
32eda187ee Actually deprecate GtkNotebook::has-tab-gap 2016-01-11 13:58:37 -05:00
Matthias Clasen
990be25d63 notebook: Update CSS node docs
The stack node is new.
2016-01-11 13:55:23 -05:00
Benjamin Otte
3a8dc01ed2 notebook: Don't reparent tab label when drag stops
Use the same unrealize + set_parent_window() trick that we used in
6d5edd18cf when dragging starts.
2016-01-11 17:52:38 +01:00
Benjamin Otte
b917a0b155 notebook: Add .dnd style class to tabs during reorder 2016-01-11 17:46:15 +01:00
Benjamin Otte
6d5edd18cf notebook: Don't unparent tab label for drag
When a tab drag starts, we need to move the tab label into the drag
window via gtk_widget_set_parent_window().
If we don't unparent, but just unrealize the widget, we don't lose the
cssnode position.
2016-01-11 17:06:46 +01:00
Benjamin Otte
fdc13f315b notebook: Don't limit motion notify framerate
We have a frameclock for that these days.

In particular, this limiting worked at 45fps when monitors are all 60fps.
2016-01-11 17:06:46 +01:00
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