Commit Graph

126 Commits

Author SHA1 Message Date
Matthias Clasen
4930153413 Finish conversion of pixbuf cell renderer icon size
Change the name of the property from stock-size to icon-size,
and make it an enum property instead of uint. This makes it
impossible to specify invalid numeric values in ui files, and
at the same time makes it possible to refer to the existing
values by their nick.

Fix up the callers.
2017-12-01 10:36:17 -05:00
Daniel Boles
23f7208235 CellRendererPixbuf: Link stock-size doc → IconSize
Add a doc comment for :stock-size in order to link to GtkIconSize.
2017-11-22 20:48:11 +00:00
Matthias Clasen
c6c3427507 iconhelper: Query size via CSS
Instead of looking at the icon size, look at the CSS value for
-gtk-icon-size. Set style classes depending on icon size instead.

Trivially change Adwaita and HighContrast to report the same values as
before.
2017-11-15 14:22:17 -05:00
Matthias Clasen
2301d8d90b enums: Change GtkIconSize values
The new values are the ones we intend to keep. The old ones had
duplicated meanings and nobody knew which one to take.
2017-11-15 14:22:17 -05:00
Benjamin Otte
13ca03efb1 cellrendererpixbuf: Remove stock-detail property
GTK3 didn't use that property already...
2017-11-14 18:37:38 -05:00
Benjamin Otte
2d959553e9 image: Add the ability to set textures
This also adds it to all other places that use the same infrastructure:
GtkEntry and GtkCellRendererPixbuf
2017-11-05 00:07:17 +01:00
Alexander Larsson
96b04836d8 Drop all uses of GdkPixbufAnimation in the gtk APIs
These are basically animated gifs, and don't fit well in how
modern things animate.
2017-10-23 16:56:49 +02:00
Alexander Larsson
0089e4ad58 Drop pixbuf support in IconHelper and ImageDefinition
These are no longer used, instead we always covert to surface as
early as possible and drop the pixbuf.

This means we never store both the pixbuf and the surface at
for any longer time, which is wasteful. Also, its one step further
to drop GdkPixbufs from generic use in our APIs.
2017-10-23 15:28:33 +02:00
Alexander Larsson
e205ae9fc1 CellRendererPixbuf: Never store pixbufs
Rather than store the pixbufs as themselves we immediately convert
them to surfaces. In the uncommon case that a pixbuf is read back
from the renderer we generate a new one from the surface data.
2017-10-23 15:28:33 +02:00
Timm Bäder
a32725bc9a iconhelper: Don't inherit from GObject
It's not a GtkCssGadget anymore, it doesn't have any properties or
signals either and it's not public. Further, its lifetime is very clear
the way it's being used inside GTK+.
2017-10-01 09:19:09 +02:00
Benjamin Otte
87497ca2e1 snapshot: Rename gtk_snapshot_translate_2d()
It's now called gtk_snapshot_offset().
2017-01-13 14:37:48 +01:00
Benjamin Otte
513a8c46af cellrendererpixbuf: Implement snapshot() 2016-12-23 10:50:04 +01:00
Timm Bäder
a06d34aaff cellrendererpixbuf: Remove :follow-state 2016-10-22 19:32:25 +02:00
Timm Bäder
ed184b3935 Remove GtkIconFactory
Move the icon size lookup API into gtkicontheme.c
2016-10-16 18:17:21 +02:00
Timm Bäder
ad155fb26c Remove GtkStock API from GtkImage 2016-10-16 18:17:21 +02: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
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
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
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
Paolo Borelli
7281803169 cellrendererpixbuf: do not clear the icon helper twice
Do not call _gtk_icon_helper_clear explicitely when the properties
are set, since the corresponding _gtk_icon_helper_set_* method
already calls clear internally.
While at it rename the reset function to make it clear that it
is calling notify for the previous image type and avoid the
notification if the image type is not changing.
2015-08-12 21:40:04 +02: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
David King
a7638d5ecb docs: Add Since for GtkCellRendererPixbuf:surface 2015-01-09 14:51:21 +00:00
Matthias Clasen
f5d7e54d33 GtkCellRendererPixbuf: Set force_scale_pixbuf
The recent icon theme scaling changes make the code more
sensitive to mis-sized icons (e.g. application icons in
the app chooser). A single row whose size gets blown out
of proportion by a big icon is never wanted in a list.
We can avoid this situation by telling GtkIconHelper to
force-scale the pixbuf to the requested size.
2014-06-22 11:52:11 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
Benjamin Otte
fa3b803de9 cellrendererpixbuf: Don't eat states
Even when not following states, blacklist the states we don't follow
instead of whitelisting the ones we do. This way, we don't accidentally
eat new ones like the text direction flags.

