Commit Graph

25479 Commits

Author SHA1 Message Date
Matthias Clasen
d36c93b91b expander: Fix drawing in rtl
GtkBuiltinIcon leaves the cairo context in unclean state
when drawing, work around that.
2015-12-19 11:24:27 -05:00
Matthias Clasen
7d801a4f69 Fix a case a height/width confusion 2015-12-19 11:24:27 -05:00
Matthias Clasen
d51de8cff8 expander: Use a builtin icon
This saves quite a bit of code.
2015-12-19 11:24:27 -05:00
Matthias Clasen
f54e0a283b label: Allocate gadget before using it
Move the gtk_css_gadget_allocate call before the
gtk_label_update_layout_width call. This fixes the
statusbar label in widget-factory page 2 coming
up fully ellipsized.
2015-12-19 00:33:20 -05:00
Benjamin Otte
35e98dce9b notebook: Sync menu labels with page list in visibile_cb
It's where it changes. Size requests have nothing to do with that.
2015-12-19 06:13:56 +01:00
Benjamin Otte
c3548328f7 notebook: Don't allocate during size requests
wat?
2015-12-19 06:13:56 +01:00
Benjamin Otte
dd90e020a2 label: Don't use _gtk_mis_get_padding_and_border()
The function takes into account CSS padding and border, which these days
is handled by the gadget code. Use gtk_misc_get_padding() instead.
2015-12-19 06:13:56 +01:00
Christoph Reiter
47325a827b imagedefinition: The storage type is not a boolean 2015-12-19 06:13:56 +01:00
Matthias Clasen
a3fd5a010b Simplify actionbar
We don't need a frame widget here, just render a top border on the
box.
2015-12-18 22:57:16 -05:00
Matthias Clasen
b90fa7dcd1 Adwaita: fix action bar styling
Make action bar buttons have some padding again.
2015-12-18 22:37:57 -05:00
Matthias Clasen
ac65952f0d icon helper: suppress style_changed when transient
Transient nodes should not propagate style-changed signals
that can cause widgets to get reallocated. This was causing
treeviews and iconviews with pixbuf cells to be constantly
resized and redrawn.
2015-12-18 20:53:02 -05:00
Matthias Clasen
18e8842a7e entry: Don't clear when setting icons
Clearing the icon doesn't appear to be necessary with
todays code, and it has the unfortunate side-effect of
temoorarily hiding the icon's window, which breaks grabs
and makes us miss the button release event when the icon
is changed from a button press handler.
2015-12-18 19:38:07 -05:00
Matthias Clasen
6f5b19a0a5 css node: Use g_set_object
Replace unref + assignment + ref combinations by g_set_object_calls.
2015-12-18 16:56:04 -05:00
Matthias Clasen
51ba8421c3 entry: Remove some dead code
These defines are no longer used.
2015-12-18 10:55:26 -05:00
Timm Bäder
e8aa9b0440 Add a way to highlight resizing widgets
https://bugzilla.gnome.org/show_bug.cgi?id=759586
2015-12-18 16:20:19 +01:00
Timm Bäder
20a6ee30b7 GtkWidget: Don't mix code and declarations 2015-12-18 16:08:22 +01:00
Matthias Clasen
666e4135e8 expander: Deprecate style properties
This can all be done with CSS properties now.
2015-12-18 09:26:16 -05:00
Matthias Clasen
53787d29ad expander: Let gadget render focus
This lets us drop lots of allocation fiddling, and reduces
the code that is consulting the style properties we want
to get rid of.
2015-12-18 08:29:49 -05:00
Matthias Clasen
d81f8c1025 box: Add a way to get the gadget
This will be used in GtkButtonBox.
2015-12-18 07:37:52 -05:00
Matthias Clasen
acd339a9a5 buttonbox: Convert to gadgets
Set a css name and use a gadget for button box allocation and
drawing.
2015-12-18 06:52:35 -05:00
Matthias Clasen
2e25407638 Fix a problem with entry gadgets
place_windows is accessing the gadgets allocation, so make sure
to allocate the gadget before calling it.
2015-12-17 15:17:23 -05:00
William Hua
5190d010d9 gtkborder: restore original struct definition
We're going to add back the original struct definition removed by
a6e4de28, because using the typedef breaks all sorts of things like
gtkmm and WebKit, and having separate struct definitions allows us to
change the types in GdkBorder from gint16s to gints without breaking
ABI.
2015-12-17 12:56:35 -05:00
Timm Bäder
f6b0067718 GtkSeparator: Don't leak the gadget 2015-12-17 14:51:34 +01:00
Matthias Clasen
35c243b26f entry: use a gadget
Use a gadget for the entry. Selection and progress still
just use a CSS node. Most things seem to work correctly
with non-zero margin or padding.
2015-12-17 00:01:58 -05:00
Lionel Landwerlin
776778efc8 inspector: Ensure clip is always shown 2015-12-17 01:14:31 +00:00
Matthias Clasen
117ab50922 inspector: Always show clip
It is less confusing than hiding it sometimes.
2015-12-16 19:24:43 -05:00
Matthias Clasen
0e82076527 gadget: Don't warn about unset clip
Instead of warning about an unset clip, simply ignore
empty content clips.
2015-12-16 19:14:39 -05:00
Matthias Clasen
7778c237e6 cellview: Convert to gadgets 2015-12-16 19:07:26 -05:00
Matthias Clasen
f3c95e1c63 gadget: Avoid warning for empty containers
Empty boxes end up setting the clip to { 0, 0, 0, 0}, so warning
for a width or height of 0 triggers false positives. Instead,
initialize the clip to clearly invalid values.
2015-12-16 17:52:47 -05:00
Matthias Clasen
09d9674d69 gadget: Add more information to warnings
We have the gadget at hand, so we should print out some
information that helps tracking down where it comes from.
2015-12-16 17:41:04 -05:00
Matthias Clasen
083a17acd4 gadget: Update docs
Make it clear that out_clip must be set.
2015-12-16 17:32:24 -05:00
Matthias Clasen
ec5596ce20 gadget: Warn if clip is not set
This leads to hard-to-track-down drawing errors, so better
warn explicitly about it.
2015-12-16 17:27:14 -05:00
Matthias Clasen
2417184a1f frame: Fix gadget conversion
The GtkCssAllocateFunc must set the clip to meaningful values.
2015-12-16 17:12:12 -05:00
Matthias Clasen
576028bdec frame: Convert to gadgets
As part of this conversion, remove the hardcoded padding around
the label.

Unfortunately, we cannot use the main gadget for drawing the frame
decoration, since we want to draw a custom border instead of the
stock css border that gadgets insist on drawing for us. Therefore,
add an extra gadget with name border and use it just for rendering
the frame.
2015-12-16 15:15:18 -05:00
Carlos Garnacho
3be4971e05 GtkPopover: Ensure we unset modality before unparenting the popover
Otherwise the gtk_grab_remove() calls on widget destruction will happen
on the default window group, which may leave the real window group
of the popover with a dangling pointer if it is not the default one.

This could be seen on the inspector, open a popover in the properties
list and close the window with alt-F4.
2015-12-16 20:47:25 +01:00
Benjamin Otte
197e42efd8 label: Position the text properly
The PangoLayout needs to be positioned according to the content
allocation of the gadget, not the widget's allocation.
2015-12-16 20:39:51 +01:00
Benjamin Otte
2e362eafc7 cssnode: Redo first/last-child change tracking
Invisible nodes don't change the first/last-child status of the nodes
after/before them. That means we don't have to just check the state of
the adjacent node when modifying this state, but all their siblings
until we hit a visible node.

