Changeset 4305


Ignore:
Timestamp:
04/03/08 15:46:31 (5 years ago)
Author:
thomas
Message:

2008-04-03 Thomas Wood <thomas@…>

  • src/moko-draw.c:
  • data/gtk-2.0/gtkrc:
  • data/gtk-2.0/openmoko-dialer:

Completely redesign the visual style, with emphasis on simplicity and
speed.

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

Legend:

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

    r3612 r4305  
     12008-04-03  Thomas Wood  <thomas@openedhand.com> 
     2 
     3        * src/moko-draw.c: 
     4        * data/gtk-2.0/gtkrc: 
     5        * data/gtk-2.0/openmoko-dialer: 
     6 
     7        Completely redesign the visual style, with emphasis on simplicity and 
     8        speed. 
     9 
    1102007-12-07  Thomas Wood  <thomas@openedhand.com> 
    211 
  • trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtk-2.0/gtkrc

    r3611 r4305  
    22# 
    33# Copyright 2007 OpenedHand Ltd <info@openedhand.com> 
    4 # Based on OpenedHand's Sato GTK+ Theme 
     4# Originally based on OpenedHand's Sato GTK+ Theme 
    55# 
    66# This theme uses several style properties introduced in GTK+ 2.10 
     
    1515 
    1616# Set the default gtk-color-scheme property 
    17 gtk_color_scheme = "fg_color:#000;bg_color:#f4f0f4;base_color:#fff;text_color:#000;selected_bg_color:#ff7d00;selected_fg_color:#000" 
     17gtk_color_scheme = "fg_color:#fff;bg_color:#333;base_color:#fff;text_color:#000;selected_bg_color:#ff7d00;selected_fg_color:#000" 
    1818 
    1919style "default" 
     
    2525  GtkButton::default_border = {0, 0, 0, 0} 
    2626  GtkButton::focus-line-width = 0 
     27  GtkButton::inner_border = {10, 10, 10, 10} 
    2728  GtkCheckButton::indicator-size = 35 
    2829  GtkCheckButton::indicator-spacing = 5 
     
    7980 
    8081  engine "moko-engine" { 
    81     border = TRUE 
    8282  } 
    8383} 
    84  
    8584class "GtkWidget" style "default" 
    86  
    87 style "reversed" 
    88 { 
    89   bg[NORMAL] = @fg_color 
    90   fg[NORMAL] = @bg_color 
    91  
    92   bg[PRELIGHT] = @fg_color 
    93   fg[PRELIGHT] = @bg_color 
    94 } 
    95 widget_class "*GtkButton*" style "reversed" 
    9685 
    9786style "button" 
    9887{ 
    99   GtkButton::inner_border = {15, 15, 10, 10} 
    100   engine "moko-engine" { 
    101     border = TRUE 
    102     gradient = TRUE 
    103   } 
     88  bg[NORMAL] = lighter (@bg_color) 
     89  bg[PRELIGHT] = lighter (@bg_color) 
    10490} 
    10591class "GtkButton" style "button" 
    10692 
    107 style "button-colors" { 
    108   bg[NORMAL] = "#333" 
    109   fg[NORMAL] = "#fff" 
     93style "button-with-indicator" 
     94{ 
     95  bg[NORMAL] = @bg_color 
     96  fg[NORMAL] = @fg_color 
    11097 
    111   bg[PRELIGHT] = "#333" 
    112   fg[PRELIGHT] = "#fff" 
     98  bg[ACTIVE] = @bg_color 
     99  fg[ACTIVE] = @fg_color 
     100 
     101  bg[PRELIGHT] = @bg_color 
     102  fg[PRELIGHT] = @fg_color 
    113103} 
    114 widget_class "GtkButton*" style "button-colors" 
    115  
    116 style "treeview-header" { 
    117  
    118   # inner-border was added in GTK+ 2.10 
    119   GtkButton::inner_border = {0, 0, 0, 0} 
    120  
    121   bg[NORMAL] = "#eee" 
    122   fg[NORMAL] = "#000" 
    123  
    124   bg[PRELIGHT] = "#eee" 
    125   fg[PRELIGHT] = "#000" 
    126  
    127   engine "moko-engine" { 
    128     border = FALSE 
    129     gradient = TRUE 
    130   } 
    131 } 
    132 widget_class "*GtkTreeView.GtkButton*" style "treeview-header" 
     104widget_class "*.GtkCheckButton.*" style "button-with-indicator" 
     105widget_class "*.GtkRadioButton.*" style "button-with-indicator" 
    133106 
    134107style "combo" { 
    135108  bg[NORMAL] = @selected_bg_color 
     109  fg[NORMAL] = @selected_fg_color 
    136110  text[NORMAL] = @selected_fg_color 
    137111 
    138112  bg[PRELIGHT] = @selected_bg_color 
    139113  text[PRELIGHT] = @selected_fg_color 
    140  
    141   engine "moko-engine" { 
    142     gradient = TRUE 
    143   } 
    144114} 
    145115widget_class "*Combo*" style "combo" 
     
    150120  xthickness = 0 
    151121  ythickness = 0 
    152  
    153   engine "moko-engine" { 
    154     gradient = TRUE 
    155     border = FALSE 
    156   } 
    157122} 
    158123class "GtkToolbar" style "toolbar" 
    159 class "GtkToolbar" style "reversed" 
    160  
    161 style "toolitem" 
    162 { 
    163   xthickness = 12 
    164   ythickness = 12 
    165  
    166   bg[NORMAL] = @selected_bg_color 
    167   fg[NORMAL] = @selected_fg_color 
    168  
    169   # toolbar colours are reversed 
    170   bg[PRELIGHT] = @fg_color 
    171   fg[PRELIGHT] = @bg_color 
    172  
    173   engine "moko-engine" { 
    174     gradient = TRUE 
    175     border = FALSE 
    176   } 
    177 } 
    178 widget_class "*Tool*GtkToggleButton" style "toolitem" 
    179 widget_class "*Tool*GtkButton" style "toolitem" 
    180  
    181124style "notebook" 
    182125{ 
     
    186129  # For notebookes, NORMAL is used for the active tab and ACTIVE is used for 
    187130  # ther other tabs 
    188   bg[NORMAL] = @selected_bg_color 
    189   fg[NORMAL] = @selected_fg_color 
    190  
    191   # inactive tabs are in "reversed" colours 
    192   fg[ACTIVE] = @bg_color 
    193   bg[ACTIVE] = @fg_color 
     131  fg[ACTIVE] = @fg_color 
     132  bg[ACTIVE] = shade (0.3, @bg_color) 
    194133} 
    195 class "GtkNotebook" style "notebook" 
    196  
    197 style "menu" 
    198 { 
    199   engine "moko-engine" { 
    200     gradient = FALSE 
    201     border = TRUE 
    202   } 
    203 } 
    204 class "GtkMenu" style "menu" 
    205  
    206 style "menubar" 
    207 { 
    208   engine "moko-engine" { 
    209     gradient = TRUE 
    210   } 
    211 } 
    212 class "GtkMenuBar" style "menubar" 
    213 widget_class "*GtkMenuBar*" style "reversed" 
     134widget_class "*GtkNotebook" style "notebook" 
    214135 
    215136style "menuitem" 
     
    218139  ythickness = 8 
    219140 
     141  text[NORMAL] = @fg_color 
     142  text[PRELIGHT] = @selected_fg_color 
     143 
    220144  bg[PRELIGHT] = @selected_bg_color 
    221145  fg[PRELIGHT] = @selected_fg_color 
    222  
    223   engine "moko-engine" { 
    224     gradient = TRUE 
    225     border = FALSE 
    226   } 
    227146} 
    228147widget_class "*MenuItem*" style "menuitem" 
     148widget "GtkWindow.gtk-combobox-popup-menu" style "menuitem" 
    229149 
    230150style "scrollbar" 
     
    232152  bg[NORMAL] = @selected_bg_color 
    233153  bg[PRELIGHT] = @selected_bg_color 
    234  
    235   engine "moko-engine" { 
    236     border = TRUE 
    237   } 
    238154} 
    239155class "GtkScrollbar" style "scrollbar" 
     156 
     157style "mokosearchbutton" 
     158{ 
     159  bg[NORMAL] = "#C0C0C0" 
     160} 
     161widget "*.mokosearchbutton" style "mokosearchbutton" 
    240162 
    241163include "matchboxpanel" 
  • trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/data/gtk-2.0/openmoko-dialer

    r3399 r4305  
    1313widget "*.MokoTips*" style "mokodialertextview" 
    1414 
    15 widget_class "*MokoDigitButton*" style "reversed" # defined in the main gtkrc 
    16  
  • trunk/src/target/OM-2007.2/libraries/moko-gtk-engine/src/moko-draw.c

    r3612 r4305  
    3535 
    3636GtkStyleClass *parent_style_class; 
    37  
    38 /** 
    39  * Prepare a new GC with the additional Moko style values 
    40  */ 
    41 static GdkGC* 
    42 moko_gc_new (GdkGC* old_gc, GdkDrawable *d) 
    43 { 
    44   GdkGC *new_gc; 
    45   new_gc = gdk_gc_new (d); 
    46   gdk_gc_copy (new_gc, old_gc); 
    47   gdk_gc_set_line_attributes (new_gc, 2, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER); 
    48   return new_gc; 
    49 } 
    50  
    51 /* 
    52  * moko_dither16: 
    53  * @dither: An 18x1, 1-bit pixmap 
    54  * @gc: The gc that needs to be dithered 
    55  * @gcd: A gc for @dither 
    56  * @c1: The intended colour 
    57  * @i: Any random number 
    58  * 
    59  * Calculates and sets the dither colour and pattern for a 16-bit drawable, 
    60  * given a 32-bit colour. 
    61  */ 
    62 static void 
    63 moko_dither16 (GdkPixmap *dither, GdkGC *gc, GdkGC *gcd, GdkColor *c1, gint i) 
    64 { 
    65   gint sum, x; 
    66   GdkColor c1d; 
    67   /* Assuming 565, so see how much of the colour is ignored and use that 
    68   * to decide on the dithering colour/pattern. 
    69   */ 
    70   c1d.red = c1->red & 0x700; 
    71   c1d.green = c1->green & 0x300; 
    72   c1d.blue = c1->blue & 0x700; 
    73  
    74   sum = (c1d.red + c1d.green + c1d.blue) >> 8; 
    75   gdk_gc_set_function (gcd, GDK_SET); 
    76   gdk_draw_line (dither, gcd, 0, 0, 17, 0); 
    77   gdk_gc_set_function (gcd, GDK_CLEAR); 
    78   for (x = 0; x < sum; x ++) { 
    79     gdk_draw_point (dither, gcd, ((x+(i<<3)) * 11) % 18, 0); 
    80   } 
    81  
    82   c1d.red = c1->red + 0x800; 
    83   c1d.green = c1->green + 0x400; 
    84   c1d.blue = c1->blue + 0x800; 
    85   if (c1d.red < c1->red) c1d.red = 0xFF00; 
    86   if (c1d.green < c1->green) c1d.green = 0xFF00; 
    87   if (c1d.blue < c1->blue) c1d.blue = 0xFF00; 
    88   gdk_gc_set_rgb_bg_color (gc, &c1d); 
    89  
    90   gdk_gc_set_fill (gc, GDK_OPAQUE_STIPPLED); 
    91   gdk_gc_set_stipple (gc, dither); 
    92 } 
    93  
    94 static void 
    95 moko_gradient (GtkStyle * style, GdkWindow * window, GtkStateType state_type, 
    96                gint x, gint y, gint width, gint height) 
    97 { 
    98   gint i, rd, gd, bd, depth;            /* rd, gd, bd - change in r g and b for gradient */ 
    99   GdkColor c1, c2, c3, c4, c1d, c3d; 
    100   GdkPixmap *dither; 
    101   GdkGC *gc, *gcd; 
    102   gc = gdk_gc_new (window); 
    103  
    104   /* get the start and end colours */ 
    105   moko_shade_colour (&style->bg[state_type], &c1, 0.8); 
    106   moko_shade_colour (&style->bg[state_type], &c2, 0.4); 
    107   moko_shade_colour (&style->bg[state_type], &c3, 0.3); 
    108   moko_shade_colour (&style->bg[state_type], &c4, 0.0); 
    109  
    110   /* set line for 1px */ 
    111   gdk_gc_set_line_attributes (gc, 1, GDK_LINE_SOLID, GDK_CAP_BUTT, 
    112                               GDK_JOIN_MITER); 
    113  
    114   /* Get the drawable pixel depth, for dithering */ 
    115   depth = gdk_drawable_get_depth (window); 
    116   if (depth == 16) { 
    117           dither = gdk_pixmap_new (NULL, 18, 1, 1); 
    118           gcd = gdk_gc_new (dither); 
    119   } 
    120  
    121   /*** First Gradient ***/ 
    122   /* calculate the delta values */ 
    123  
    124   rd = (c1.red - c2.red) / MAX (height / 2, 1); 
    125   gd = (c1.green - c2.green) / MAX (height / 2, 1); 
    126   bd = (c1.blue - c2.blue) / MAX (height / 2, 1); 
    127  
    128   i = 0; 
    129   while (i < height / 2) 
    130   { 
    131     gdk_gc_set_rgb_fg_color (gc, &c1); 
    132     /* TODO: Handle 15-bit colour */ 
    133     if (depth == 16) { 
    134       moko_dither16 (dither, gc, gcd, &c1, i); 
    135     } 
    136     gdk_draw_line (window, gc, x, y + i, x + width, y + i); 
    137     c1.red -= rd; 
    138     c1.blue -= bd; 
    139     c1.green -= gd; 
    140     i++; 
    141   } 
    142  
    143   /*** Second Gradient ***/ 
    144  
    145   rd = (c3.red - c4.red) / MAX (height / 2, 1); 
    146   gd = (c3.green - c4.green) / MAX (height / 2, 1); 
    147   bd = (c3.blue - c4.blue) / MAX (height / 2, 1); 
    148  
    149   i = height / 2; 
    150   while (i < height) 
    151   { 
    152     if (depth == 16) { 
    153       moko_dither16 (dither, gc, gcd, &c3, i); 
    154     } 
    155     gdk_gc_set_rgb_fg_color (gc, &c3); 
    156     gdk_draw_line (window, gc, x, y + i, x + width, y + i); 
    157     c3.red -= rd; 
    158     c3.blue -= bd; 
    159     c3.green -= gd; 
    160     i++; 
    161   } 
    162  
    163   g_object_unref (gc); 
    164  
    165   if (depth == 16) { 
    166     g_object_unref (gcd); 
    167     g_object_unref (dither); 
    168   } 
    169  
    170 } 
    17137 
    17238static void 
     
    18955  } 
    19056 
    191   /*** combo boxes ***/ 
    192   if (DETAIL ("button") && widget && GTK_IS_COMBO_BOX_ENTRY (widget->parent)) 
    193   { 
    194     GtkWidget *entry; 
    195  
    196     entry = g_object_get_data (G_OBJECT (widget->parent), "moko-combo-entry"); 
    197     if (GTK_IS_ENTRY (entry)) 
    198     { 
    199       gtk_widget_queue_draw_area (entry, entry->allocation.x, entry->allocation.y, entry->allocation.width,entry->allocation.height); 
    200  
    201     } 
    202  
    203     g_object_set_data (G_OBJECT (widget->parent), "moko-combo-button", widget); 
    204  
    205     /* FIXME: RTL */ 
    206     width += 10; 
    207     x -= 10; 
    208   } 
    209  
    210   gc = moko_gc_new (style->text_gc[state_type], window); 
    211  
    212  
    21357  /* "fix" for prelight active toggle buttons */ 
    21458  if (DETAIL ("button") && state_type == GTK_STATE_PRELIGHT && shadow_type == GTK_SHADOW_IN) 
     
    21761  } 
    21862 
    219   /*** draw the gradient ***/ 
    220   if (MOKO_RC_STYLE (style->rc_style)->has_gradient) 
    221   { 
    222     moko_gradient (style, window, state_type, x, y, width, height); 
    223   } 
    224   else 
    225   { 
    226     gtk_paint_flat_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); 
    227   } 
    22863 
    22964  if (DETAIL ("trough")) 
    230   { 
    231     if (widget && GTK_IS_HSCALE (widget)) 
    232     { 
    233       gdk_draw_line (window, gc, x, y + height / 2, x + width, y + height / 2); 
    234       goto exit; 
    235     } 
    236     else if (widget && GTK_IS_VSCALE (widget)) 
    237     { 
    238       gdk_draw_line (window, gc, x + width / 2, y, x + width / 2, y + height); 
    239       goto exit; 
    240     } 
    241     else 
    242       gdk_draw_rectangle (window, style->base_gc[state_type], TRUE, x, y, width, height); 
    243  
    244   } 
    245  
    246   /*** draw the border ***/ 
    247   if (MOKO_RC_STYLE (style->rc_style)->has_border) 
    248   { 
    249     gdk_draw_rectangle (window, gc, FALSE, x + 1, y + 1, width - 2, height - 2); 
    250   } 
    251  
    252 exit: 
    253   g_object_unref (gc); 
     65    gc = style->base_gc[state_type]; 
     66  else if (DETAIL ("bar")) 
     67    gc = style->base_gc[GTK_STATE_SELECTED]; 
     68  else 
     69    gc = style->bg_gc[state_type]; 
     70 
     71  gdk_draw_rectangle (window, gc, TRUE, x, y, width, height); 
    25472 
    25573} 
     
    25876moko_draw_shadow (DRAW_ARGS) 
    25977{ 
    260  GdkGC *gc; 
    261  
     78  GdkGC* gc; 
    26279  DEBUG ("draw_shadow"); 
    26380 
     
    26784  SANITIZE_SIZE; 
    26885 
    269   /* FIXME: for RTL */ 
    270   if (widget && (GTK_IS_SPIN_BUTTON (widget) || GTK_IS_COMBO_BOX_ENTRY (widget->parent))) 
    271       width += 10; 
    272  
    273   if (widget && GTK_IS_COMBO_BOX_ENTRY (widget->parent)) 
    274   { 
    275     GtkWidget *button; 
    276     g_object_set_data (G_OBJECT (widget->parent), "moko-combo-entry", widget); 
    277  
    278     button = g_object_get_data (G_OBJECT (widget->parent), "moko-combo-button"); 
    279     if (GTK_IS_BUTTON (button)) 
    280       gtk_widget_queue_draw_area (button, button->allocation.x, button->allocation.y, button->allocation.width,button->allocation.height); 
    281   } 
     86  gc = gdk_gc_new (window); 
    28287 
    28388  /* draw a hilight shadow on focused widgets (i.e. entry widgets) */ 
    28489  if (widget && GTK_WIDGET_HAS_FOCUS (widget)) 
    285     gc = moko_gc_new (style->base_gc[GTK_STATE_SELECTED], window); 
    286   else 
    287     gc = moko_gc_new (style->text_gc[state_type], window); 
     90    gdk_gc_copy (gc, style->base_gc[GTK_STATE_SELECTED]); 
     91  else 
     92    gdk_gc_copy (gc, style->base_gc[state_type]); 
     93 
     94  gdk_gc_set_line_attributes (gc, 2, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER); 
    28895 
    28996  gdk_draw_rectangle (window, gc, FALSE, x + 1, y + 1, width - 2, height - 2); 
     
    297104                 gint x, gint y, gint width, gint height) 
    298105{ 
    299   GdkGC *gc; 
    300106  DEBUG ("draw_focus"); 
    301107 
    302108  /* no focus indicator for the moment ... */ 
    303   return; 
    304 /* 
    305   gc = moko_gc_new (style->fg_gc[GTK_STATE_SELECTED], window); 
    306   gdk_draw_rectangle (window, gc, FALSE, x, y, width, height); 
    307   g_object_unref (gc); 
    308 */ 
    309109} 
    310110 
     
    316116                 gint height) 
    317117{ 
    318   GdkGC *gc; 
    319  
    320   DEBUG ("draw_check"); 
    321   gc = moko_gc_new (style->text_gc[state_type], window); 
    322  
    323   /* clear the background */ 
    324   gdk_draw_rectangle (window, style->base_gc[GTK_STATE_NORMAL], TRUE, x+1, y+1, width-2, height-2); 
     118  GdkGC *gc, *border; 
     119 
     120  if (state_type == GTK_STATE_PRELIGHT) 
     121    state_type = GTK_STATE_NORMAL; 
    325122 
    326123  if (shadow_type == GTK_SHADOW_IN) 
    327   { 
    328     GdkGC *mark_gc; 
    329     mark_gc = moko_gc_new (style->base_gc[GTK_STATE_SELECTED], window); 
    330     gdk_draw_rectangle (window, mark_gc, TRUE, x + 3, y + 3, width - 6, height - 6); 
    331     g_object_unref (mark_gc); 
    332   } 
    333  
    334   gdk_draw_rectangle (window, gc, FALSE, x, y, width, height); 
    335  
    336   g_object_unref (gc); 
     124    gc = style->base_gc[GTK_STATE_SELECTED]; 
     125  else 
     126    gc = style->base_gc[state_type]; 
     127 
     128  gdk_draw_rectangle (window, style->black_gc, TRUE, 
     129                      x, y, width, height); 
     130 
     131  gdk_draw_rectangle (window, gc, TRUE, 
     132                      x + 2, y + 2, width - 4, height - 4); 
     133 
    337134} 
    338135 
     
    344141                  gint height) 
    345142{ 
     143  DEBUG ("draw_option"); 
     144 
    346145  GdkGC *gc; 
    347  
    348   DEBUG ("draw_option"); 
    349  
    350   gc = moko_gc_new (style->text_gc[state_type], window); 
    351  
    352  
    353   /* clear the background */ 
    354   gdk_draw_arc (window, style->base_gc[GTK_STATE_NORMAL], TRUE, x+1, y+1, width-2, height-2, 0, 360 * 64); 
    355  
     146  if (state_type == GTK_STATE_PRELIGHT) 
     147    state_type = GTK_STATE_NORMAL; 
    356148  if (shadow_type == GTK_SHADOW_IN) 
    357   { 
    358     GdkGC *mark_gc; 
    359     mark_gc = moko_gc_new (style->base_gc[GTK_STATE_SELECTED], window); 
    360     gdk_draw_arc (window, mark_gc, TRUE, x + 3, y + 3, width - 6, height - 6, 0, 360 * 64); 
    361     g_object_unref (mark_gc); 
    362   } 
    363   gdk_draw_arc (window, gc, FALSE, x, y, width, height, 0, 360 * 64); 
    364  
    365   g_object_unref (gc); 
     149    gc = style->base_gc[GTK_STATE_SELECTED]; 
     150  else 
     151    gc = style->base_gc[state_type]; 
     152 
     153 
     154  gdk_draw_arc (window, style->black_gc, TRUE, 
     155   x, y, width, height, 0, 360 * 64); 
     156 
     157  gdk_draw_arc (window, gc, TRUE, 
     158   x + 2, y + 2, width - 4, height - 4, 0, 360 * 64); 
     159 
    366160} 
    367161 
     
    373167                   GtkPositionType gap_side, gint gap_x, gint gap_width) 
    374168{ 
    375   GdkGC *gc; 
    376   GdkRectangle rect; 
    377  
    378   /* lets try without a border */ 
    379   return; 
    380  
    381   if (shadow_type == GTK_SHADOW_NONE) 
    382     return; 
    383  
    384   gc = moko_gc_new (style->fg_gc [state_type], window); 
    385  
    386   /* start off with a rectangle... */ 
    387   gdk_draw_rectangle (window, gc, FALSE, x, y, width, height); 
    388  
    389  
    390   switch (gap_side) 
    391   { 
    392     case GTK_POS_TOP: 
    393  
    394       rect.x = x + gap_x; 
    395       rect.y = y; 
    396       rect.width = gap_width; 
    397       rect.height = 2; 
    398       break; 
    399     case GTK_POS_BOTTOM: 
    400       rect.x = x + gap_x; 
    401       rect.y = y + height - 1; 
    402       rect.width = gap_width; 
    403       rect.height = 2; 
    404       break; 
    405     case GTK_POS_LEFT: 
    406       rect.x = x; 
    407       rect.y = y + gap_x; 
    408       rect.width = 2; 
    409       rect.height = gap_width; 
    410       break; 
    411     case GTK_POS_RIGHT: 
    412       rect.x = x + width - 2; 
    413       rect.y = y + gap_x; 
    414       rect.width = 2; 
    415       rect.height = gap_width; 
    416       break; 
    417   } 
    418  
    419   /* and finally blank out the gap */ 
    420   gtk_style_apply_default_background (style, window, TRUE, state_type, area, 
    421                                       rect.x, rect.y, rect.width, 
    422                                       rect.height); 
    423  
    424  
    425   g_object_unref (gc); 
     169  gdk_draw_rectangle (window, style->bg_gc[state_type], TRUE, x, y, width, height); 
    426170} 
    427171 
     
    434178                     GtkPositionType gap_side) 
    435179{ 
    436  
    437   GdkGC *gc; 
    438   gc = moko_gc_new (style->bg_gc[state_type], window); 
    439  
    440   /* NORMAL is used for "active" tabs */ 
    441   if (state_type == GTK_STATE_NORMAL) 
    442     moko_gradient (style, window, state_type, x, y, width, height); 
    443   else 
    444     gdk_draw_rectangle (window, gc, TRUE, x, y, width, height); 
    445  
    446  
    447   g_object_unref (gc); 
    448  
     180  gdk_draw_rectangle (window, style->bg_gc[state_type], TRUE, x, y, width, height); 
    449181} 
    450182 
Note: See TracChangeset for help on using the changeset viewer.