No idea to what happened to this one. So I'm resending it.

-------- Messaggio originale --------
Oggetto: Re: [Xrdp-devel] Patches to style xrdp wm
Data: Thu, 18 Nov 2010 10:40:23 +0100
Mittente: Alessandro Briosi <tsd...@briosix.org>
A: xrdp-devel@lists.sourceforge.net

Il 17/11/2010 23:59, Jonathan Buzzard ha scritto:
> 
> Actually I think it important to make the login screen look good.
> 
> Looks much better, though I note that the combo button still lacks an 
> indicative down arrow.
> 

Attached patches for arrow and some fixes to the others.

Alessandro

Screenshot
[1] <http://www.briosix.org/tsdogs/screenshots/xrdp_styled2.png>

>From f9dd58c671b7281d0c3731ea89a97a7760a2accf Mon Sep 17 00:00:00 2001
From: Alessandro Briosi <tsd...@briosix.org>
Date: Thu, 18 Nov 2010 10:17:49 +0100
Subject: [PATCH 3/5] Add an arrow to the combo and make it look a little better


Signed-off-by: Alessandro Briosi <tsd...@briosix.org>
---
 xrdp/xrdp_bitmap.c |   19 +++++++++++++++++--
 xrdp/xrdp_types.h  |    4 ++--
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c
index 925926d..7cf7442 100644
--- a/xrdp/xrdp_bitmap.c
+++ b/xrdp/xrdp_bitmap.c
@@ -1287,13 +1287,28 @@ xrdp_bitmap_invalidate(struct xrdp_bitmap* self, struct xrdp_rect* rect)
     y = 2;
     w = (self->width - x) - 2;
     h = self->height - 4;
+    /* looks better with a background around */
+    painter->fg_color = self->wm->grey;
+    xrdp_painter_fill_rect(painter, self, x, y, w, h);
     if (self->state == BUTTON_STATE_UP) /* 0 */
     {
-      xrdp_bitmap_draw_button(self, painter, x, y, w, h, 0);
+      xrdp_bitmap_draw_button(self, painter, x+1, y+1, w-1, h-1, 0);
     }
     else
     {
-      xrdp_bitmap_draw_button(self, painter, x, y, w, h, 1);
+      xrdp_bitmap_draw_button(self, painter, x+1, y+1, w-1, h-1, 1);
+    }
+    /* draw the arrow */
+    w = w / 2;
+    x = x + (w / 2);
+    h = (h / 2) + 2;
+    y = y + (h / 2);
+    painter->fg_color = self->wm->black;
+    for (i=w; i>0; i=i-2) 
+    {
+      xrdp_painter_fill_rect(painter, self, x, y, i, 1);
+      y++;
+      x = x + 1;
     }
   }
   else if (self->type == WND_TYPE_SPECIAL) /* 8 special */
diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h
index 711446a..8c98a95 100644
--- a/xrdp/xrdp_types.h
+++ b/xrdp/xrdp_types.h
@@ -374,9 +374,9 @@ struct xrdp_bitmap
 #define DEFAULT_BUTTON_W      60
 #define DEFAULT_BUTTON_H      23
 #define DEFAULT_COMBO_W       140
-#define DEFAULT_COMBO_H       20
+#define DEFAULT_COMBO_H       21
 #define DEFAULT_EDIT_W        140
-#define DEFAULT_EDIT_H        20
+#define DEFAULT_EDIT_H        21
 #define DEFAULT_WND_LOGIN_W   400
 #define DEFAULT_WND_LOGIN_H   200
 #define DEFAULT_WND_HELP_W    340
-- 
1.7.1


>From a80c9dc8e0578558ce6a43014a13bf16ba1c1441 Mon Sep 17 00:00:00 2001
From: Alessandro Briosi <tsd...@briosix.org>
Date: Thu, 18 Nov 2010 10:25:35 +0100
Subject: [PATCH 4/5] Change edit and combo default height and fix spacing of elements


Signed-off-by: Alessandro Briosi <tsd...@briosix.org>
---
 xrdp/xrdp_login_wnd.c |    8 ++++----
 xrdp/xrdp_types.h     |    1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xrdp/xrdp_login_wnd.c b/xrdp/xrdp_login_wnd.c
