From 2ca1b5e7319bbdf55784850354a4622f0360f45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Thu, 1 Nov 2012 01:54:33 +0000 Subject: [PATCH] [GB.GTK] * BUG: Label, TextLabel, PictureBox and MovieBox now draw their plain border with the foreground color, like gb.qt4 does. git-svn-id: svn://localhost/gambas/trunk@5269 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.gtk/src/gcontrol.cpp | 7 ++++++- gb.gtk/src/gcontrol.h | 1 + gb.gtk/src/glabel.cpp | 5 +++++ gb.gtk/src/glabel.h | 1 + gb.gtk/src/gmoviebox.h | 1 + gb.gtk/src/gpicturebox.cpp | 11 +++++++++++ gb.gtk/src/gpicturebox.h | 1 + 7 files changed, 26 insertions(+), 1 deletion(-) diff --git a/gb.gtk/src/gcontrol.cpp b/gb.gtk/src/gcontrol.cpp index 4511f400c..9f0d2900f 100644 --- a/gb.gtk/src/gcontrol.cpp +++ b/gb.gtk/src/gcontrol.cpp @@ -1187,6 +1187,11 @@ GList* gControl::controlList() return controls; } +gColor gControl::getFrameColor() +{ + return gDesktop::lightfgColor(); +} + void gControl::drawBorder(GdkEventExpose *e) { GdkDrawable *win; @@ -1234,7 +1239,7 @@ void gControl::drawBorder(GdkEventExpose *e) GdkGC *gc; GdkGCValues values; - fill_gdk_color(&values.foreground, gDesktop::lightfgColor(), gdk_drawable_get_colormap(win)); + fill_gdk_color(&values.foreground, getFrameColor(), gdk_drawable_get_colormap(win)); gc = gtk_gc_get(gdk_drawable_get_depth(win), gdk_drawable_get_colormap(win), &values, GDK_GC_FOREGROUND); //gdk_draw_rectangle(win, use_base ? st->text_gc[GTK_STATE_NORMAL] : st->fg_gc[GTK_STATE_NORMAL], FALSE, x, y, w - 1, h - 1); diff --git a/gb.gtk/src/gcontrol.h b/gb.gtk/src/gcontrol.h index 8d639386e..843351a01 100644 --- a/gb.gtk/src/gcontrol.h +++ b/gb.gtk/src/gcontrol.h @@ -251,6 +251,7 @@ public: int getFramePadding() const { return frame_padding; } void setFramePadding(int padding); virtual int getFrameWidth(); + virtual gColor getFrameColor(); void drawBorder(GdkEventExpose *e); void drawBackground(GdkEventExpose *e); diff --git a/gb.gtk/src/glabel.cpp b/gb.gtk/src/glabel.cpp index a006eba06..af69bf39b 100644 --- a/gb.gtk/src/glabel.cpp +++ b/gb.gtk/src/glabel.cpp @@ -330,3 +330,8 @@ void gLabel::setWrap(bool v) _wrap = v; updateSize(true); } + +gColor gLabel::getFrameColor() +{ + return realForeground(); +} diff --git a/gb.gtk/src/glabel.h b/gb.gtk/src/glabel.h index 3b4f9e5bd..1bb526557 100644 --- a/gb.gtk/src/glabel.h +++ b/gb.gtk/src/glabel.h @@ -56,6 +56,7 @@ public: virtual void afterRefresh(); //"Private" + virtual gColor getFrameColor(); void updateSize(bool adjust = false, bool noresize = false); void updateLayout(); PangoLayout *layout; diff --git a/gb.gtk/src/gmoviebox.h b/gb.gtk/src/gmoviebox.h index a342d6636..06de694c9 100644 --- a/gb.gtk/src/gmoviebox.h +++ b/gb.gtk/src/gmoviebox.h @@ -43,6 +43,7 @@ public: bool loadMovie(char *buf, int len); //"Private" + virtual gColor getFrameColor(); bool pl; guint timeout; GdkPixbufAnimation *animation; diff --git a/gb.gtk/src/gpicturebox.cpp b/gb.gtk/src/gpicturebox.cpp index f62f23e1e..74600c366 100644 --- a/gb.gtk/src/gpicturebox.cpp +++ b/gb.gtk/src/gpicturebox.cpp @@ -156,6 +156,10 @@ void gMovieBox::setAlignment(int al) gtk_misc_set_alignment(GTK_MISC(widget), gt_from_alignment(al, false), gt_from_alignment(al, true)); } +gColor gMovieBox::getFrameColor() +{ + return realForeground(); +} /**************************************************************************************** @@ -271,3 +275,10 @@ void gPictureBox::updateBorder() gControl::updateBorder(); adjust(); } + +gColor gPictureBox::getFrameColor() +{ + return realForeground(); +} + + diff --git a/gb.gtk/src/gpicturebox.h b/gb.gtk/src/gpicturebox.h index e273c405f..58c8c2ebf 100644 --- a/gb.gtk/src/gpicturebox.h +++ b/gb.gtk/src/gpicturebox.h @@ -47,6 +47,7 @@ public: virtual void updateBorder(); //"Private" + virtual gColor getFrameColor(); void redraw(); void adjust(); gPicture *_picture;