Commit Graph

36 Commits

Author SHA1 Message Date
Matthias Clasen
624ec0fb7d Add a style class for context menus
Attached widgets inherit from the style of the widget they are
attached to. This can sometimes have unintended consequences,
like a context menu in the main view of gedit inheriting the font
that is configured for documents, or the context menu of the preview
in the font chooser coming up with humongous font size.

To fix this problem, we introduce a context menu style class
and use it for all menus that are used like that. The theme
can then set a font for this style class.

https://bugzilla.gnome.org/show_bug.cgi?id=697127
2013-08-18 13:46:48 -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
Matthias Clasen
98801b07b4 GtkColorChooser: Fix selection of colors
Prevent the new window dragging code from interfering with
selection of colors on button release, by handling button
presses we care about instead of letting them bubble up to
the window.
Partial fix for
https://bugzilla.gnome.org/show_bug.cgi?id=695493
2013-03-20 22:21:16 -04:00
Jasper St. Pierre
367364a8e1 Fix deprecations for GtkIconInfo 2013-02-15 19:48:56 -05:00
Alexander Larsson
3d4cd4db3e Add gtk_widget_(un)register_window
This replaces the previously hardcoded calls to gdk_window_set_user_data,
and also lets us track which windows are a part of a widget. Old code
should continue working as is, but new features that require the
windows may not work perfectly.

We need this for the transparent widget support to work, as we need
to specially mark the windows of child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2013-02-07 11:11:37 +01:00
Matthias Clasen
38963870eb Rename gtkcolorswatchaccessible.h
Call it gtkcolorswatchaccessibleprivate.h. This matches what we're
doing for non-public widget headers in gtk/.
2012-12-27 12:11:12 -05:00
Cosimo Cecchi
214809ece2 colorswatch: don't use the clip box directly
We can render our checkboard pattern on the padding box instead. This is
in preparation for GtkThemingBackground supporting multiple layers.
2012-05-15 13:24:40 -04:00
Matthias Clasen
912ad3b698 Break out press-and-hold code as its own object
https://bugzilla.gnome.org/show_bug.cgi?id=671057
2012-03-04 00:29:04 -05:00
Matthias Clasen
b43d00fa2a colorswatch: Support touch events
Support long press for customizing, and short press for
selecting/activating. This is simpler than the generic
press-and-hold support in the multitouch branch; we don't
display any feedback, and the timeout is currently hardcoded
to 1 second.
2012-03-03 01:48:55 -05:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Cosimo Cecchi
03fdaca187 color-swatch: set/unset prelight state flag on enter/leave events
Allows themes to set a different style on prelight.
2012-02-21 18:17:26 +01:00
Cosimo Cecchi
9160a68c7f color-swatch: make this a no-window widget
Instead of having an input/output GdkWindow, make the widget no-window,
and use a separate input-only window for events, and paint on the parent
window directly.
2012-02-20 13:49:04 +01:00
Cosimo Cecchi
8dd4a0adf1 color-swatch: don't render our active badge if background-image is set
If the color active swatch has been set a background image from the
theme, use it as an asset, and do not draw our custom thing.
2012-02-18 09:55:45 +01:00
Cosimo Cecchi
dcec8dfdde color-swatch: render a background if the swatch doesn't have a color
We still want to call into the background rendering code, to draw the
default background.
2012-02-18 09:55:45 +01:00
Cosimo Cecchi
8e85702dca color-swatch: derive directly from GtkWidget
Instead of GtkDrawingArea, since that calls in realize
gtk_style_context_set_background(). We don't want that to happen, given
that we do all the painting ourselves in _draw().
2012-02-18 09:55:45 +01:00
Cosimo Cecchi
5f0c4fc20f color-swatch: add a "selectable" property to GtkColorSwatch
We don't want e.g. the swatch in GtkColorEditor to get the select badge
when it's clicked, so make this a property (on by default).
2012-02-17 17:03:15 +01:00
Matthias Clasen
e1a625aa78 GtkColorSwatch: Add accessible actions 2012-02-14 21:16:52 -05:00
Cosimo Cecchi
19da38b811 colorchooser: factor out a private method to get the checkboard pattern
And use it in the color widgets.
2012-02-14 16:37:04 -05:00
Cosimo Cecchi
51c6e8329d color-swatch: cleanup unused property enum value 2012-02-14 16:37:01 -05:00
Matthias Clasen
92618eb8e2 GtkColorSwatch: Use widget state instead of a custom 'selected' 2012-02-14 16:37:00 -05:00
Matthias Clasen
40974b1463 GtkColorSwatch: Drop an unnecessary field 2012-02-14 16:37:00 -05:00
Matthias Clasen
3a7ed2e7bd Remove unused variables 2012-02-14 16:36:59 -05:00
Matthias Clasen
bad24bc119 Consistently private headers
Add a 'private' suffix to all newly introduced private
headers.
2012-02-14 16:36:58 -05:00
Cosimo Cecchi
bcc4186388 color-swatch: remove gtk_color_swatch_set_corner_radii()
It's unused now.
2012-02-14 16:36:58 -05:00
Cosimo Cecchi
a9c2a586b1 color-swatch: don't hardcode list-add-symbolic as swatch icon
We have that as a property, we should use it.
2012-02-14 16:36:57 -05:00
Cosimo Cecchi
83de34882b color-swatch: allow styling the "active badge"
Instead of calling gtk_render_check() there, just render a symbolic
icon, falling back to a built-in one if the icon is not available.
Also, add a style class for the active badge on the swatch:
"color-active-badge".
2012-02-14 16:36:57 -05:00
Cosimo Cecchi
1ccedc5fa4 color-swatch: use GtkThemingBackground to draw the background
This allows e.g. for the corner radii to be styled directly from the
theme.
2012-02-14 16:36:57 -05:00
Cosimo Cecchi
33e54e45be color-swatch: add a color-light/color-dark style class for intensity
Themes might want to set different colors on the badge if the displayed
color is light or dark. Use a style class for this when we set a color
on the swatch.
2012-02-14 16:36:57 -05:00
Matthias Clasen
d7cff0797e Misc cleanups 2012-02-14 16:36:56 -05:00
Matthias Clasen
c5cfb6e02b Rework the API a bit
Rename get/set_color to get/set_rgba and show_alpha to use_alpha,
to match existing GtkColorButton API and let GtkColorButton implement
GtkColorChooser.
2012-02-14 16:36:55 -05:00
Matthias Clasen
e56adaebea Only activate on double-click 2012-02-14 16:36:53 -05:00
Matthias Clasen
8178578359 Make alpha optional 2012-02-14 16:36:51 -05:00
Matthias Clasen
8d1565df94 Show alpha in the palette as well 2012-02-14 16:36:51 -05:00
Matthias Clasen
9161119329 No popup menu on the button 2012-02-14 16:36:50 -05:00
Matthias Clasen
021f5e0365 Initial work on a color editor
This replaces GtkHSV with a compound widget featuring
a hue slider and an sv-plane, amongst others.
2012-02-14 16:36:49 -05:00
Matthias Clasen
3b6e316e74 Initial cut at implementing a new color chooser
This is a partial implementation of
https://live.gnome.org/GnomeOS/Design/Whiteboards/ColorSelection
The new color editor has not been implemented yet.
2012-02-14 16:36:49 -05:00