[murrine] Fixed comboboxstyle = 1 with GtkComboBox::appears-as-list = 1
- From: Andrea Cimitan <acimitan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [murrine] Fixed comboboxstyle = 1 with GtkComboBox::appears-as-list = 1
- Date: Fri, 5 Mar 2010 12:35:41 +0000 (UTC)
commit 372cd41b44975e534c02461578c0d7052bcf0415
Author: Andrea Cimitan <andrea cimitan gmail com>
Date: Fri Mar 5 13:33:54 2010 +0100
Fixed comboboxstyle = 1 with GtkComboBox::appears-as-list = 1
src/murrine_draw.c | 10 +++++++---
src/murrine_style.c | 4 ++++
src/murrine_types.h | 7 ++++---
3 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/src/murrine_draw.c b/src/murrine_draw.c
index 1f902b4..d481cb5 100644
--- a/src/murrine_draw.c
+++ b/src/murrine_draw.c
@@ -818,14 +818,18 @@ murrine_draw_combobox (cairo_t *cr,
{
WidgetParameters params = widget;
MurrineColors colors_new = colors;
- int box_w = combobox->box_w;
- if (!(widget.xthickness > 2 && widget.ythickness > 2))
- box_w -= 3;
+ int box_w = (widget.xthickness > 2 && widget.ythickness > 2) ? combobox->box_w : combobox->box_w-3;
int os = (widget.xthickness > 2 && widget.ythickness > 2) ? 1 : 0;
colors_new.bg[GTK_STATE_NORMAL] = colors.spot[1];
murrine_shade (&colors_new.bg[GTK_STATE_NORMAL], combobox->prelight_shade,
&colors_new.bg[GTK_STATE_PRELIGHT]);
+ if (combobox->as_list)
+ {
+ params.style_functions->draw_button (cr, &colors_new, ¶ms, x, y, w, h, horizontal);
+ break;
+ }
+
cairo_save (cr);
if (params.ltr)
{
diff --git a/src/murrine_style.c b/src/murrine_style.c
index ceca5e4..b03f0b4 100644
--- a/src/murrine_style.c
+++ b/src/murrine_style.c
@@ -865,9 +865,13 @@ murrine_style_draw_box (DRAW_ARGS)
else
{
ComboBoxParameters combobox;
+ combobox.as_list = FALSE;
combobox.box_w = 24;
combobox.style = murrine_style->comboboxstyle;
combobox.prelight_shade = murrine_style->prelight_shade;
+
+ gtk_widget_style_get (widget->parent, "appears-as-list", &combobox.as_list, NULL);
+
STYLE_FUNCTION(draw_combobox) (cr, murrine_style->colors, params, &combobox, x, y, width, height, horizontal);
}
}
diff --git a/src/murrine_types.h b/src/murrine_types.h
index 54fa280..2f4ec7f 100644
--- a/src/murrine_types.h
+++ b/src/murrine_types.h
@@ -213,9 +213,10 @@ typedef struct
typedef struct
{
- int box_w;
- int style;
- double prelight_shade;
+ boolean as_list;
+ int box_w;
+ int style;
+ double prelight_shade;
} ComboBoxParameters;
typedef struct
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]