summaryrefslogtreecommitdiff
path: root/ldmicro/lib/linuxUI/linuxUI.cpp
diff options
context:
space:
mode:
authorRr422018-06-20 12:13:24 +0530
committerRr422018-06-20 12:13:24 +0530
commitcae95cbf69ebe440ebcda9b21ab895e4e2bdf719 (patch)
treeba72d57c0dc85c84a0888560ca39628c44295bf6 /ldmicro/lib/linuxUI/linuxUI.cpp
parent176a2daf611cc505896743f30de23bd391abd0bb (diff)
parente4c4f5ea11291e551967f5240f53c43895771ffb (diff)
downloadLDMicroGtk-cae95cbf69ebe440ebcda9b21ab895e4e2bdf719.tar.gz
LDMicroGtk-cae95cbf69ebe440ebcda9b21ab895e4e2bdf719.tar.bz2
LDMicroGtk-cae95cbf69ebe440ebcda9b21ab895e4e2bdf719.zip
merge update
Diffstat (limited to 'ldmicro/lib/linuxUI/linuxUI.cpp')
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/ldmicro/lib/linuxUI/linuxUI.cpp b/ldmicro/lib/linuxUI/linuxUI.cpp
index 062d10c..d9fbd3f 100644
--- a/ldmicro/lib/linuxUI/linuxUI.cpp
+++ b/ldmicro/lib/linuxUI/linuxUI.cpp
@@ -266,20 +266,21 @@ void SetBkColor(HWID widget, HCRDC hcr, COLORREF bkCol)
gtk_widget_override_background_color(GTK_WIDGET(widget),
GTK_STATE_FLAG_NORMAL, &bkCol);
- GtkStyleContext *context;
+ gint width = gtk_widget_get_allocated_width (widget);
+ gint height = gtk_widget_get_allocated_height (widget);
+
COLORREF col;
+ GtkStyleContext *context;
context = gtk_widget_get_style_context (widget);
- gint width = gtk_widget_get_allocated_width (widget);
- gint height = gtk_widget_get_allocated_height (widget);
gtk_style_context_get_color (context,
- gtk_style_context_get_state (context),
- &col);
+ gtk_style_context_get_state (context),
+ &col);
gdk_cairo_set_source_rgba (hcr, &col);
- gtk_render_background (context, hcr, 0, 0, width, height);
+ cairo_fill (hcr);
}
void SetTextColor(HCRDC hcr, COLORREF color)
@@ -290,7 +291,7 @@ void SetTextColor(HCRDC hcr, COLORREF color)
void TextOut(HWID hWid, HCRDC hcr, int nXStart, int nYStart, LPCTSTR lpString, int cchString)
{
- nYStart += 20;
+ nYStart += 30;
cairo_text_extents_t extents;
cairo_text_extents (hcr, lpString, &extents);
@@ -301,12 +302,14 @@ void TextOut(HWID hWid, HCRDC hcr, int nXStart, int nYStart, LPCTSTR lpString, i
if(nYStart+(extents.height/2.0) >= height)
{
- height += extents.height;
+ // g_print("Y extend\n");
+ height += extents.height += 50;
resize_flag = TRUE;
}
if (nXStart+(extents.width/2.0) >= width)
{
+ // g_print("X extend\n");
width += extents.width;
resize_flag = TRUE;
}
@@ -320,6 +323,8 @@ void TextOut(HWID hWid, HCRDC hcr, int nXStart, int nYStart, LPCTSTR lpString, i
cairo_move_to(hcr, nXStart, nYStart);
cairo_show_text(hcr, text);
+ // g_print("%s", text);
+
cairo_fill (hcr);
}
@@ -336,7 +341,10 @@ COLORREF GetTextColor(HCRDC Hdc)
BOOL InvalidateRect(HWID hWid, const RECT *lpRect, BOOL bErase)
{
if(!GDK_IS_WINDOW(hWid))
+ {
+ // g_print("not window\n");
return FALSE;
+ }
if (lpRect == NULL)
{