Changeset 3027


Ignore:
Timestamp:
09/21/07 16:26:35 (6 years ago)
Author:
thomas
Message:
  • src/moko-style.c: (moko_rc_style_merge), (moko_rc_style_parse):
  • src/moko-style.h:

Use bit flag to indicate which engine options have been set (fixes any
options not set in the first matched style)

Location:
trunk/src/target/OM-2007.2/libraries/moko-gtk-engine
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/ChangeLog

    r3022 r3027  
     12007-09-21  Thomas Wood  <thomas@openedhand.com> 
     2 
     3        * src/moko-style.c: (moko_rc_style_merge), (moko_rc_style_parse): 
     4        * src/moko-style.h: 
     5 
     6        Use bit flag to indicate which engine options have been set (fixes any 
     7        options not set in the first matched style) 
     8 
    192007-09-21  Thomas Wood  <thomas@openedhand.com> 
    210 
  • trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.c

    r3021 r3027  
    108108  if (MOKO_IS_RC_STYLE (src)) 
    109109  { 
     110    guint flags; 
    110111    MokoRcStyle *src_data = MOKO_RC_STYLE (src); 
    111112    MokoRcStyle *dest_data = MOKO_RC_STYLE (dest); 
    112113 
    113     dest_data->has_border = src_data->has_border; 
    114     dest_data->has_gradient = src_data->has_gradient; 
     114    flags = (~dest_data->flags) & src_data->flags; 
     115 
     116    if (flags & BORDER_SET) 
     117      dest_data->has_border = src_data->has_border; 
     118 
     119    if (flags & GRADIENT_SET) 
     120      dest_data->has_gradient = src_data->has_gradient; 
     121 
     122    dest_data->flags = dest_data->flags | src_data->flags; 
    115123  } 
    116124 
     
    183191          break; 
    184192        theme_data->has_border = i; 
     193        theme_data->flags = theme_data->flags | BORDER_SET; 
    185194        break; 
    186195      case TOKEN_HAS_GRADIENT: 
     
    189198          break; 
    190199        theme_data->has_gradient = i; 
     200        theme_data->flags = theme_data->flags | GRADIENT_SET; 
    191201        break; 
    192202 
  • trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-style.h

    r3021 r3027  
    7676typedef struct _MokoRcStyleClass MokoRcStyleClass; 
    7777 
     78/* which properties have been set? */ 
     79enum { 
     80  BORDER_SET = 1, 
     81  GRADIENT_SET = 2 
     82}; 
     83 
    7884struct _MokoRcStyle 
    7985{ 
    8086  GtkRcStyle parent_instance; 
    8187 
     88  guint flags; 
    8289  gboolean has_border; 
    8390  gboolean has_gradient; 
Note: See TracChangeset for help on using the changeset viewer.