Commit Graph

22867 Commits

Author SHA1 Message Date
Benjamin Otte
21c3b13596 stylecontext: Simplify a function 2015-03-18 15:23:29 +01:00
Benjamin Otte
40d94fcd38 stylecontext: Remove values cache
The code is confusing the stylecontext=>node transition, so I'll remove
it.

WIth the recent introduction of the parent style cachen, I'm not sure
it's worth it at all. Some crude benchmarking suggests a slight speedup
when removing the cache.

So no guarantees about adding it back later.
2015-03-18 15:23:29 +01:00
Benjamin Otte
e2f6d4db43 cssnode: Split into 3 objects
- GtkCssWidgetNode
  for style contexts owned by a widget
- GtkCssPathNode
  for style contexts using a GtkWidgetPath
- GtkCssTransientNode
  for nodes created with gtk_style_context_save()/restore()
2015-03-18 15:23:29 +01:00
Benjamin Otte
726d8abb7d cssnode: Turn into a GObject
This will allow us to use subclasses.
2015-03-18 15:23:28 +01:00
Benjamin Otte
cf6d9edc12 stylecontext: Turn CssNode accesses into getters/setters
That way we can hide the struct in the source file.
2015-03-18 15:23:28 +01:00
Benjamin Otte
be596f3967 stylecontext: Split out GtkCssNode into own file
The functionality of it is supposed to grow, so better put it in a
custom file early.

This is just a naive split so far, the next patches will split things
further.
2015-03-18 15:23:28 +01:00
Benjamin Otte
99c4f2dd39 render: Make image effect not depend on state
Instead rely on -gtk-image-effect only. Adwaita should already work this
way.

Relying on state was a leftover feature from the GTK 2 days.
2015-03-18 15:22:09 +01:00
Benjamin Otte
0529e15d61 notebook: Protect against invalid allocations
A widget can be mapped but not have a size allocated yet. In that case
avoid computing a broken rectangle.

https://bugzilla.gnome.org/show_bug.cgi?id=746301
2015-03-18 15:14:47 +01:00
Christian Hergert
28063ee2e4 textview: add support for underline and strikethrough colors
This commit adds the GtkTextTag:underline-rgba and :strikethrough-rgba
properties and the necessary plumbing to apply these colors in GtkTextLayout.
With this change, you can alter the color of underlines including those
of type PANGO_UNDERLINE_ERROR.

You might want to alter the underline color to differentiate between
spelling and grammer mistakes. In code editors, it is convenient to
differentiate between errors and warnings.

Note that the GtkTextAppearance struct is public ABI and has no spare
room for new fields, so we are resorting to some tricky packing to store
the colors in the unused pixel field of the fg_color and bg_color structs.
This packing is accomplished by the macros in gtktextattributesprivate.h.

Signed-off-by: Christian Hergert <christian@hergert.me>

https://bugzilla.gnome.org/show_bug.cgi?id=402168
2015-03-17 23:24:13 -04:00
Matthias Clasen
416c370da1 GtkRange: Fix scroll wheel direction for horizontal ranges
The expected behavior here is that scrolling up goes towards
larger values, ie to the right. This matches e.g. volume
sliders in gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=737175
2015-03-17 22:02:35 -04:00
Matthias Clasen
d823c39caf scrolled window: Use shift to modify scroll direction
It has been a long-standing request to interpret scroll events
with Shift held down as horizontal instead of vertical, and
some applications are already doing this on their own.

https://bugzilla.gnome.org/show_bug.cgi?id=132197
2015-03-17 20:50:24 -04:00
Matthias Clasen
00544e9090 HighContrast: Fix calendar selection
The selected day was not differentiated from other
days at all. Render it white on black instead.

https://bugzilla.gnome.org/show_bug.cgi?id=746369
2015-03-17 19:38:18 -04:00
Matthias Clasen
3d3591e873 HighContrast: Fix color chooser marks
The checkmark for the selected color was always black,
making it more or less invisible on dark colors.

https://bugzilla.gnome.org/show_bug.cgi?id=746368
2015-03-17 19:34:15 -04:00
Jakub Steiner
49b6be4e06 HighContrast: catch backdrop:insensitive:active of GtkSwitch
https://bugzilla.gnome.org/show_bug.cgi?id=746358
2015-03-17 23:55:10 +01:00
Jakub Steiner
557f5d5c7c HighContrast: unbreak GtkExpander
- the open state is checked, not active now

