< prev index next >
src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c
Print this page
rev 16201 : 8170525: Fix minor issues in AWT/ECC/PKCS11 coding
Reviewed-by: vinnie, clanger, prr, ssadetsky
*** 2012,2024 ****
/*************************************************/
static guint8 recode_color(gdouble channel)
{
guint16 result = (guint16)(channel * 65535);
! if (result < 0) {
! result = 0;
! } else if (result > 65535) {
result = 65535;
}
return (guint8)( result >> 8);
}
--- 2012,2022 ----
/*************************************************/
static guint8 recode_color(gdouble channel)
{
guint16 result = (guint16)(channel * 65535);
! if (result > 65535) {
result = 65535;
}
return (guint8)( result >> 8);
}
*** 2216,2225 ****
--- 2214,2224 ----
}
static GdkRGBA gtk3_get_color_for_flags(GtkStyleContext* context,
GtkStateFlags flags, ColorType color_type) {
GdkRGBA c, color;
+ color.alpha = 1;
switch (color_type)
{
case FOREGROUND:
case TEXT_FOREGROUND:
*** 2264,2274 ****
static gint gtk3_get_color_for_state(JNIEnv *env, WidgetType widget_type,
GtkStateType state_type, ColorType color_type)
{
gint result = 0;
- GdkRGBA color;
GtkStateFlags flags = gtk3_get_state_flags(state_type);
init_containers();
--- 2263,2272 ----
*** 2283,2293 ****
|| widget_type == RADIO_BUTTON_MENU_ITEM) {
flags &= GTK_STATE_FLAG_NORMAL | GTK_STATE_FLAG_SELECTED
| GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_FOCUSED;
}
! color = gtk3_get_color_for_flags(context, flags, color_type);
if (recode_color(color.alpha) == 0) {
color = gtk3_get_color_for_flags(
fp_gtk_widget_get_style_context(gtk3_get_widget(INTERNAL_FRAME)),
0, BACKGROUND);
--- 2281,2291 ----
|| widget_type == RADIO_BUTTON_MENU_ITEM) {
flags &= GTK_STATE_FLAG_NORMAL | GTK_STATE_FLAG_SELECTED
| GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_FOCUSED;
}
! GdkRGBA color = gtk3_get_color_for_flags(context, flags, color_type);
if (recode_color(color.alpha) == 0) {
color = gtk3_get_color_for_flags(
fp_gtk_widget_get_style_context(gtk3_get_widget(INTERNAL_FRAME)),
0, BACKGROUND);
< prev index next >