Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gtk
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1,147
Issues
1,147
List
Boards
Labels
Milestones
Merge Requests
97
Merge Requests
97
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
gtk
Commits
c57fdf4c
Commit
c57fdf4c
authored
Nov 13, 2010
by
Carlos Garnacho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GtkStyleContext: Resolve symbolic colors for widget style properties.
parent
d865cf4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
4 deletions
+39
-4
gtk/gtkstylecontext.c
gtk/gtkstylecontext.c
+39
-4
No files found.
gtk/gtkstylecontext.c
View file @
c57fdf4c
...
...
@@ -2018,13 +2018,48 @@ _gtk_style_context_peek_style_property (GtkStyleContext *context,
{
for
(
list
=
priv
->
providers_last
;
list
;
list
=
list
->
prev
)
{
GtkStyleProviderData
*
data
;
GtkStyleProviderData
*
provider_
data
;
data
=
list
->
data
;
provider_
data
=
list
->
data
;
if
(
gtk_style_provider_get_style_property
(
data
->
provider
,
priv
->
widget_path
,
if
(
gtk_style_provider_get_style_property
(
provider_
data
->
provider
,
priv
->
widget_path
,
pspec
->
name
,
&
pcache
->
value
))
return
&
pcache
->
value
;
{
/* Resolve symbolic colors to GdkColor/GdkRGBA */
if
(
G_VALUE_TYPE
(
&
pcache
->
value
)
==
GTK_TYPE_SYMBOLIC_COLOR
)
{
GtkSymbolicColor
*
color
;
GdkRGBA
rgba
;
color
=
g_value_get_boxed
(
&
pcache
->
value
);
if
(
gtk_symbolic_color_resolve
(
color
,
data
->
store
,
&
rgba
))
{
g_value_unset
(
&
pcache
->
value
);
if
(
G_PARAM_SPEC_VALUE_TYPE
(
pspec
)
==
GDK_TYPE_RGBA
)
{
g_value_init
(
&
pcache
->
value
,
GDK_TYPE_RGBA
);
g_value_set_boxed
(
&
pcache
->
value
,
&
rgba
);
}
else
{
GdkColor
rgb
;
rgb
.
red
=
rgba
.
red
*
65535
.
+
0
.
5
;
rgb
.
green
=
rgba
.
green
*
65535
.
+
0
.
5
;
rgb
.
blue
=
rgba
.
blue
*
65535
.
+
0
.
5
;
g_value_init
(
&
pcache
->
value
,
GDK_TYPE_COLOR
);
g_value_set_boxed
(
&
pcache
->
value
,
&
rgb
);
}
}
else
g_param_value_set_default
(
pspec
,
&
pcache
->
value
);
}
return
&
pcache
->
value
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment