]> Pileus Git - ~andy/gtk/commitdiff
Re-sync with gtk-wimp Ditto
authorDom Lachowicz <cinamod@hotmail.com>
Sun, 29 Jan 2006 03:28:25 +0000 (03:28 +0000)
committerDom Lachowicz <doml@src.gnome.org>
Sun, 29 Jan 2006 03:28:25 +0000 (03:28 +0000)
2006-01-28  Dom Lachowicz <cinamod@hotmail.com>

* modules/engines/ms-windows/msw-style.c: Re-sync with gtk-wimp
* modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Ditto

ChangeLog
ChangeLog.pre-2-10
modules/engines/ms-windows/Theme/gtk-2.0/gtkrc
modules/engines/ms-windows/msw_style.c

index d0b21d746f60847f8fd3b194ddaac467f14faa0c..1df480d9c7e173597913dd9c17901fa25c33d885 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-01-28  Dom Lachowicz <cinamod@hotmail.com>
+
+       * modules/engines/ms-windows/msw-style.c: Re-sync with gtk-wimp
+       * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Ditto
+       
 2006-01-28  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtk.symbols: 
index d0b21d746f60847f8fd3b194ddaac467f14faa0c..1df480d9c7e173597913dd9c17901fa25c33d885 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-28  Dom Lachowicz <cinamod@hotmail.com>
+
+       * modules/engines/ms-windows/msw-style.c: Re-sync with gtk-wimp
+       * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Ditto
+       
 2006-01-28  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtk.symbols: 
index da1ad4bb499ab9fcc134fd7019f40f0bece43e91..92c8b4b038b9bc6fb72c0aa00ea1828fb8a60e4f 100755 (executable)
@@ -23,7 +23,7 @@ style "msw-default"
   #GtkComboBox::add-tearoffs = 0
   
   GtkComboBox::appears-as-list = 1
-  GtkComboBox::focus-on-click = 1
+  GtkComboBox::focus-on-click = 0
   
   GOComboBox::add_tearoffs = 0
 
@@ -37,3 +37,17 @@ style "msw-default"
   }
 }
 class "*" style "msw-default"
+
+style "msw-combobox-toggle" = "msw-default"
+{
+  xthickness = 0
+  ythickness = 0
+  GtkButton::default-border = { 0, 0, 0, 0 }
+  GtkButton::default-outside-border = { 0, 0, 0, 0 }
+  GtkButton::child-displacement-x = 0
+  GtkButton::child-displacement-y = 0
+  GtkWidget::focus-padding = 0
+  GtkWidget::focus-line-width = 0
+}
+widget_class "*ComboBox*ToggleButton*" style "msw-combobox-toggle"
+
index cd637ffa83aebe831575f4dfb789674040f71a71..740255e16f37563ca72196ef12406508639f9665 100755 (executable)
@@ -922,6 +922,91 @@ map_gtk_progress_bar_to_xp (GtkProgressBar * progress_bar, gboolean trough)
     return ret;
 }
 
+static gboolean
+is_combo_box_child (GtkWidget* w)
+{
+    GtkWidget* tmp;
+    
+    if (w == NULL)
+       return FALSE;
+
+    for (tmp = w->parent; tmp; tmp = tmp->parent)
+       {
+           if (GTK_IS_COMBO_BOX(tmp))
+               return TRUE;
+       }
+
+    return FALSE;
+}
+
+static gboolean
+combo_box_draw_arrow (GtkStyle * style,
+           GdkWindow * window,
+           GtkStateType state,
+           GdkRectangle * area,
+           GtkWidget * widget)
+{
+    if (xp_theme_draw (window, XP_THEME_ELEMENT_COMBOBUTTON,
+                      style, widget->allocation.x, widget->allocation.y, 
+                      widget->allocation.width, widget->allocation.height,
+                      state, area))
+       {
+           return TRUE;
+       }
+
+    return FALSE;
+}
+
+/* This is ugly because no box drawing function is invoked for the combo
+   box as a whole, so we draw part of the entire box in every subwidget.
+   We do this by finding the allocation of the combo box in the given
+   window's coordinates and drawing.  The xp drawing routines take care
+   of the clipping. */
+static gboolean
+combo_box_draw_box (GtkStyle * style,
+         GdkWindow * window,
+         GtkStateType state_type,
+         GtkShadowType shadow_type,
+         GdkRectangle * area,
+         GtkWidget * widget,
+         const gchar * detail, gint x, gint y, gint width, gint height)
+{
+    GtkWidget* combo_box;
+    GdkRectangle combo_alloc;
+    
+    if (!widget)
+       return FALSE;
+    for (combo_box = widget->parent; combo_box; combo_box = combo_box->parent)
+       {
+           if (GTK_IS_COMBO_BOX(combo_box))
+               break;
+       }
+    if (!combo_box)
+       return FALSE;
+
+    combo_alloc = combo_box->allocation;
+    if (window != combo_box->window) 
+       {
+           GtkWidget* tmp;
+           for (tmp = widget; tmp && tmp != combo_box; tmp = widget->parent) 
+               {
+                   if (tmp->parent && tmp->window != tmp->parent->window)
+                       {
+                           combo_alloc.x -= tmp->allocation.x;
+                           combo_alloc.y -= tmp->allocation.y;
+                       }
+               }
+       }
+       
+    if (xp_theme_draw (window, XP_THEME_ELEMENT_EDIT_TEXT,
+                      style, combo_alloc.x, combo_alloc.y,
+                       combo_alloc.width, combo_alloc.height, 
+                      state_type, area))
+       return TRUE;
+
+    return FALSE;
+}
+
 static void
 draw_part (GdkDrawable * drawable,
           GdkGC * gc, GdkRectangle * area, gint x, gint y, Part part)
@@ -1294,6 +1379,14 @@ draw_arrow (GtkStyle * style,
 
     sanitize_size (window, &width, &height);
 
+    if (GTK_IS_ARROW(widget) && is_combo_box_child(widget))
+        {
+           if (combo_box_draw_arrow (style, window, state, area, widget))
+               {
+                   return;
+               }
+        }
+
     if (detail && strcmp (detail, "spinbutton") == 0)
        {
            if (xp_theme_is_drawable (XP_THEME_ELEMENT_SPIN_BUTTON_UP))
@@ -1491,7 +1584,13 @@ draw_box (GtkStyle * style,
          GtkWidget * widget,
          const gchar * detail, gint x, gint y, gint width, gint height)
 {
-    if (detail &&
+    if (is_combo_box_child (widget) 
+       && combo_box_draw_box (style, window, state_type, shadow_type,
+                              area, widget, detail, x, y, width, height))
+       {
+           return;
+       }
+    else if (detail &&
        (!strcmp (detail, "button") || !strcmp (detail, "buttondefault")))
        {
            if (GTK_IS_TREE_VIEW (widget->parent)
@@ -1736,7 +1835,7 @@ draw_box (GtkStyle * style,
                {
                    return;
                }
-       }
+       }       
     else if (detail
             && (strcmp (detail, "vscrollbar") == 0
                 || strcmp (detail, "hscrollbar") == 0))
@@ -2064,6 +2163,12 @@ draw_shadow (GtkStyle * style,
 {
     gboolean is_handlebox_grippie = (detail && !strcmp (detail, "handlebox"));
 
+    if (is_combo_box_child (widget) 
+       && combo_box_draw_box (style, window, state_type, shadow_type,
+                              area, widget, detail, x, y, width, height))
+        {
+           return;
+       }
     if (detail && !strcmp (detail, "entry"))
        {
            if (xp_theme_draw (window, XP_THEME_ELEMENT_EDIT_TEXT, style,