The same way, a node is not the first child if it has no previous
sibling, it is the first child if it has no previous visible sibling.
This is important for caching in the global lookup cache.
2015-12-16 19:55:50 +01:00
Benjamin Otte
36653bea41 checkbutton: Use a builtin icon
Also, add support to uiltin icons to look up the default size from a
style property.
2015-12-16 19:55:50 +01:00
Matthias Clasen
abbd6b11f6 switch: Deprecate style properties
CSS min-width and min-height on the slider node fit this
perfectly. We still fall back to the slider-width and
slider-height style properties if the CSS properties are
not set.
2015-12-16 13:53:13 -05:00
Matthias Clasen
4e05148bef Simplify some code
Deal with the min-width/min-height fallback the same way
as in GtkBuiltinIcon.
2015-12-16 13:53:13 -05:00
Carlos Garnacho
3f7eefb922 inspector: Use seat grabs for the "inspect widget" feature
And remove some usages of GdkDeviceManager API.
2015-12-16 19:47:07 +01:00
Carlos Garnacho
32c9db8600 GtkTreeView: Add ignore deprecation statements
We still need access to floating devices at places.
2015-12-16 19:47:07 +01:00
Carlos Garnacho
4f9f3f04c0 GtkWindow: Add ignore deprecation statements
We still need access to floating devices at places
2015-12-16 19:47:07 +01:00
Carlos Garnacho
4a7589ea12 GtkWindow: Avoid GdkDeviceManager API
We can iterate over the seats' pointers, instead of over master pointers.
2015-12-16 19:47:07 +01:00
Carlos Garnacho
0f98f225d1 GtkWidget: Add some ignore deprecation statements
We still need access to floating devices here.
2015-12-16 19:47:07 +01:00
Carlos Garnacho
04d7bd49d0 GtkMenu: Avoid GdkDeviceManager API
We used to pick a master pointer "at random", use the default seat pointer
instead.
2015-12-16 19:47:07 +01:00
Carlos Garnacho
26f3d02f03 GtkComboBox: Avoid GdkDeviceManager API
We used to pick a master pointer "at random", use the default seat pointer
instead.
2015-12-16 19:47:06 +01:00
Carlos Garnacho
e2c8d3c680 scrolledwindow: Remove unneeded code
We no longer take a grab here, no need to undo it on grab_notify
2015-12-16 19:47:06 +01:00
Cosimo Cecchi
13b9515e63 border: silence a GIScanner warning 2015-12-16 10:40:18 -08:00
Cosimo Cecchi
ea3df24735 gadget: fix copy/paste error in documentation 2015-12-16 10:38:05 -08:00
Matthias Clasen
0291978acc check button: Deprecate indicator-size
CSS min-width/min-height can do just the same. We still fall
back to the indicator-size style property if the CSS properties
are not set.
2015-12-16 13:11:24 -05:00
Matthias Clasen
bb67a06bd6 check button: Deprecate and ignore ::indicator-spacing
This can be done just as well with CSS margins, so
do that instead for Adwaita.
2015-12-16 12:27:53 -05:00
Matthias Clasen
86ecdc7a44 model button: Document iconic layout
Document how the CSS nodes look if iconic is TRUE. Add
a .model style class for this case and use it in Adwaita.
2015-12-16 11:37:49 -05:00
Matthias Clasen
2f544655f9 Revise CSS node documentation
Clarify the use of brackets in the CSS node diagrams:
[] means optional nodes or classes, <> means child widgets.
2015-12-16 10:58:47 -05:00
Bastien Nocera
a56a8a8c02 shortcuts: Make sure that hidden shortcuts stay hidden
When doing a gtk_widget_show_all() on the shortcuts window,
accelerators for both RTL and LTR directions are being shown.

Make sure that no-show-all is set by default on hidden shortcuts, and
updated if the widget direction changes.