Fixes a bug where text direction wasn't available when rendering stock
items.

https://bugzilla.gnome.org/show_bug.cgi?id=702423
2013-09-05 18:48:47 +02:00
Benjamin Otte
502d7644fe cellrendererpixbuf: Follow state even when insensitive 2013-09-05 18:48:47 +02:00
Benjamin Otte
c417bf6d73 cellrendererpixbuf: Always follow state
... not just in PRELIT | SELECTED.
2013-09-05 18:48:46 +02:00
Matthias Clasen
0aa57d26b5 Move wholly deprecated classes to gtk/deprecated/
We've recently a number of classes wholly. For these cases,
move the headers and sources to gtk/deprecated/ and adjust
Makefiles and includes accordingly.

Affected classes:
GtkAction
GtkActionGroup
GtkActivatable
GtkIconFactory
GtkImageMenuItem
GtkRadioAction
GtkRecentAction
GtkStock
GtkToggleAction
GtkUIManager
2013-07-19 21:39:47 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
William Jon McCann
72c3879893 Add missing G_PARAM_DEPRECATED to stock deprecations 2013-07-08 15:39:55 -04:00
Alexander Larsson
b6b24148fb GtkCellRendererPixbuf: Add surface property 2013-07-03 14:39:26 +02:00
Alexander Larsson
07519abcde CellRendererPixbuf: Set the window on the icon helper
This lets us get scaled icons if needed.
2013-07-03 14:39:26 +02:00
William Jon McCann
424e1d0059 Start deprecating some GtkStock API 2013-06-25 19:05:32 -04:00
Benjamin Otte
16e902d20a API: Export gtk_cell_renderer_class_set_accessible_type()
This function is necessary to implement cell renderer accessibility
support.
2013-02-25 21:42:31 +01:00
Cosimo Cecchi
23c5ebafce cellrendererpix: set the IMAGE style class when rendering an icon
This way, themes can change symbolic icon colors for views, by using a

.view.image {

}

CSS selector.

https://bugzilla.gnome.org/show_bug.cgi?id=680008
2012-07-16 09:35:07 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Benjamin Otte
c5433e852b gtk: Add accessible types for cell renderers 2011-12-16 04:53:16 +01:00
Cosimo Cecchi
798413151f cellrendererpix: save the icon size locally instead of in the helper
We need to save the icon size locally for GtkCellRendererPixbuf, since
its properties are set again every time it's drawn (resetting the icon
size on the helper by means of _gtk_icon_helper_clear() each time).
2011-12-15 19:59:24 +01:00
Cosimo Cecchi
126651f889 cellrendererpix: make sure to select the default helper as a fallback
If we don't have expander pixbufs, select the default helper to render
the icon, even if the cell is an expander. This mimics what the old code
did.
2011-11-30 16:39:59 -05:00
Cosimo Cecchi
0304cc04d3 cellrendererpix: port to GtkIconHelper 2011-11-30 16:39:59 -05:00
Cosimo Cecchi
35fdce68e1 cellrendererpix: make the icon render properly again
pix_rect was not initialized anymore, so the gdk_rectangle_intersect()
call would always fail.
2011-06-09 22:59:06 -04:00
Cosimo Cecchi
0198662d79 cellrendererpix: use gtk_render_icon() 2011-06-09 23:17:09 +02:00
Matthias Clasen
ea936d4237 GtkCellRendererPixbufPrivate: Improve struct packing 2011-04-12 12:30:36 -04:00
Javier Jardón
4a7400db99 Move documentation to inline comments: GtkCellRendererPixbuf 2011-04-11 23:07:41 +01:00
Carlos Garnacho
c59a05b0d4 Make GtkCellRendererPixbuf use GtkStyleContext 2011-01-27 20:57:13 +01:00
Carlos Garcia Campos
24e832187f GtkCellRendererPixbuf: Use gtk_widget_render_icon_pixbuf()
Instead of gtk_widget_render_icon() which is now deprecated.
2010-12-08 17:16:02 +01:00
Matthias Clasen
f0eed4a5b1 Use gtk_icon_info_load_symbolic_for_context
gtk_icon_info_load_symbolic_for_style is going to be deprecated.
2010-12-04 15:39:43 +01:00