https://bugzilla.gnome.org/show_bug.cgi?id=746370
2015-03-17 23:43:20 +01:00
Jakub Steiner
f671cd6296 HightContrast: make tab buttons not shift size
- only 1px stroke for close buttons in notebook tabs

https://bugzilla.gnome.org/show_bug.cgi?id=746149
2015-03-17 18:18:18 +01:00
Jakub Steiner
9b5fa0860f HighContrast: OSD fixes
- buttons
- labels
- scale trough/slider

https://bugzilla.gnome.org/show_bug.cgi?id=746148
2015-03-17 18:09:28 +01:00
Jakub Steiner
6f478db2fa Adwaita: desaturate selected color for backdrop
https://bugzilla.gnome.org/show_bug.cgi?id=746202
2015-03-16 19:41:19 +01:00
Matthias Clasen
c7672699e9 Don't pass invalid rectangles to cairo
This causes pixman warnings, or worse.
Clearly, something is not quite right here, if we end up
redrawing tabs at a time when the allocation is set to (1, 1).
For now, avoid straining the error handling in the lower layers.

https://bugzilla.gnome.org/show_bug.cgi?id=746301
2015-03-16 12:51:56 -04:00
Matthias Clasen
855c4dc0ce unrealize: Don't ref twice
After the recent change to add an outermost ref/unref pair,
we can do away with the inner one.
2015-03-16 11:54:38 -04:00
Carlos Garnacho
70e7b4c848 inspector: Remove flash timeout from widgets being unmapped
Otherwise the timeout can keep running, even if the widget is being
destroyed.
2015-03-16 16:29:37 +01:00
Carlos Garnacho
b4b23580a6 window: Protect against popover destruction on ::unmap
On popover_unmap(), perform the gtk_widget_unmap() call last, so the
GtkWindowPopover data is ensured to be alive throughout the function
if the popover widget is destroyed right on ::unmap.

https://bugzilla.gnome.org/show_bug.cgi?id=745829
2015-03-16 16:27:06 +01:00
Carlos Garnacho
b4e61b759b widget: Take a ref during ::unrealize emission
In order to prevent invalid memory access/crashes if the widget is
destroyed in a callback of that signal.

https://bugzilla.gnome.org/show_bug.cgi?id=745829
2015-03-16 16:27:06 +01:00
Carlos Garnacho
f5f6ad9981 widget: Take a ref during ::unmap emission
This ensures the widget data stays live long enough to perform invariants
check after emission if the widget happens to be destroyed on a callback.

https://bugzilla.gnome.org/show_bug.cgi?id=745829
2015-03-16 16:22:25 +01:00
Benjamin Otte
a24aee6bb2 spinbutton: Fix get_text_area_size for vertical spinbuttons
Commit c5905b13b9 changed the semantics of
this vfunc and get_entry_size but I only fixed one of them in the
spinbutton subclass.

https://bugzilla.gnome.org/show_bug.cgi?id=746282
2015-03-16 15:24:16 +01:00
Jakub Steiner
6675b9639c HC: no border for insensitive backdrop buttons
https://bugzilla.gnome.org/show_bug.cgi?id=746192
2015-03-16 12:37:54 +01:00
Matthias Clasen
e98b096ca8 print dialog: Stop using follow-state
It is no longer needed.
2015-03-15 22:44:33 -04:00
Matthias Clasen
399d2c1389 app chooser widget: Stop using follow-state
It is no longer needed.
2015-03-15 22:44:33 -04:00
Matthias Clasen
59a901e285 places sidebar: Stop using follow-state
It is no longer needed.
2015-03-15 22:44:33 -04:00
Nelson Benítez León
11096885ae gemfile: needs add source rubygems.org
`bundle install` command on fedora 21 was failing
with following message:

Your Gemfile has no gem server sources. If you need
gems that are not already on your machine, add a line
like this to your Gemfile:
source 'https://rubygems.org'

After adding that line it worked again.

https://bugzilla.gnome.org/show_bug.cgi?id=746205
2015-03-14 23:48:21 +01:00
Benjamin Otte
c5905b13b9 entry: Make code do what it's meant to do
With the 3.0 transition, this code went from just querying the entry's
height request to doing a full size request.
Then it got code to revert the features that a full size request does.
And then it grew code that manually computed the baseline.

Avoid this and just do what happened back in the days: Do a regular
height request.

This changes the semantics of the get_frame_size() vfunc wrt its
behavior towards subclasses overwriting the get_height() vfuncs, but I'm
happy to live with that.
2015-03-14 15:46:13 +01:00
Benjamin Otte
d2881d901b cellrendererpixbuf: Always follow state
Applications forget to set the follow-state property and then some
themes used a style where normal symbolic icons have the same color as
prelit or selected backgrounds and that suddenly made icons invisible
and who wants that?