index 376defb..2b39483 100644
--- a/xrdp/xrdp_login_wnd.c
+++ b/xrdp/xrdp_login_wnd.c
@@ -269,7 +269,7 @@ xrdp_wm_show_edits(struct xrdp_wm* self, struct xrdp_bitmap* combo)
         b->parent = self->login_window;
         b->owner = self->login_window;
         b->left = self->login_window->width >= DEFAULT_WND_LOGIN_W ? 155 : 5;
-        b->top = 60 + (DEFAULT_EDIT_H+5) * count;
+        b->top = DEFAULT_ELEMENT_TOP + DEFAULT_COMBO_H + 5 + (DEFAULT_EDIT_H+5) * count;
         b->id = 100 + 2 * count;
         name = (char*)list_get_item(mod->names, index);
         set_string(&b->caption1, name);
@@ -282,7 +282,7 @@ xrdp_wm_show_edits(struct xrdp_wm* self, struct xrdp_bitmap* combo)
         b->parent = self->login_window;
         b->owner = self->login_window;
         b->left = self->login_window->width >= DEFAULT_WND_LOGIN_W ? DEFAULT_WND_LOGIN_W - DEFAULT_EDIT_W - 30 : 70;
-        b->top = 60 + (DEFAULT_EDIT_H+5) * count;
+        b->top = DEFAULT_ELEMENT_TOP + DEFAULT_COMBO_H + 5 + (DEFAULT_EDIT_H+5) * count;
         b->id = 100 + 2 * count + 1;
         b->pointer = 1;
         b->tab_stop = 1;
@@ -526,7 +526,7 @@ xrdp_login_wnd_create(struct xrdp_wm* self)
   but->parent = self->login_window;
   but->owner = self->login_window;
   but->left = regular ? 155 : 5;
-  but->top = 35;
+  but->top = DEFAULT_ELEMENT_TOP;
   set_string(&but->caption1, "Module");
 
   /* combo */
@@ -535,7 +535,7 @@ xrdp_login_wnd_create(struct xrdp_wm* self)
   combo->parent = self->login_window;
   combo->owner = self->login_window;
   combo->left = regular ? DEFAULT_WND_LOGIN_W - DEFAULT_COMBO_W - 30 : 70;
-  combo->top = 35;
+  combo->top = DEFAULT_ELEMENT_TOP;
   combo->id = 6;
   combo->tab_stop = 1;
   xrdp_wm_login_fill_in_combo(self, combo);
diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h
index 8c98a95..5f4c8ee 100644
--- a/xrdp/xrdp_types.h
+++ b/xrdp/xrdp_types.h
@@ -371,6 +371,7 @@ struct xrdp_bitmap
 #define NUM_FONTS 0x4e00
 #define DEFAULT_FONT_NAME "sans-10.fv1"
 
+#define DEFAULT_ELEMENT_TOP   35
 #define DEFAULT_BUTTON_W      60
 #define DEFAULT_BUTTON_H      23
 #define DEFAULT_COMBO_W       140
-- 
1.7.1


>From dee7d923df1e3e24e1c34b3ee8d5c3fdde24f318 Mon Sep 17 00:00:00 2001
From: Alessandro Briosi <tsd...@briosix.org>
Date: Thu, 18 Nov 2010 10:28:56 +0100
Subject: [PATCH 5/5] fix arrow position


Signed-off-by: Alessandro Briosi <tsd...@briosix.org>
---
 xrdp/xrdp_bitmap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c
index 7cf7442..df2f9e5 100644
--- a/xrdp/xrdp_bitmap.c
+++ b/xrdp/xrdp_bitmap.c
@@ -1300,9 +1300,9 @@ xrdp_bitmap_invalidate(struct xrdp_bitmap* self, struct xrdp_rect* rect)
     }
     /* draw the arrow */
     w = w / 2;
-    x = x + (w / 2);
+    x = x + (w / 2) + 1;
     h = (h / 2) + 2;
-    y = y + (h / 2);
+    y = y + (h / 2) + 1;
     painter->fg_color = self->wm->black;
     for (i=w; i>0; i=i-2) 
     {
-- 
1.7.1


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
xrdp-devel mailing list
xrdp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xrdp-devel

Reply via email to