https://bugzilla.gnome.org/show_bug.cgi?id=759541
2015-12-16 12:22:58 +01:00
Matthias Clasen
5db1dad869 paned: Initialize clip properly
This was causing problems in the case when only one of the paned
children is visible - we would use uninitialized memory, leading
to invalide clip regions. Concretely, the signal tab in the inspector
would sometimes not render at all.
2015-12-15 23:56:47 -05:00
Benjamin Otte
42fdfb6af4 renderborder: Actually draw the path as one element
Avoids spurious lines that can sometimes be seen going towards the
center of the widget.
2015-12-16 05:15:04 +01:00
Benjamin Otte
fab181fcfa builtinicon: Change the way size is handled
Make min-width/height have preference over the set default size. This
allows shrinking the widget. The default size is only used if min-width
is not set (or explicitly set to 0.
2015-12-16 04:46:23 +01:00
Benjamin Otte
9d56a076cc gadget: Add builtin icon gadget
This is to be used in all the places where we now call
gtk_render_activity()/option()/check() etc that in turn call the icon
render function.
2015-12-16 04:46:23 +01:00
Benjamin Otte
d3cf3fd267 rendericon: Move a function
The function is identical if used for builtin icons and regular icons
(as per iconhelper). So split it out in a way that doesn't assume
either.
2015-12-16 04:46:22 +01:00
Matthias Clasen
152326bd24 paned: Allocate the handle input area properly
Drop the margin misuse and use the border allocation of the
handle gadget. We use negative margins to make the border allocation
larger without pushing the paned children out.
2015-12-15 21:59:04 -05:00
Matthias Clasen
b14dc6b5a4 gadget: Add api to get the border allocation
This can be useful for giving input windows the right size.
2015-12-15 21:58:45 -05:00
Matthias Clasen
5aec427c1a paned: Fix size allocation
We were passing negative widths to height-for-width calls that
didn't expect this.
2015-12-15 21:58:45 -05:00
Benjamin Otte
26d42771ef progressbar: Change the way the progress gadget gets size
Size of the progress element now grows also when it's close to 0 size.

Previously the size was clamped to the minimum size, now it starts
growing from the minimum size.
So for a 100px trough with a 10px min size progress, the sizes of the
progress element change like this:
        old     new
0%      10      10
5%      10      14
10%     10      19
20%     20      28
50%     50      55
100%    100     100
2015-12-16 01:50:01 +01:00
Benjamin Otte
bf130da741 cssimage: Handle 0x0 images
0x0 images can happen when we fail to load an image - or when we
successfully load a 0x0 image.
2015-12-16 01:50:00 +01:00
Benjamin Otte
a11de0da6b stylecontext: Builtin images can be (and are) transformed
So don't special-case them out.
2015-12-16 01:50:00 +01:00
Benjamin Otte
75d7f7e756 css: Move enum
I want to use it for a gadget, so it's better in the generic file.
2015-12-16 01:50:00 +01:00
Matthias Clasen
65b056142b Really undo the deprecation of separator style properties
I hit the wrong one in the previous commit. For good measure,
undo depecation for all separator-related style properties.
They are still in use.
2015-12-15 19:45:35 -05:00
Matthias Clasen
9b408d911a shortcuts: Fix the circular stack switcher
The buttons need to set min-width now, to make this work.
2015-12-15 19:41:05 -05:00
Matthias Clasen
db684d853d Undo deprecation of the wide-separators style property
This was premature, as this style property is still used
by GtkTreeView and GtkMenu.
2015-12-15 19:41:05 -05:00
Matthias Clasen
1b174a6f16 shortcuts: Fix view filtering
When adding invisible groups to the pages/columns, we were
mistakenly creating new columns because the row count
stayed at zero.

https://bugzilla.gnome.org/show_bug.cgi?id=759517
2015-12-15 18:40:51 -05:00
Matthias Clasen
2bb80a9bb2 gadget: Fix a thinko in baseline adjustment
We are making the allocation smaller, so the baseline
needs to get smaller too, not bigger.
2015-12-15 18:15:16 -05:00
Carlos Garnacho
1349ffa0db gtkdnd: Avoid gdk_device_manager_get_client_pointer()
It's now deprecated
2015-12-15 23:18:10 +01:00
Carlos Garnacho
56c6c722d1 GtkPlug: Avoid gdk_device_manager_get_client_pointer()
It's now deprecated
2015-12-15 23:17:53 +01:00
Carlos Garnacho
3d516449d4 GtkTooltip: Avoid gdk_device_manager_get_client_pointer()
It's now deprecated
2015-12-15 23:17:37 +01:00
Carlos Garnacho
7333d7e8bb GtkTreeView: Avoid gdk_device_manager_get_client_pointer()
It's now deprecated
2015-12-15 23:17:22 +01:00
Carlos Garnacho
253bf3fd38 GtkWidget: Avoid gdk_device_manager_get_client_pointer()
It's now deprecated
2015-12-15 23:17:07 +01:00
Carlos Garnacho
6ac16dc4a6 GtkWindow: Avoid gdk_device_manager_get_client_pointer()
It's now deprecated
2015-12-15 23:16:11 +01:00
Matthias Clasen
06b28a610b flowbox: Don't render focus erroneously
The gadget render function should only return TRUE if the
widget has the focus, and wants it rendered.
2015-12-15 15:10:08 -05:00
Carlos Soriano
8858c3aaa0 gtkplacesviewrow: plural form for available space
We were not supporting plural form of the available space, which
is a problem in some languages.
However in this case is kind of a difficult matter, since we use a
formatted string from glib with g_format_size.

To fix it, use the same behavior as g_format_size to decide when
it should be used a plural form or not.

https://bugzilla.gnome.org/show_bug.cgi?id=759491
2015-12-15 14:59:13 -05:00
Matthias Clasen
4eeeb5811d listbox: Fix an oversight in the row gadget conversion 2015-12-15 14:12:50 -05:00
Matthias Clasen
fdb9625f4f modelbutton: Remove debug spew 2015-12-15 13:14:49 -05:00
William Hua
a6e4de2884 gdkborder: add GdkBorder to gdktypes.h 2015-12-15 10:13:03 -05:00
Matthias Clasen
246fcd6563 Complete docs for gtk_stack_get_interpolate_size 2015-12-15 09:48:16 -05:00
Matthias Clasen
44baf19330 paned: Add a deprecation note 2015-12-15 08:41:16 -05:00
Matthias Clasen
d891bb815b checkbutton: Remove dead code 2015-12-15 08:41:16 -05:00
Matthias Clasen
e02c21fdd8 button box: Deprecate style properties
These can all be replaced by standard CSS properties.
2015-12-15 08:41:16 -05:00
Matthias Clasen
49e24b05b5 flowbox: convert to gadgets 2015-12-15 08:41:16 -05:00
Matthias Clasen
3b264ea555 flowbox: Convert child to gadgets 2015-12-15 08:41:16 -05:00
Matthias Clasen
29accad89a listbox: Convert to gadgets 2015-12-15 08:41:16 -05:00
Matthias Clasen
9fb3716259 listbox: Convert rows to gadgets 2015-12-15 08:41:16 -05:00
Matthias Clasen
c2fc1cff32 paned: Convert to gadgets 2015-12-15 08:41:16 -05:00
Matthias Clasen
9c63170e70 stack: Convert to gadgets 2015-12-15 08:41:16 -05:00
Matthias Clasen
48e543fbc8 Adwaita: Update separator toolitem styling
Don't set a background for these, since we now draw background.
2015-12-15 08:41:16 -05:00
Matthias Clasen
e480fa3841 separator toolitem: Convert to gadgets 2015-12-15 08:41:16 -05:00
Matthias Clasen
f2dd4350b2 css node: Warn more
gtk_css_node_insert_before/after can easily create cycles
which later lead to stack overflows. Even if we're not
catching all cycles here, at least we can detect obviously
invalid arguments, such as inserting a node next to itself.
2015-12-15 08:41:16 -05:00
Matthias Clasen
e2bc77b9af Adwaita: Remove nonsensical expander theming
No red backgrounds, please.
2015-12-15 08:41:16 -05:00
Matthias Clasen
61fb3f828e expander: Convert to gadgets
As part of the conversion, add another CSS node for the title
area including the arrow and the label.
2015-12-15 08:41:16 -05:00
Matthias Clasen
f0a2f9ef96 revealer: Add CSS node docs 2015-12-15 08:41:16 -05:00
Matthias Clasen
f7466b236a stackswitcher: Stop hardcoding 100px width
We can now set a min-width in the theme, so we don't have to
hardcode the size request here anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=726371
2015-12-15 08:41:16 -05:00
Matthias Clasen
ad349caa00 gadget: Add some documentation 2015-12-15 08:41:16 -05:00
Matthias Clasen
9c88256441 box: Trivial doc change
All the CSS sections are named CSS nodes, so do the same here.
2015-12-15 08:41:16 -05:00
Matthias Clasen
f3561eaa9b grid: Convert to gadgets 2015-12-15 08:41:16 -05:00
Matthias Clasen
e237c947c7 headerbar: Convert to gadgets 2015-12-15 08:41:16 -05:00
Matthias Clasen
90109cfe4c actionbar: Convert to gadgets
This is a nice example of a trivial container conversion.
2015-12-15 08:41:16 -05:00
Matthias Clasen
0f7dbc3bbd Adwaita: No padding for image buttons in popovers 2015-12-15 08:41:16 -05:00
Matthias Clasen
736d864d18 modelbutton: Port to gadgets 2015-12-15 08:41:16 -05:00
Matthias Clasen
782c2762bf gadget: Be more forgiving to size inconsistencies
Instead of asserting if we hit negative content sizes,
warn and continue. This is easier to work with in this
transition period.
2015-12-15 08:41:16 -05:00
Matthias Clasen
a52c3a3db9 radiobutton: Port radio buttons to gadgets
This was already mostly done by inheritance from GtkCheckButton.
To complete it, stop using the draw_indicator vfunc for radio
buttons, and instead make the indicator gadget draw either a
check or radio.
2015-12-15 08:41:16 -05:00
Matthias Clasen
233179d374 check button: Convert to gadgets
Use a gadget for the button, and for the indicator.
A complication here is that GtkCheckButton (and
GtkRadioButton) have a totally different appearance
depending on the ::draw-indicator property. If an
indicator is not required, we just reuse the
GtkButton gadget.
This mostly works; some minor sizing issues left, e.g. cranking
up the indicator-size causes the checkbutton grid in testgtk
to overlap.
2015-12-15 08:41:16 -05:00
Matthias Clasen
37e9d92632 button: Convert to gadgets 2015-12-15 08:41:16 -05:00
Matthias Clasen
a81267c28e label: Convert to gadgets
This removes some hairy code handling with borders and padding,
which may or may not be correct. The examples in testheightforwidth
all continue to work, and min-width now works for labels.
2015-12-15 08:41:16 -05:00
Matthias Clasen
ff9f3c108f Adwaita: Update color swatch styling
The adjustments here are provisional and need an artistic eye.
2015-12-15 08:41:16 -05:00
Matthias Clasen
c376e82702 colorswatch: Convert to gadgets
Use gadgets for the widget and the overlay.
2015-12-15 08:41:16 -05:00
Matthias Clasen
fcca496734 widget: Deprecate some style properties
Deprecate the ::wide-separators and ::separator-width/height
style properties.
2015-12-15 08:41:16 -05:00
Matthias Clasen
20e1ff44e8 Adwaita: Update separator styling
Separators no longer draw a line with the foreground color,
but instead just draw background.
2015-12-15 08:41:16 -05:00
Matthias Clasen
17be791b0b separator: port to gadgets
As part of this, stop using custom rendering code for wide
and non-wide separators.
2015-12-15 08:41:16 -05:00
Matthias Clasen
9e278293ca spinner: Use a gadget
This gives us min-width/height support. Currently, the spinner
still has a hardcoded minimum size of 16 and doesn't grow beyond
32. We may want to revisit that at some point.
2015-12-15 08:41:16 -05:00
Matthias Clasen
fffa84b843 progressbar: Convert to gadgets
Use gadgets for the text, the trough and the progress.
2015-12-15 08:41:16 -05:00
Benjamin Otte
1f6efbf669 iconhelper: Queue resize on invalidation
When things change in the iconhelper, queue a resize on the owner widget
so that it automatically resizes.

Only do this for iconhelpers that are used as gadgets though, not for
temporary helpers - and to check this, check if the node is transient.
2015-12-15 08:41:16 -05:00
Benjamin Otte
3a77da9df2 entry: Turn icons into gadgets 2015-12-15 08:41:16 -05:00
Benjamin Otte
4dee06e04f spinbutton: Port the buttons to gadgets 2015-12-15 08:41:16 -05:00
Benjamin Otte
4586503e93 iconhelper: Finish gadget conversion
Implement missing vfuncs
2015-12-15 08:41:16 -05:00
Benjamin Otte
e723fccaa9 rendericon: Restore cairo matrix after rendering 2015-12-15 08:41:16 -05:00
Benjamin Otte
b79a187d47 iconhelper: Handle invalidation
When CSS, direction or scale factor change, handle the invalidation
inside the iconhelper.
This way the widgets using them don't have to.
2015-12-15 08:41:16 -05:00
Benjamin Otte
de6dca4f81 iconhelper: Use the gadget's node
... instead of looking at the widget's style context.

This removes all calls to the style context.
2015-12-15 08:41:16 -05:00
Benjamin Otte
ad22612ab2 iconhelper: Require passing a cssnode to the constructor
Note that we don't use it yet.
2015-12-15 08:41:16 -05:00
Benjamin Otte
7075d00958 iconhelper: Use the gadget's owner property
Don't keep the owner widget ourselves.
2015-12-15 08:41:16 -05:00
Benjamin Otte
25ecd8cd37 iconhelper: Turn into gadget
This is just the basic conversion to inheriting from
GTK_TYPE_CSS_GADGET.
2015-12-15 08:41:16 -05:00
Matthias Clasen
c0fd106019 image: Port to gadgets 2015-12-15 08:41:16 -05:00
Benjamin Otte
49fea0b0f5 box: Port to gadgets 2015-12-15 08:41:16 -05:00
Benjamin Otte
7a05016d93 container: Split out a function
Computing the clip for all children is something I want to do in other
places.
2015-12-15 08:41:16 -05:00
Benjamin Otte
0f8233bd7b switch: Port to gadgets 2015-12-15 08:41:16 -05:00
Benjamin Otte
e09eb4fc9f gadget: Add GtkCssCustomGadget
The thing you use when you want to custom-do everything.
2015-12-15 08:41:16 -05:00
Benjamin Otte
6eafe00d8f gadget: Add the concept of a "gadget"
A gadget is halfway between a widget and a CSS node. It's supposed to
provide the minimum convenicence around CSS nodes until we've figured
out how to integrate them with widgets.
2015-12-15 08:41:16 -05:00
Benjamin Otte
0fb01decba css: Add min-width/height CSS properties 2015-12-15 08:41:16 -05:00
Benjamin Otte
a920f7260c treeview: Reposition dnd button css node properly
After the drag ends, the button node went to the wrong place and then
looked like a regular button. Fix that.
2015-12-15 08:41:16 -05:00
Benjamin Otte
26d536a69b inspector: Fix quick-fix
Constructing GtkCssStyleChange objects without styles is forbidden, so
don't do it. Instead untangle the callback from the actual update
function and call that untangled function directly.
2015-12-15 01:15:51 +01:00
Benjamin Otte
f6606c4f6f cssnode: Clear cache if reusing style
When we reuse styles that didn't change across changes to the source
CSS, make sure we clear the caches. Otherwise child nodes will pick up
styles from the old source CSS.
2015-12-15 01:15:51 +01:00
Carlos Garnacho
f663d17c14 GtkTreeView: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:56 +01:00
Carlos Garnacho
91b5497d69 GtkNotebook: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:56 +01:00
Carlos Garnacho
fad174b967 GtkEntryCompletion: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
534b0af512 GtkComboBox: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
d54f208d29 GtkMenu: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
5cbbb90e31 GtkCellRendererAccel: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
e4eeec2163 GtkButton: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Matthias Clasen
a22c1ec980 dnd: Cleanups
Remove some now unused includes and dead code, and rename
gtk_drag_set_icon_window to gtk_drag_set_icon_widget_internal,
since it is no longer restricted to toplevel windows.
2015-12-13 18:24:41 -05:00
Matthias Clasen
95f648147d dnd: Stop doing cancel animation in GTK+
Under Wayland, the compositor does it, so there is no need
for us to move the window ourselves. For X11, we are now
doing the animation from the X11 backend. Trigger that by
calling gdk_drag_drop_done().

What changes here is that we have to keep the icon_window
alive for as long as the drag context exists. Use a weak
reference to do so.
2015-12-13 16:02:02 -05:00
Matthias Clasen
a24bbcbb8d dnd: Pass start coordinates when creating the drag context
This will be used in subsequent commits.
2015-12-13 10:39:43 -05:00
Benjamin Otte
eb97ef0514 cssnode: Set new style if it's animated
In commit 2c61316677 we avoided emitting
the style-changed signal if no CSS property changed.

Unfortunately, this also caused CSS styles to not be updated when
animations started if those animations did not change any CSS value
immediately. In those cases the animation would just never start.
The obvious example was the spinner.
2015-12-13 16:12:39 +01:00
Benjamin Otte
5cbbc62026 widget: Pass a GtkCssStyleChange instead of a bitmask 2015-12-13 04:11:58 +01:00
Timm Bäder
c219bdbecc Gestures: Add some nullable annotations 2015-12-12 09:29:08 +01:00
Timm Bäder
c3fd1b3b73 GtkFlowBox: Add missing nullable annotation 2015-12-12 09:29:08 +01:00
Timm Bäder
c02f68f0ba GtkFlowBox: Fix copy/paste mistake in docs 2015-12-12 09:29:08 +01:00
Benjamin Otte
776f034e2d cellrendererpixbuf: Don't set icon size for pixbufs
The code before the refactorings didn't set it, so we now don't set it
either.

Fixes images being way too smal inside iconviews.
2015-12-12 03:24:32 +01:00
Benjamin Otte
2c61316677 cssnode: Catch case where a style didn't change
Catch the case where a CSS style did not change and don't emit the
style-changed signal in that case.

This saves not only the emission of the signal, but also doesn't cause
invalidation in child nodes, which would previously get a PARENT_STYLE
2015-12-12 02:16:04 +01:00
Benjamin Otte
971a277419 cssnode: Change style-changed signal
Instead of having old and new style, now have a GtkCssStyleChange opaque
object that will compute the changes you are interested in for you.

This simplifies change signal handlers quite a bit and avoids lots of
repeated computation in every signal handler.
2015-12-12 02:16:04 +01:00
Matthias Clasen
0ad259a178 inspector: Hide request mode for non-widgets
Only widgets have a request mode.
2015-12-11 17:12:44 -05:00
Lapo Calamandrei
bb16ba7e31 Adwaita: menu color change on the dark variant only 2015-12-11 21:08:53 +01:00
Matthias Clasen
fb937984af file chooser: Also apply the settings
I forgot that the settings object we're dealing with here
is in delay mode, so settings won't apply immediately.
2015-12-11 12:25:31 -05:00
Matthias Clasen
d4654dd10b file chooser: Store size more frequently
We were only storing the dialog size on unmap, but resetting to the
stored default value more often, e.g. on focus-out. This was causing
the dialog to 'jump back' to its remembered size after the user
manually resized it, leading to frustration and bug reports.

Instead, save the dialog size on every ::size-allocate of the toplevel.
To avoid needlessly spamming dconf, only write the new value if it
changed.
2015-12-11 12:15:03 -05:00
Georges Basile Stavracas Neto
8884e82af8 placesviewrow: remove unneeded functions
These function declarations are not used nor implemented
anywhere, so remove them.
2015-12-11 02:28:39 -02:00
Matt Watson
ae487840f0 gtkstack: remove needless queue_resize
In gtk_stack_set_transition_position we should only need to
queue_resize if we are non-homogeneous, which is already done
earlier in the function.
2015-12-10 16:51:29 -08:00
Georges Basile Stavracas Neto
67125ae4e0 placesview: implement available space
GtkPlacesView is a widget to display locations
in the computer, such as root ("/") and volumes,
separating the persistent devices from removable
ones.

From the latest mockups[1], GtkPlacesView would
display the available space of local drives like
partitions. This, however, is not implemented in
the current codebase.

Fix that by implementing the measurement of disk
space, and adding a new property GtkPlacesView::show-disk-usage
which controls the visibility of measured disks.

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/nautilus/nautilus-next/other-locations.png

https://bugzilla.gnome.org/show_bug.cgi?id=759225
2015-12-09 20:30:10 -02:00
Cosimo Cecchi
5f45878133 statusicon: plug memory leak 2015-12-09 10:45:26 -08:00
Lapo Calamandrei
191b9d84fa Adwaita: make menu bg color the same as popovers
fixes https://bugzilla.gnome.org/show_bug.cgi?id=759260
2015-12-09 18:56:38 +01:00
Lapo Calamandrei
d266151fee Adwaita: another try at color tweakings... 2015-12-09 17:43:40 +01:00
Lapo Calamandrei
f51dfb7af8 Adwaita: some more color tweaks and sass simplification 2015-12-09 17:38:38 +01:00
Lapo Calamandrei
07506a9088 Adwaita: fix popover styling
...in the process simplified the touch-selection styling, check
and radios not fixed there since I'm going to add proper osd assets
for those (istead of forcing the dark variant assets there as before).
2015-12-09 14:54:15 +01:00
Benjamin Otte
861ac8e373 iconhelper_ Don't use deprecated functions
Use gtk_widget_get_direction() instead of
gtk_style_context_get_direction().
2015-12-09 13:30:40 +01:00
Benjamin Otte
ccfc4d3f12 iconhelper: Remove the context argument
Instead, use the widget's context.
2015-12-09 13:30:40 +01:00
Benjamin Otte
e95e2d5048 iconhelper: Get rid of _gtk_icon_helper_set_window()
Instead use the window of the owner widget.
2015-12-09 13:30:40 +01:00
Benjamin Otte
c9d1a45d30 iconhelper: Require a widget as construction argument
Note that the caller needs to ensure the widget lives as long as the
iconhelper as the iconhelper will not ref the widget.
2015-12-09 13:30:40 +01:00
Benjamin Otte
ee5758a4e1 statusicon: Port from iconhelper to imagedefinition 2015-12-09 13:30:40 +01:00
Benjamin Otte
866e7dc733 cellrendererpixbuf: Create iconhelper on-demand
Instead of storing one in the priv structure, only store an image
definition there.

This will allow future refactorings of the icon helper.
2015-12-09 13:30:40 +01:00
Benjamin Otte
01387428a3 iconhelper: Pass only the CssStyle when loading pixbufs 2015-12-09 13:30:40 +01:00
Benjamin Otte
6afeab4313 iconhelper: Remove unused GtkStyleContext parameters 2015-12-09 13:30:40 +01:00
Benjamin Otte
cf77c1695d iconhelper: Pass only the CssStyle when loading iconsets 2015-12-09 13:30:40 +01:00
Benjamin Otte
88a490fe58 iconfactory: Move private functions into private header 2015-12-09 13:30:40 +01:00
Benjamin Otte
ee6e685478 iconhelper: Pass only the CssStyle when loading icons
This is the first step in replacing StyleContext usage with CssNode
usage.
2015-12-09 13:30:39 +01:00
Matthias Clasen
8edbbde127 toolitem: Set a css name 2015-12-08 20:53:56 -05:00
Sébastien Wilmet
e2d1042b6b Don't use gtk_text_iter_begins_tag() (deprecated)
Use gtk_text_iter_starts_tag() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=759092
2015-12-08 19:56:57 +01:00
Sébastien Wilmet
1dcb3a0f88 textiter: add starts_tag() and deprecate begins_tag()
The name gtk_text_*_begins_* was used only for begins_tag(). All other
similar functions use "starts": starts_line(), starts_word(), etc.

So for consistency, add gtk_text_iter_starts_tag() and deprecate
gtk_text_iter_begins_tag().

Also change (allow-none) to (nullable), to use the new annotation.

https://bugzilla.gnome.org/show_bug.cgi?id=759092
2015-12-08 19:55:53 +01:00
Kalev Lember
9103707922 headerbar: Don't leak internal widgets
Make sure to clean up internal widgets in destroy, as these aren't
cleaned up when GtkContainer walks the childrens list in
gtk_container_destroy().

This also fixes a gedit crash as reported in
https://bugzilla.redhat.com/show_bug.cgi?id=1288669

https://bugzilla.gnome.org/show_bug.cgi?id=759132
2015-12-07 22:15:25 -05:00
Matthias Clasen
bf7a7a5f3d dnd: pass hotspot to GDK
This uses the new api introduced in the previous commits.
2015-12-07 21:54:55 -05:00
Matthias Clasen
08ecf19907 dnd: Remove an unused struct field
We only have one screen nowadays, so the fallback_icon is
never used.
2015-12-07 21:15:23 -05:00
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
Adam Reichold
5088b4937e Fix method to update menu sensitivity of combo box
After removal of the selectable header and separator from the combo box,
the method to update the menu sensitivity must be changed as it assumes
at least two items within each sub menu and contains special handling
for the separator. Removing this fixes bug #759079.
2015-12-07 11:23:18 -05:00
Matthias Clasen
f7cc4abbad Avoid ugly seams on half-tiled terminals
Since we're no longer doing geometry widgets, don't send
base size and increments to the window manager anymore either.
This avoids an ugly 2 pixel gap to the right and bottom of half-tiled
terminals under gnome-shell.
2015-12-07 10:11:06 -05:00
Matthias Clasen
88c4d06973 accel cellrenderer: Fix rendering
We were getting the "New Accelerator" text mixed with the
content of the underlying cell, since plain labels don't
have a background. Go back to putting the label in selected
state, and fix the theme to render that white-on-blue. This
was lost when we switched to using a selection sub-node.
2015-12-07 07:04:43 -05:00
Erika
05dd21be88 Correct annotations for gtk_cell_layout_get_area
The function can return NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=759081
2015-12-07 06:16:59 -05:00
Matthias Clasen
326f4739ca inspector: Redo the CSS node page
Showing two lists in a paned was a bit awkward, and space was
getting too limited. Go back to showing just the node list at
first, and make the CSS properties available via a stack. At
the same time, add a right-click context menu to the node list
to make the name and class editing more easily available.
2015-12-06 23:06:33 -05:00
Matthias Clasen
6f1c945010 inspector: Avoid a crash
gkt_cell_layout_get_area may return NULL, handle it.
2015-12-06 17:25:31 -05:00
Matthias Clasen
9c73603c16 css node: Some more docs 2015-12-06 15:42:13 -05:00
Matthias Clasen
2188fe0e54 places view: Use names for cursors
Use the standard name for the busy+interactive cursor.
2015-12-05 19:18:27 -05:00
Matthias Clasen
f76fa0411f entry: Always use cursor names
The names are the preferred API for cursors, so use it.
2015-12-05 19:17:52 -05:00
Matthias Clasen
93b3669273 Be forgiving if cursors are missing
No need to crash here. Missing cursors are ugly, but we
shouldn't crash.
2015-12-05 18:55:05 -05:00
Matthias Clasen
c73325c6b0 entry completion: Reduce the timeout
Pop up the completion window after 100ms. The previous timeout
of 300ms was making completions feel slow.

https://bugzilla.gnome.org/show_bug.cgi?id=758929
2015-12-05 14:12:27 -05:00
Matthias Clasen
12dbfe026f shortcuts: Another attempt to fix up forall
gtk_window_set_titlebar does not take ownership of the headerbar,
so we need to explicitly destroy it.
2015-12-05 13:53:23 -05:00
Matthias Clasen
c83ab24237 Remove GtkShortcutsGesture
The gesture functionality was taken over by GtkShortcutsShortcut,
so this widget is no longer needed, and it never was in a stable
release, so lets get rid of it.
2015-12-05 12:10:21 -05:00
Lapo Calamandrei
830b6f10a1 Adwaita: simpler active switch background
...removing the progressbar_fill mixin in the process.
2015-12-05 17:56:32 +01:00
Lapo Calamandrei
8f2cd874f1 Adwaita: first stab at some visual updates 2015-12-05 17:56:32 +01:00
Matthias Clasen
f210dc9281 Fix make check
GtkFontChooserWidget is using a GThemedIcon in its template,
so we need to ensure that the type is registered before
loading it. This was causing the defaultvalue test to fail.
2015-12-04 17:01:03 -05:00
Lionel Landwerlin
55e06e5d52 adwaita: fix property spelling mistake
https://bugzilla.gnome.org/show_bug.cgi?id=759048
2015-12-04 21:04:06 +00:00
Timm Bäder
ecc5342b0d GtkEntry: Recompute in text-inserted/text-deleted
The text-inserted/text-deleted handlers rely on the cursor positions
being unadjusted after the text change, so we can't do it in
buffer_notify_text.
2015-12-04 20:41:16 +01:00
Matthias Clasen
03769e3830 shortcut label: Tweak modifier key rendering
The subscript was affecting the vertical alignment too much,
so tweak the rendering of the L/R markers to avoid that. Also,
mark these as translatable.
2015-12-04 13:22:26 -05:00
Matthias Clasen
27b24bb68f Add a css name to GtkShortcutsShortcut
This will be useful for tweaking the gesture image details,
among other things.
2015-12-04 13:22:26 -05:00
Lapo Calamandrei
5cb06a30a0 Adwaita: added back progressbar.osd style 2015-12-04 19:04:17 +01:00
Lapo Calamandrei
c64452c29d Adwaita: fix scales with marks on the dark variant 2015-12-04 18:47:28 +01:00
Lapo Calamandrei
cfc17a0152 Adwaita: slight color tweaks 2015-12-04 18:43:24 +01:00
Benjamin Otte
d14e2a489a iconhelper: Fold function into callers
The function takes so many arguments and is so short that it's not worth
keeping.
2015-12-04 17:44:51 +01:00
Benjamin Otte
72d4b65b1d iconhelper: Apply icon-effect directly
Instead of creating an icon source, making sure no state is set and
therefore the icon-effect will be applied and then rendering that icon
source, just call the icon-effect apply function.

Also, the new way isn't deprecated.
2015-12-04 17:44:51 +01:00
Benjamin Otte
1b835fc7ce css: Leftover renaming gtk-image-effect => icon-effect
The previous renaming commit was incomplete, so here we go again.
2015-12-04 17:44:51 +01:00
Benjamin Otte
a37220109f render: Split out icon-effect apply function 2015-12-04 17:44:51 +01:00
Benjamin Otte
cefba86fb3 iconhelper: Return surface from icon-effect function
All the callers where converting to a surface anyway.
2015-12-04 17:44:51 +01:00
Benjamin Otte
295f208e1c iconhelper: Refactor missing icon handling
In particular, stop using deprecated code for loading the missing image
icon.
2015-12-04 17:44:51 +01:00
Benjamin Otte
3c54a49633 iconhelper: Fold function into only caller 2015-12-04 17:44:51 +01:00
Benjamin Otte
b8dd24b4fb iconfactory: Drop caching infrastructure
- icon sets are essentially unused
- the icon theme does caching
- this code complicates the restructuring I'm about to do

=> Delete it!
2015-12-04 17:44:51 +01:00
Matthias Clasen
8768c0b8ac shortcuts: Extend the accelerator syntax more
Cover cases like left+right control, and render them nicely.
The gtk3-demo builder shortcuts example shows the new
possibilities.
2015-12-04 10:56:48 -05:00
Timm Bäder
3ba11782db GtkEntry: nullable annotations 2015-12-03 20:20:58 +01:00
Timm Bäder
da477575cd GtkEntry: Return proper constants from signal handlers 2015-12-03 20:01:30 +01:00
Timm Bäder
d86ec52547 GtkTreeModel: Remove erroneous transfer annotation 2015-12-03 20:01:30 +01:00
Timm Bäder
f11f989f1f GtkEntry: Remove recompute idle
Just do it directly
2015-12-03 20:01:30 +01:00
Timm Bäder
cfc23cbf32 GtkEntry: Remove unused fields 2015-12-03 20:01:30 +01:00
Lapo Calamandrei
07ee962ed3 Adwaita: some OSD rationalization
taking care of https://bugzilla.gnome.org/show_bug.cgi?id=732528 in
the process, any toolbar.osd with a positional style class attached
gets squared corners now.
2015-12-03 19:28:57 +01:00
Lapo Calamandrei
d46ab0f62a Adwaita: scale with marks styling
I'm really sorry for the unlucky ones who would have to read that
code...
2015-12-03 18:41:35 +01:00
Lapo Calamandrei
37c943c8cd Adwaita: added back scale marks style 2015-12-03 18:41:35 +01:00
Matthias Clasen
ec5baa144d Update gtk_drag_highlight() docs
What they said was no longer true.
2015-12-03 08:37:58 -05:00
Lapo Calamandrei
234c497474 Adwaita: scale fill style 2015-12-03 12:57:02 +01:00
Sebastien Bacher
635da34908 GtkAppChooserWidget: wrap the label, use a standard icon
Let the label wrap if needed, that's required in some locales, use an
icon which is available in the theme

https://bugzilla.gnome.org/show_bug.cgi?id=758908
2015-12-03 12:45:56 +01:00
Lapo Calamandrei
081bdb07c3 Adwaita: rename scale sass templates to be more specific 2015-12-03 11:43:53 +01:00
Lapo Calamandrei
b7a980d5d8 Adwaita: added back style for scales on selected list rows 2015-12-03 11:38:50 +01:00
Lapo Calamandrei
a291003ad4 Adwaita: first stab at GtkScale and GtkProgressBar rewrite
...scale has marks stuff missing, coming soon.
2015-12-03 10:54:33 +01:00
Benjamin Otte
3ed71cf4a7 window: Deprecate gtk_window_resize_to_geometry()
And make it not do anything anymore.

Fixes erratic resizes of gnome-terminal.

https://bugzilla.gnome.org/show_bug.cgi?id=757282
2015-12-03 10:43:57 +01:00
Olivier Fourdan
de41389352 gtkwindow: Document further resize with csd
Applying the client-side decorations in the configure routine greatly
increases the chances of having the right size for the GtkHEaderBar and
border shadows.

Yet, it may be possible that these sizes change at a later point in
time, if for example the GtkHeaderBar grows in height while adding new
controls.

Mention this possible pitfall in the documentation for
gtk_window_resize().

https://bugzilla.gnome.org/show_bug.cgi?id=756618
2015-12-03 09:16:29 +01:00
Matthias Clasen
058dfb0723 entry: Use regular drag highlight
The entry code passes GTK_DEST_DEFAULT_HIGHLIGHT when setting
up the drop target, but that is ineffective because of the
custom drag_motion implementation. Instead, call
gtk_drag_[un]hightlight ourselves.
2015-12-02 23:52:55 -05:00
Matthias Clasen
0b9136842d Use :dnd pseudoclass for drag highlighting
Instead of a ::draw handler with a hardcoded outline,
use CSS for drawing the highlight.
2015-12-02 23:49:07 -05:00
Matthias Clasen
cbde3ee01f css: Add a :dnd pseudoclass
This will be used for drag highlighting.
2015-12-02 23:23:36 -05:00
Benjamin Otte
7fa37e4bf8 css: Introduct -gtk-icon-palette
This borrows heavily from the CSS4 fonts draft's font-palette, currently
found at https://drafts.csswg.org/css-fonts-4/#font-palette-control

The palette is mainly meant to trigger invalidations when colors used for
symbolic icons change, to potentially allow extending supported colors
in symbolic icons and to recolor all colors of a symbolic icon, not just
the main one.

The syntax for the property goes like this:
Name:        -gtk-icon-palette
Value:       default | name <color> [ , name <color> ]*
Initial:     default
Applies to:  all elements with icons
Inherited:   yes
Animatable:  yes, each color animated separately

The property defines a list of named colors to be used when looking up
icons. If a name is not defined, the value of the current "color"
property is used. Which names are relevant depends on the icons in use.
Currently symbolic icons make use of the names "success", "warning" and
"error".

"default" is the current behavior of the GTK when coloring symbolic
icons and is equal to the string
  success @success_color, warning @warning_color, error @error_color

Animation is crudely implemented by animating colors that are in both
palettes that are animated and otherwise keeping the color from the
palette that defined it. Note that this can cause a sharp cut at the
beginning or end of the animation when the color goes away and will
therefore be replaced with the color property.

You can see an example of animations at
http://gfycat.com/CautiousPeacefulIaerismetalmark
2015-12-03 00:47:00 +01:00
Timm Bäder
2b9d57f726 GtkRange: Return proper constants in signal handlers 2015-12-02 21:06:11 +01:00
Timm Bäder
5a6bac7831 GtkRange: Remove recalc_marks field
And instead recalculate the marks on demand, i.e. whenever we were
previously setting recalc_marks to TRUE.
2015-12-02 21:06:11 +01:00
Timm Bäder
414ffbb708 GtkRange: Use G_MININT as default mouse position, not -1
Otherwise we're getting MOUSE_WIDGET as mouse position for unmapped
GtkRanges.
2015-12-02 21:06:11 +01:00
Timm Bäder
591e7f5ef8 GtkScale: Add missing nullable annotations 2015-12-02 21:06:11 +01:00
Lapo Calamandrei
8efdd94a31 Adwaita: button.color fix
border-radius: 0 for colorswatch overlay as well.
2015-12-02 17:42:42 +01:00
Lapo Calamandrei
a25fa9922d Adwaita: vertically linked insensitive entries
Brighter border in that case as well.
2015-12-02 17:02:58 +01:00
Benjamin Otte
c10b6b7297 dnd: Add gtk_image_set_from_definition()
... and use it in the DND code, thereby getting rid of the icon helper.
2015-12-02 15:45:14 +01:00
Benjamin Otte
4d31bf91db dnd: No need to reset the icon
When we start a drag cancel animation, we can just keep the existing
window. The reset was only necessary to convert from cursor icon to
window and we removed the cursor handling.
2015-12-02 15:22:23 +01:00
Benjamin Otte
8a7dbe5f36 image: Remove unused code
I wonder how long that stuff has existed and not been used...
2015-12-02 14:56:15 +01:00
Benjamin Otte
c66a2057af image: Split out a function 2015-12-02 14:54:15 +01:00
Krzesimir Nowak
cbbaad4135 imagedefinition: Assert when trying to free empty definition
Empty definitions are not allocated on a heap, so doing a g_free() on
it would crash anyway.
2015-12-02 12:46:21 +01:00
Krzesimir Nowak
f6ce2cd975 cssprovider: Pass NULL unconditionally
We know that parent is NULL at this point.

Also, fix indentation.
2015-12-02 12:46:21 +01:00
Olivier Fourdan
e933233479 gtkwindow: apply CSD in configure size request
Just like we did for the default size, that reduces the chances of
having the headerbar missing or wrongly sized when computing the client
side decorations controls.

https://bugzilla.gnome.org/show_bug.cgi?id=756618
2015-12-02 08:41:31 +01:00
Matthias Clasen
0384f9eaf3 popover: Make position property not CONSTRUCT
There is no good reason for it, and it causes problems
with widget templates.
2015-12-02 01:07:02 -05:00
Matthias Clasen
564e11cc4e popover: Port to g_object_install_properties
And use the pspecs for notification.
2015-12-02 01:03:35 -05:00
Matthias Clasen
93d9c77ead dnd: Drop an unused argument 2015-12-02 00:51:47 -05:00
Matthias Clasen
676862a213 dnd: Some simplifications
We can now use a GtkImage instead of toplevel with
a custom draw callback and a specially prepared cairo
pattern.
2015-12-02 00:48:37 -05:00
Matthias Clasen
28b97ff0e9 dnd: Prevent black background in icons 2015-12-02 00:03:11 -05:00
Matthias Clasen
ae4f6da550 DND: Drop support for using rgba cursors as icons
This adds a lot of complication to the code, and is not really
a big win, since still need to support icon windows anyway.
2015-12-01 23:47:56 -05:00
Matthias Clasen
5bb12474d9 dnd: Fix issues with drag icons under Wayland
The Wayland dnd surface must remain in place until the drag
is over. Setting it directly as the hardcoded window of the
widget we construct carries the danger that it might get
destroyed prematurely, e.g. when the application calls
gtk_drag_set_icon_name more than once and we recreate the
widget.

Instead, create a dedicated toplevel, and reparent the widget
into it. To keep the code simple, we use the same approach
under X11 as well, and make it the responsibility of the
GDK dnd code to keep the window position updated. We already
pass the current pointer position to gdk_drag_motion, which
makes this very easy.

As a side-effect of these changes, it is now possible to use
non-toplevel widgets as drag icons.

https://bugzilla.gnome.org/show_bug.cgi?id=748763
2015-12-01 23:47:56 -05:00
Benjamin Otte
d46b67dc79 widget: Don't update pango context in state_flags_changed
It only needs to be updated in style_updated, and we do it there.
2015-12-02 05:04:41 +01:00
Benjamin Otte
3513e5e87b Chain up in state_flags_changed
When introducing handlers for state_flags_changed in the node
transitions, chaining up was forgotten.
2015-12-02 04:36:31 +01:00
Benjamin Otte
da6beb994e css: Add ability to specify icontheme in CSS
-gtk-icontheme: "oxygen" works now.

This is a very crude implementation. It's meant for testing only.
2015-12-02 03:54:41 +01:00
Benjamin Otte
e1d74f7c71 window: Listen to icon theme changes on CSS
No need to connect a signal handler to the icon theme, we get notified
via CSS.
2015-12-02 03:28:36 +01:00
Benjamin Otte
bc1b53a34c css: Query icon theme from style, not from settings
No need to look at the settings when the CSS has a property for the icon
theme.
2015-12-02 03:18:26 +01:00
Benjamin Otte
d26a4b5555 spinner: Active spinners should be :checked, not :active
If that sounds confusing, it's because GTK and CSS can sometimes not
agree on naming.

:active for CSS means that a button is currently pressed on an element.
And that is clearly not the case for spinning spinners.
2015-12-02 00:39:25 +01:00
Benjamin Otte
8355ee3053 stylecontext: Don't emit state warning for transient nodes
It's fine to call set_state() on those.

https://bugzilla.gnome.org/show_bug.cgi?id=758930
2015-12-02 00:29:36 +01:00
Benjamin Otte
2396265523 css: Rename -gtk-image-effect to -gtk-icon-effect
This is a property for icons, so we should name it as such.
2015-12-02 00:29:31 +01:00
Benjamin Otte
7f93858ccc Stop using gtk_icon_size_lookup_for_settings()
Use the equivalent gtk_icon_size_lookup() instead.
2015-12-02 00:29:31 +01:00
Benjamin Otte
0c027937e8 iconhelper: Stop tracking state
The iconfactory code doesn't use it anymore, so we don't need to track
it either.
2015-12-02 00:29:31 +01:00
Benjamin Otte
6d65b7d772 iconfactory: Make state depend on image-effect
This removes the dependency on state, which should be used for selection
CSS styles, not for actually applying them.

And image-effect does exactly what we want already, so we can start
using it.
2015-12-02 00:29:30 +01:00
Benjamin Otte
6a4b91d0ed iconhelper: Remove _gtk_icon_helper_ensure_pixbuf()
The code isn't used anymore. Everything uses
gtk_icon_helper_load_surface() now.
2015-12-02 00:29:30 +01:00
Benjamin Otte
b411c31832 statusicon: Use gtk_icon_helper_load_surface()
This is in preparation for the next commit.
2015-12-02 00:29:30 +01:00
Benjamin Otte
7a154d9acd dnd: Add gtk_drag_set_icon_definition()
... and use it for entry icons.

As a side effect, icons dragged from entries will now resize to DND
size.
2015-12-02 00:29:30 +01:00
Benjamin Otte
4a42aa5229 imagedefinition: Remove icon-size
The size of icons is a property that is relevant to who is rendering the
icon, not to the icon itself.

Example: Starting a DND operation from an entry icon should cause the
icon to resize (from the entr icon's size to the DND icon size).
2015-12-02 00:29:30 +01:00
Benjamin Otte
e99eba4415 dnd: Rewrite iconhelper code
It now uses GtkImageDefinition instead.
2015-12-02 00:29:30 +01:00
Benjamin Otte
85423ea278 entry: Use gtk_icon_helper_load_surface()
This is the first step towards getting rid of pixbuf loading code in the
icon helper.
2015-12-02 00:29:30 +01:00
Benjamin Otte
482d71d680 iconhelper: Add a scale argument to gtk_icon_helper_load_surface()
It will be used in the next patch.
2015-12-02 00:29:30 +01:00
Benjamin Otte
afad393b15 iconhelper: Refactor ensure_surface()
Make gtk_icon_helper_ensure_surface() a private function that just
ensures the surface was loaded.

Add gtk_icon_helper_load_surface() that is called by the above function
and the dnd code to actually load the surface.
2015-12-02 00:29:30 +01:00
Benjamin Otte
2ce67f0098 iconhelper: Store surface in ensure_surface()
Do not assign it in the functions that actually load the surface. Make
those just return the surface.
2015-12-02 00:29:30 +01:00
Benjamin Otte
b2584eb8ed iconhelper: Don't store surface size
Instead, compute it on demand.

This avoids having to cache it in lots of places and simplifies code.
2015-12-02 00:29:29 +01:00
Benjamin Otte
751a1a9926 iconhelper: Move invalidation check
Just do the invalidation check once, there's no need to do it in every
branch of the switch.

Also remove useless checks: These functions will not be called if we
already have a rendered surface.
2015-12-02 00:29:29 +01:00
Benjamin Otte
3bacffd063 dnd: Use surface for dnd icon instead of pixbuf 2015-12-02 00:29:29 +01:00
Benjamin Otte
c601a9653a iconhelper: Move invalidation check
Just do the invalidation check once, there's no need to do it in every
branch of the switch.

Also remove useless checks: These functions will not be called if we
already have a rendered surface.
2015-12-02 00:29:29 +01:00
Benjamin Otte
afd0e28437 iconhelper: Improve size determination for surfaces
Instead of just working for image surface, this should now work for all
bounded surfaces.

Test included.
2015-12-02 00:29:29 +01:00
Benjamin Otte
071d2a1d69 iconhelper: Move size computation
We do a switch on the image type, so compute the size for a certain
image type right there.
2015-12-02 00:29:29 +01:00
Benjamin Otte
a81bdf1e60 image: queue_resize() after changing icon-size property 2015-12-02 00:29:29 +01:00
Benjamin Otte
1c96b703a6 dragsource: Store an itemdefinition, not an iconhelper
The icon is never rendered, so there's no need for the extra iconhelper
code.
2015-12-02 00:29:29 +01:00
Benjamin Otte
e666106a43 imagedefinition: Split out from icon helper
The image definition is supposed to hold the description about the image
to be displayed. The icon helper actually does caching and tracks
changes.
2015-12-02 00:29:29 +01:00
Benjamin Otte
67ab00e01e window: Remove suspicious branch
It seems this branch is not needed anymore. It was originally added in
1999 to support gtk_widget_realize(), but all those reasons seem
obsolete today.
Instead just call gtk_widget_realize().

If you end up at this commit when bisecting:
There is no bug that made me remove this code, it was purely meant to be
cleanup / dead code removal. I seem to have introduced a new bug or
bisecting wouldn't have let you here. So it seems we should just revert
this commit.
2015-12-02 00:29:29 +01:00
Matthias Clasen
e626038467 popover: Make it possible to constrain to toplevel
Under X11, popovers are always constrained to the toplevel
window. Under Wayland, they aren't. This commit adds a
property that allows to explicitly constrain popovers to
the toplevel, giving them the same behavior under Wayland
as under X11.

https://bugzilla.gnome.org/show_bug.cgi?id=757474
2015-12-01 17:26:25 -05:00
Christian Hergert
5dcf4e10b7 filechooserbutton: add some spacing between icon and text
These were a bit crammed, which doesn't match well with spacing used in
various other parts of gtk.
2015-12-01 11:23:12 -08:00
Olivier Fourdan
103d369ff6 gtkwindow: remove headerbar after disposing parent
Widgets such as gtkfilechooser may be saving their size and position on
the unmap callback, if the client-side decoration header bar is removed
first, the reported size will be wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=756618
2015-12-01 16:18:03 +01:00
Timm Bäder
a28103cf51 Add some more missing nullable annotations 2015-12-01 13:41:35 +01:00
Timm Bäder
88b4955fd9 GtkBox: The center widget can be NULL
Propagates to GtkActionBar.
2015-12-01 13:41:35 +01:00
Timm Bäder
1551ad4908 GtkWidget: Add some missing nullable annotations 2015-12-01 13:41:35 +01:00
Matthias Clasen
150728d6b0 inspector: Show the size request mode
This is not a property, so show it in the misc page.
2015-11-30 22:27:27 -05:00
Matthias Clasen
d908c38ec3 window: Use g_set_object
No need to do the same thing manually.
2015-11-30 20:45:57 -05:00
Sébastien Wilmet
1a8f3e2462 textiter: fix bug in case insensitive backward search
'win.lines' contains the same content as the GtkTextBuffer, so to find
@match_start, forward_chars_with_skipping() is called with
skip_decomp=FALSE (the last parameter). So far so good.

On the other hand, the content 'lines' (the needle split in lines) is
casefolded and normalized for a case insensitive search. So,
forward_chars_with_skipping(..., skip_decomp=TRUE) must be called only
for the portion of text containing the needle.

Since 'start_tmp' contains the location at the start of the match, we
can simply begin at that location to find the end of the match.

Unit tests are added.

https://bugzilla.gnome.org/show_bug.cgi?id=758698
2015-11-30 19:46:16 +01:00
Florian Müllner
0a35886b0a listbox: Use :focus-on-click policy from row instead of list
Using the property from the container is inconsistent with the
:selectable and :activatable properties, which are per row.
2015-11-30 17:59:06 +01:00
Matthias Clasen
373ce9f652 stack: Update windows before allocating children
Doing things the other way around seems to cause problems in
some cases where children want to do different things depending
on the window position.

https://bugzilla.gnome.org/show_bug.cgi?id=758563
2015-11-30 10:41:13 -05:00
Emmanuele Bassi
11eab60f43 scalebutton: Annotate the return type
Instead of just listing the return type of get_plus_button() and
get_minus_button() in the documentation, we can use the (type)
annotation to ensure that the introspection data reflects the actual
type of the returned widget.
2015-11-30 14:09:19 +00:00
Benjamin Otte
f30b4ba22e gtkwindow: fix regression with firefox dropdown menu
Fix a regression introduced by:

commit 6866d1c widget: Make gtk_widget_queue_allocate() not resize

Where the dropdown menu in Firefox would not be relocated after the
toplevel window is moved.

bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=758609
2015-11-30 14:32:39 +01:00
Timm Bäder
886686973c GtkScaleButton: _get_(plus|minus)_button returns a GtkButton
https://bugzilla.gnome.org/show_bug.cgi?id=539944
2015-11-28 21:09:53 +01:00
Matthias Clasen
8ea14162d3 Adwaita: No background for spinners
Blue background for spinners doesn't make sense.
2015-11-26 15:08:54 -05:00
Carlos Garnacho
4981ca9f13 GtkWindow: Reset gestures after triggering right click titlebar action
Just like it happens for window dragging, we're likely to not see the
matching button release for this event, so we must reset the controller
manually here.

https://bugzilla.gnome.org/show_bug.cgi?id=758661
2015-11-25 21:59:48 +01:00
Benjamin Otte
923ad2767a window: Don't lose position information
Before calling gdk_window_move_resize(), store the full configure
request, not just width and height.

Fixes firefox randomly losing position of its dropdown windows.

https://bugzilla.gnome.org/show_bug.cgi?id=758609
2015-11-25 20:31:27 +01:00
Benjamin Otte
415030d25f dnd: Split GtkDragSourceSite into its own file 2015-11-25 20:31:27 +01:00
Christoph Reiter
ee3397388f dnd-quartz: fix missing icon helper include 2015-11-25 20:27:21 +01:00
Benjamin Otte
2bee73c1f9 dnd: Just pass iconhelper instead of whole DragSourceSite
Simplifies the code.
2015-11-25 16:32:40 +01:00
Benjamin Otte
175d5d580e dnd: Remove unused struct members 2015-11-25 16:32:40 +01:00
Benjamin Otte
29cdb2001c iconhelper: Don't include gtk.h 2015-11-25 16:32:39 +01:00
Benjamin Otte
4843925660 iconhelper: Remove unused function 2015-11-25 16:32:39 +01:00
Benjamin Otte
2a8e6619a7 iconhelper: Remove unused context argument
Various functions don't use the style context.
2015-11-25 16:32:39 +01:00
Matthias Clasen
3e8eacc8b7 dialog: Use an element name
This will help differentiating dialogs from other windows, style-wise.
2015-11-24 07:41:26 -05:00
Timm Bäder
bd0f217ff4 GtkPopover: Restore tails
The call to gtk_style_context_get_border was accidentally removed in
2182fe7d9d.
2015-11-24 11:37:00 +01:00
Timm Bäder
df2cb5befc inspector: Leave unneeded widgets out of source files 2015-11-24 11:17:10 +01:00
Timm Bäder
5e2aec7cbb GtkWidget: Add some missing nullable annotations 2015-11-24 11:17:10 +01:00
Timm Bäder
f154875e08 GtkStack: Add some missing nullable annotations 2015-11-24 11:16:51 +01:00
Matthias Clasen
3b0ceea08b shortcuts section: Fix destroy
The container destroy implementation does not quite work here,
so do our own.
2015-11-23 19:48:50 -05:00
Matthias Clasen
8e12943a09 Raleigh: Avoid deprecated icon-shadow 2015-11-23 17:01:22 -05:00
Matthias Clasen
3532cd5365 places view: Fix up docs 2015-11-23 17:01:22 -05:00
Rico Tzschichholz
5d8f45c708 gtk: Fix make dist 2015-11-23 22:24:41 +01:00
Carlos Garnacho
728d63bfc3 searchenginetracker: Remove astray ");" closing a function
Sad face for me.
2015-11-23 18:20:44 +01:00
Carlos Garnacho
f6dd0438d1 searchenginetracker: Optimize direct/recursive folder lookups
tracker:uri-is-descendant/parent has the unfortunate side effect of
rendering the collation mechanisms in the database useless, so those
require full table scans to be validated.

Performing these as pure string comparisons will perform much better,
as those allow the underlying sqlite to rely on its own collation
to perform the search, which can be significantly faster with many
elements in the database.

https://bugzilla.gnome.org/show_bug.cgi?id=758407
2015-11-23 17:58:34 +01:00
Carlos Garnacho
61d6c1a523 searchenginetracker: ensure nie:url is bound
This could produce strange warnings as it is currently passed to
tracker:uri-is-* sparql functions, as these expect no NULLs.

https://bugzilla.gnome.org/show_bug.cgi?id=758407
2015-11-23 17:58:34 +01:00
Jakub Steiner
bb183ae591 last last gesture stock image fixes
- swipe left was missing outline conversion to allow recolorization
2015-11-23 16:13:45 +01:00
Matthias Clasen
b6e03dbc26 Load gesture images as symbolic icons
This makes them recolor in the dark theme, which looks better.
2015-11-23 10:08:14 -05:00
Jakub Steiner
454a4b7576 gesture stock images size fix
fit all images to 64x64
2015-11-23 15:53:02 +01:00
Jakub Steiner
24cedfd87e gesture stock images fixes
- convert all objects to shapes to allow css recoloring
  ala symbolic icons
2015-11-23 15:45:24 +01:00
Jakub Steiner
25d5fd97e9 more gesture stock images tweaks
- rotation gestures more natural look
2015-11-23 14:40:30 +01:00
Matthias Clasen
98fd5bda58 Tweak the gtk-font-name setting docs
Clarify that only parts of the font name are used.

https://bugzilla.gnome.org/show_bug.cgi?id=758367
2015-11-23 08:18:37 -05:00
Jakub Steiner
3e649c4812 gesture stock images sizing
- make swipe left and right less wide
2015-11-23 14:06:18 +01:00
Jakub Steiner
1cd5ef5285 minor touchups on stock gesture images
- add minimal margin for safe scaling
- fixed height of 64pixels
- pixel alignment issues (grid fit)
2015-11-23 13:53:12 +01:00
Matthias Clasen
50abc8b525 shortcuts: Add set properties for optional things
This makes it possible to switch between gesture and accelerator
types and override the builtin icons and subtitles for predefined
gestures.
2015-11-22 22:41:48 -05:00
Matthias Clasen
304c5ac226 shortcuts: Add support for standard gestures
Add an enum for gestures that GtkShortcutsShortcut knows how
to show an image and subtitle for.

https://bugzilla.gnome.org/show_bug.cgi?id=758187
2015-11-22 22:41:48 -05:00
Matthias Clasen
62620a5244 Add stock gesture images
These will be used in the shortcuts window.
2015-11-22 22:41:48 -05:00
Matthias Clasen
c6dc863e90 shortcuts shortcut: Take over gesture functionality
It turns out that it is nicer in glade to have just a single
widget that can show either a shortcut or a gesture, so make
GtkShortcutsShortcut do it both.

GtkShortcutsGesture is now redundant and will be removed before
the next stable release.
2015-11-22 22:41:48 -05:00
Matthias Clasen
b1aef18c84 shortcuts: Fix size group handling
We need to keep pointers to the size groups and apply
them to shortcuts that are added later.
2015-11-22 22:41:48 -05:00
Matthias Clasen
a661ce4d06 shortcuts: Complete the container implementations
Various problems with the container implementations in
GtkShortcutsWindow, Section and Group were showing up
in glade.
2015-11-22 22:41:48 -05:00
Matthias Clasen
520da80bd0 shortcuts: Update title and section-names properly
The current code in gtkshortcutswindow.c is good enough to
construct a widget once from a .ui file, but fails to handle
changes at runtime, as happen e.g. in glade. Fix this by
listening for changes to section-name and title.
2015-11-22 22:41:48 -05:00
Timm Bäder
2182fe7d9d Don't pass widget state flags to GtkStyleContext API 2015-11-22 17:11:35 +01:00
Cosimo Cecchi
9ba94849e8 GtkRenderBorder: make one function static 2015-11-21 14:55:13 -08:00
Cosimo Cecchi
b821f132d1 GtkCssImage: formatting fixes 2015-11-21 14:52:18 -08:00
Matthias Clasen
036ee7a68b inspector: Always underline at least one char
Empty underlines are hard to make out. Since we get somewhat
unreliable section information from the CSS parser, we just
make sure that we always underline at least one character.
2015-11-20 20:59:53 -05:00
Benjamin Otte
ee1381a1f3 cssnodedeclaration: Only set the id on the widget path if we have one
Widget paths don't like NULL.
2015-11-21 02:40:53 +01:00
Matthias Clasen
adead3b499 Update key themes to use -gtk-key-bindings
The name gtk-key-bindings has been deprecated and causes warnings.
2015-11-20 20:35:39 -05:00
Matthias Clasen
d267b8e028 Rename the gtk-key-bindings property
This is not a standard CSS property, so rename it to
-gtk-key-bindings. We still support the old name, with a
deprecation warning.
2015-11-20 20:35:39 -05:00
Matthias Clasen
ba1fb4b0a7 HighContrast: use -gtk-icon-shadow
The name icon-shadow has been deprecated and causes warnings.
2015-11-20 20:35:39 -05:00
Matthias Clasen
b1f0283630 Adwaita: use -gtk-icon-shadow
The name icon-shadow has been deprecated and causes warnings.
2015-11-20 20:35:39 -05:00
Matthias Clasen
5f73e8a720 Rename the icon-shadow property
This is not a standard CSS property, so rename it to
-gtk-icon-shadow. We still support the old name, with a
deprecation warning.
2015-11-20 20:35:39 -05:00