https://bugzilla.gnome.org/show_bug.cgi?id=746201
2015-03-14 15:46:13 +01:00
Carlos Soriano
7ef7873b23 gtkstacksidebar: fix missing macro
commit e41cadd835 forgot to change some macros.
2015-03-14 13:41:57 +01:00
Matthias Clasen
e41cadd835 GtkStackSidebar: Fix incomplete renaming
Some of the boilerplate macros were missing. Oops
2015-03-13 23:24:53 -04:00
Matthias Clasen
0ddb5d729c More documentation fixes 2015-03-13 23:24:53 -04:00
Matthias Clasen
c93d66c8a7 Fix a typo in the docs
gtk-doc complains about parameter name mismatches.
2015-03-13 23:24:53 -04:00
Matthias Clasen
fec8a1ee7f menu button: Improve accessibility
Rework the way we assign an accessible name to menu buttons,
to make sure we pick up a label, should the button contain
one, and only override the name with "Menu" as a fallback.
2015-03-13 18:38:18 -04:00
Benjamin Otte
49881eebbb Revert "iconhelper: Don't check states"
This reverts commit 63f59dde3a.

It turns out, the state was not just necessary for style computation,
but also for tracking RTL and LTR. And so it broke the reftests.
2015-03-12 04:31:45 +01:00
Benjamin Otte
7ad203732f iconhelper: Use the screen's icon theme
... and not the default one.
2015-03-12 01:15:38 +01:00
Benjamin Otte
93f8966bd9 iconhelper: Replace function
The old one just calls the other one.
2015-03-12 01:15:38 +01:00
Benjamin Otte
181e58e402 iconhelper: Move function from style context into only user 2015-03-12 01:15:38 +01:00
Benjamin Otte
63f59dde3a iconhelper: Don't check states
This is the wrong thing to do in today's world.
2015-03-12 01:15:38 +01:00
Matthias Clasen
b2d40afdf5 App Chooser: Fix app icons in HighContrast
We need to follow-state here as well, to make sure the
icons are visible on selected rows.
2015-03-11 15:32:47 -04:00
Philip Withnall
80013436d0 gtkentry: Document vfuncs in GtkEntryClass
Clarify that the signal handler vfuncs can be NULL, nothing else can,
and that they all have default implementations.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-11 11:24:29 +00:00
Philip Withnall
52858f709c gtktreeselection: Fix an abort on selecting an invalid range
gtk_tree_selection_real_modify_range() has a g_return_if_fail() if the
start or end paths passed to it do not correspond to real tree nodes.
However, GtkTreePaths inherently do not have to be valid, so it should
be acceptable to call gtk_tree_selection_select_range() with
non-existent paths. Replace the g_return_if_fail() by a silent return,
and add a unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-11 11:24:29 +00:00
Philip Withnall
d65ccf96ee gtknotebook: Add more non-NULL checks for cur_page
These were not spotted by scan-build, but from some brief mental
reasoning could potentially be problem areas.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-11 11:24:29 +00:00
Matthias Clasen
3b45be94e8 Gestures: Properly handle weak references
Every call to g_object_add_weak_pointer must be matched with
a g_object_remove_weak_pointer call, or we will get invalid
writes inside GObject.

https://bugzilla.gnome.org/show_bug.cgi?id=746013
2015-03-11 06:47:04 -04:00
Emmanuele Bassi
a52ff2f66e build: Fix generating introspection on MacOS
We need to filter out platform-specific sources from the files that we
use with the introspection scanner.

In this specific case I could have moved the gtkclipboard-quartz.c and
the gtkdnd-quartz.c files out of the $(gtk_base_c_sources) variable, but
doing a filter-out on the variable itself is more resilient in case we
eventually add files and we forget about the result.
2015-03-10 22:15:56 +00:00
Matthias Clasen
073a9c9cd5 inspector: Add some margin to css editor
Requested in
https://bugzilla.gnome.org/show_bug.cgi?id=745918
2015-03-10 14:07:27 -04:00
Carlos Garnacho
622a930c5a window: reset both press/drag gestures when move/resize drag starts
Now that this is split in two separate gestures, both must be reset
when the WM grabs the pointer. Also, do on resize drags like on move
drags, and claim the gesture before resetting, so the ownership is
properly transferred across any other widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=745969
2015-03-10 16:48:16 +01:00