Commit Graph

25265 Commits

Author SHA1 Message Date
Matthias Clasen
6f889e832c css: Support CSS names for pseudo states
What we call :insensitive is called :disabled in CSS, and
:inconsistent is :indeterminate. Recognize these names, but
still support the old ones.
2015-12-21 08:26:58 -05:00
Matthias Clasen
2599ca4d9f Adwaita: Attempt a fixing split headers
Remove decorations from headerbars which are wrapped in some
other containers (like boxes, or paneds), to prevent double
decorations in those cases.
2015-12-21 07:46:37 -05:00
Lapo Calamandrei
a54fadced6 Adwaita: make progressbars and scales the same size 2015-12-21 11:50:56 +01:00
Lapo Calamandrei
124923213f Adwaita: progressbar sizing and progress component positioning
shrinked progressbars a bit and moved the progress component start
and end over the trough border.
2015-12-21 11:28:45 +01:00
Matthias Clasen
436a258bb0 Fix a typo 2015-12-20 23:50:40 -05:00
Matthias Clasen
0473736499 Fix parsing of font-weight
The parser was turning a 400 into a 200 and a 700 into a 500.
2015-12-20 17:51:47 -05:00
Matthias Clasen
0520ca3bdf buttonbox: Fix size request
A copy-paste mistake was making us always request too little
space, causing the buttons to be jumbled or cut off.

https://bugzilla.gnome.org/show_bug.cgi?id=759664
2015-12-20 17:03:06 -05:00
Matthias Clasen
6a67df79a8 inspector: Avoid criticals in the css editro
We can't keep text iters around after text buffer has been
changed. Just clear the list errors when the buffer changes
before we've passed it again.
2015-12-20 14:43:14 -05:00
Michael Catanzaro
c3d611fcf2 entry: Fix typo 2015-12-20 11:52:30 -06:00
Matthias Clasen
ea01921d09 modelbutton: Stop saving cairo state
GtkBuiltinIcon does this now on its own.
2015-12-20 01:04:59 -05:00
Matthias Clasen
9ac80c2510 checkbutton: stop saving cairo state
GtkBuiltinIcon now does this on its own.
2015-12-20 01:04:13 -05:00
Matthias Clasen
db7f269c03 Some updates to the CSS docs
Remove references to regions and engines, emphasize
element names over type names, update the list of
pseudo-states.
2015-12-20 01:03:38 -05:00
Cosimo Cecchi
c9e27636b6 checkmenuitem: port indicator gadget to GtkBuiltinIcon
Saves a lot of code.
2015-12-19 21:22:37 -08:00
Cosimo Cecchi
ce6cd49475 menuitem: port arrow gadget to GtkBuiltinIcon
Saves a lot of code.
2015-12-19 21:22:37 -08:00
Cosimo Cecchi
22ec899f23 menuitem: simplify code
Only cast once.
2015-12-19 21:22:37 -08:00
Cosimo Cecchi
aadc13c4ec builtinicon: save/restore cairo context when rendering 2015-12-19 21:22:37 -08:00
Cosimo Cecchi
4ec99db368 checkmenuitem: deprecate indicator-size style property
We can now use min-width/min-height.
2015-12-19 21:22:37 -08:00
Cosimo Cecchi
5a87b5bbce menuitem: deprecate toggle-spacing style property
We can move this to just use the actual GtkCssGadget of the menu item.
2015-12-19 21:21:16 -08:00
Cosimo Cecchi
3af5c83cd3 checkmenuitem: use a gadget for the check indicator
This will make margins and other CSS properties work correctly on the
indicator.
2015-12-19 21:21:16 -08:00
Cosimo Cecchi
0e24d6cd85 theme: fix menu check/radio styling
This is a leftover from the CssNode port of GtkCheckMenuItem and
GtkRadioMenuItem.
2015-12-19 21:21:16 -08:00
Cosimo Cecchi
b602dc2eed menuitem: trivial cleanup 2015-12-19 21:21:16 -08:00
Cosimo Cecchi
871a8c0e16 checkmenuitem: prefer early return 2015-12-19 21:21:16 -08:00
Cosimo Cecchi
7959c3fb6e menuitem: deprecate arrow-scaling style property
With this, we can also remove the custom measure function of the arrow
gadget.
2015-12-19 21:21:16 -08:00
Cosimo Cecchi
2d5d7d8cf2 menuitem: convert arrow rendering to GtkCssGadget
This also deprecates the arrow-spacing style property, which can be now
replaced with a simple margin.
2015-12-19 21:21:16 -08:00
Cosimo Cecchi
f49a5bf116 menuitem: deprecate width-chars style property
Instead, we can just set min-width.
2015-12-19 21:21:16 -08:00
Cosimo Cecchi
f2adb5779f menuitem: port to gadgets
This is not a complete conversion yet - more changes will come in later
commits.
2015-12-19 21:21:16 -08:00
Cosimo Cecchi
11d9da08a9 menuitem: use gtk_container_class_handle_border_width() 2015-12-19 21:21:16 -08:00
Cosimo Cecchi
35ed13ac54 menuitem: really ignore horizontal-padding
This style property has been documented as been ignored for a long time,
but we were still reading it in some cases.
2015-12-19 21:21:16 -08:00
Matthias Clasen
f792d20507 statusbar: Deprecate style properties
We were not really using the shadow-type style property anyway,
so lets just deprecate it. Themes can directly theme the frame.
2015-12-19 23:53:31 -05:00
Matthias Clasen
57dd855d10 Adwaita: Drop some deprecated style properties
These can now be replaces with min-width/min-height.
2015-12-19 23:24:27 -05:00
Matthias Clasen
c0683d9267 checkbutton: Fix regression from builtin icon
The leaking of cairo transforms from builtin icon drawing
was causing the label to be drawn at the wrong position.
2015-12-19 23:23:09 -05:00
Matthias Clasen
f7236b261b modelbutton: Fix state confusion
Checked buttons were getting the wrong image.
2015-12-19 21:56:05 -05:00
Matthias Clasen
f0fba02dca Adwaita: Try harder to fix arrow rendering
Fiddle with specificity to keep hovered modelbutton arrows
from rendering background.
2015-12-19 20:46:26 -05:00
Matthias Clasen
7aeb57cdfd modelbutton: Hide checks initially
Manually constructed model buttons were always ending up
with a check. Fix that by hiding the indictator node initially.
2015-12-19 20:16:51 -05:00
Matthias Clasen
0b7226e96e Adwaita: Fix treeview headers
The borders went missing on these, at some point.

https://bugzilla.gnome.org/show_bug.cgi?id=759567
2015-12-19 17:34:21 -05:00
Matthias Clasen
bca4755228 modelbutton: Use a builtin icon for the arrow
No need to do this manually.
2015-12-19 14:53:57 -05:00
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