fixes for small screen

ulab-original
jsorg71 15 years ago
parent d5e4d708e9
commit 1498f0377d

@ -268,7 +268,7 @@ xrdp_wm_show_edits(struct xrdp_wm* self, struct xrdp_bitmap* combo)
insert_index++; insert_index++;
b->parent = self->login_window; b->parent = self->login_window;
b->owner = self->login_window; b->owner = self->login_window;
b->left = 155; b->left = self->login_window->width >= 400 ? 155 : 5;
b->top = 60 + 25 * count; b->top = 60 + 25 * count;
b->id = 100 + 2 * count; b->id = 100 + 2 * count;
name = (char*)list_get_item(mod->names, index); name = (char*)list_get_item(mod->names, index);
@ -281,7 +281,7 @@ xrdp_wm_show_edits(struct xrdp_wm* self, struct xrdp_bitmap* combo)
insert_index++; insert_index++;
b->parent = self->login_window; b->parent = self->login_window;
b->owner = self->login_window; b->owner = self->login_window;
b->left = 230; b->left = self->login_window->width >= 400 ? 230 : 70;
b->top = 60 + 25 * count; b->top = 60 + 25 * count;
b->id = 100 + 2 * count + 1; b->id = 100 + 2 * count + 1;
b->pointer = 1; b->pointer = 1;
@ -451,9 +451,27 @@ xrdp_login_wnd_create(struct xrdp_wm* self)
struct xrdp_bitmap* but; struct xrdp_bitmap* but;
struct xrdp_bitmap* combo; struct xrdp_bitmap* combo;
char file_path[256]; char file_path[256];
int log_width;
int log_height;
int regular;
log_width = 400;
log_height = 200;
regular = 1;
if (self->screen->width < log_width)
{
if (self->screen->width < 240)
{
log_width = self->screen->width - 4;
}
else
{
log_width = 240;
}
regular = 0;
}
/* draw login window */ /* draw login window */
self->login_window = xrdp_bitmap_create(400, 200, self->screen->bpp, self->login_window = xrdp_bitmap_create(log_width, log_height, self->screen->bpp,
WND_TYPE_WND, self); WND_TYPE_WND, self);
list_add_item(self->screen->child_list, (long)self->login_window); list_add_item(self->screen->child_list, (long)self->login_window);
self->login_window->parent = self->screen; self->login_window->parent = self->screen;
@ -465,33 +483,35 @@ xrdp_login_wnd_create(struct xrdp_wm* self)
self->login_window->height / 2; self->login_window->height / 2;
self->login_window->notify = xrdp_wm_login_notify; self->login_window->notify = xrdp_wm_login_notify;
set_string(&self->login_window->caption1, "Login to xrdp"); set_string(&self->login_window->caption1, "Login to xrdp");
if (regular)
/* image */ {
but = xrdp_bitmap_create(4, 4, self->screen->bpp, WND_TYPE_IMAGE, self); /* image */
g_snprintf(file_path, 255, "%s/xrdp256.bmp", XRDP_SHARE_PATH); but = xrdp_bitmap_create(4, 4, self->screen->bpp, WND_TYPE_IMAGE, self);
xrdp_bitmap_load(but, file_path, self->palette); g_snprintf(file_path, 255, "%s/xrdp256.bmp", XRDP_SHARE_PATH);
but->parent = self->screen; xrdp_bitmap_load(but, file_path, self->palette);
but->owner = self->screen; but->parent = self->screen;
but->left = self->screen->width - but->width; but->owner = self->screen;
but->top = self->screen->height - but->height; but->left = self->screen->width - but->width;
list_add_item(self->screen->child_list, (long)but); but->top = self->screen->height - but->height;
list_add_item(self->screen->child_list, (long)but);
/* image */
but = xrdp_bitmap_create(4, 4, self->screen->bpp, WND_TYPE_IMAGE, self); /* image */
g_snprintf(file_path, 255, "%s/ad256.bmp", XRDP_SHARE_PATH); but = xrdp_bitmap_create(4, 4, self->screen->bpp, WND_TYPE_IMAGE, self);
xrdp_bitmap_load(but, file_path, self->palette); g_snprintf(file_path, 255, "%s/ad256.bmp", XRDP_SHARE_PATH);
but->parent = self->login_window; xrdp_bitmap_load(but, file_path, self->palette);
but->owner = self->login_window; but->parent = self->login_window;
but->left = 10; but->owner = self->login_window;
but->top = 30; but->left = 10;
list_add_item(self->login_window->child_list, (long)but); but->top = 30;
list_add_item(self->login_window->child_list, (long)but);
}
/* label */ /* label */
but = xrdp_bitmap_create(60, 20, self->screen->bpp, WND_TYPE_LABEL, self); but = xrdp_bitmap_create(60, 20, self->screen->bpp, WND_TYPE_LABEL, self);
list_add_item(self->login_window->child_list, (long)but); list_add_item(self->login_window->child_list, (long)but);
but->parent = self->login_window; but->parent = self->login_window;
but->owner = self->login_window; but->owner = self->login_window;
but->left = 155; but->left = regular ? 155 : 5;
but->top = 35; but->top = 35;
set_string(&but->caption1, "Module"); set_string(&but->caption1, "Module");
@ -500,7 +520,7 @@ xrdp_login_wnd_create(struct xrdp_wm* self)
list_add_item(self->login_window->child_list, (long)combo); list_add_item(self->login_window->child_list, (long)combo);
combo->parent = self->login_window; combo->parent = self->login_window;
combo->owner = self->login_window; combo->owner = self->login_window;
combo->left = 230; combo->left = regular ? 230 : 70;
combo->top = 35; combo->top = 35;
combo->id = 6; combo->id = 6;
combo->tab_stop = 1; combo->tab_stop = 1;
@ -511,7 +531,7 @@ xrdp_login_wnd_create(struct xrdp_wm* self)
list_add_item(self->login_window->child_list, (long)but); list_add_item(self->login_window->child_list, (long)but);
but->parent = self->login_window; but->parent = self->login_window;
but->owner = self->login_window; but->owner = self->login_window;
but->left = 180; but->left = regular ? 180 : 30;
but->top = 160; but->top = 160;
but->id = 3; but->id = 3;
set_string(&but->caption1, "OK"); set_string(&but->caption1, "OK");
@ -523,23 +543,26 @@ xrdp_login_wnd_create(struct xrdp_wm* self)
list_add_item(self->login_window->child_list, (long)but); list_add_item(self->login_window->child_list, (long)but);
but->parent = self->login_window; but->parent = self->login_window;
but->owner = self->login_window; but->owner = self->login_window;
but->left = 250; but->left = regular ? 250 : ((log_width - 30) - 60);
but->top = 160; but->top = 160;
but->id = 2; but->id = 2;
set_string(&but->caption1, "Cancel"); set_string(&but->caption1, "Cancel");
but->tab_stop = 1; but->tab_stop = 1;
self->login_window->esc_button = but; self->login_window->esc_button = but;
/* button */ if (regular)
but = xrdp_bitmap_create(60, 25, self->screen->bpp, WND_TYPE_BUTTON, self); {
list_add_item(self->login_window->child_list, (long)but); /* button */
but->parent = self->login_window; but = xrdp_bitmap_create(60, 25, self->screen->bpp, WND_TYPE_BUTTON, self);
but->owner = self->login_window; list_add_item(self->login_window->child_list, (long)but);
but->left = 320; but->parent = self->login_window;
but->top = 160; but->owner = self->login_window;
but->id = 1; but->left = 320;
set_string(&but->caption1, "Help"); but->top = 160;
but->tab_stop = 1; but->id = 1;
set_string(&but->caption1, "Help");
but->tab_stop = 1;
}
/* labels and edits */ /* labels and edits */
xrdp_wm_show_edits(self, combo); xrdp_wm_show_edits(self, combo);

@ -1467,27 +1467,45 @@ int APP_CC
xrdp_wm_log_msg(struct xrdp_wm* self, char* msg) xrdp_wm_log_msg(struct xrdp_wm* self, char* msg)
{ {
struct xrdp_bitmap* but; struct xrdp_bitmap* but;
int w;
int h;
int xoffset;
int yoffset;
list_add_item(self->log, (long)g_strdup(msg)); list_add_item(self->log, (long)g_strdup(msg));
if (self->log_wnd == 0) if (self->log_wnd == 0)
{ {
w = 400;
h = 400;
xoffset = 10;
yoffset = 10;
if (self->screen->width < w)
{
w = self->screen->width - 4;
xoffset = 2;
}
if (self->screen->height < h)
{
h = self->screen->height - 4;
yoffset = 2;
}
/* log window */ /* log window */
self->log_wnd = xrdp_bitmap_create(400, 400, self->screen->bpp, self->log_wnd = xrdp_bitmap_create(w, h, self->screen->bpp,
WND_TYPE_WND, self); WND_TYPE_WND, self);
list_add_item(self->screen->child_list, (long)self->log_wnd); list_add_item(self->screen->child_list, (long)self->log_wnd);
self->log_wnd->parent = self->screen; self->log_wnd->parent = self->screen;
self->log_wnd->owner = self->screen; self->log_wnd->owner = self->screen;
self->log_wnd->bg_color = self->grey; self->log_wnd->bg_color = self->grey;
self->log_wnd->left = 10; self->log_wnd->left = xoffset;
self->log_wnd->top = 10; self->log_wnd->top = yoffset;
set_string(&(self->log_wnd->caption1), "Connection Log"); set_string(&(self->log_wnd->caption1), "Connection Log");
/* ok button */ /* ok button */
but = xrdp_bitmap_create(60, 25, self->screen->bpp, WND_TYPE_BUTTON, self); but = xrdp_bitmap_create(60, 25, self->screen->bpp, WND_TYPE_BUTTON, self);
list_insert_item(self->log_wnd->child_list, 0, (long)but); list_insert_item(self->log_wnd->child_list, 0, (long)but);
but->parent = self->log_wnd; but->parent = self->log_wnd;
but->owner = self->log_wnd; but->owner = self->log_wnd;
but->left = (400 - 60) - 10; but->left = (w - 60) - xoffset;
but->top = (400 - 25) - 10; but->top = (h - 25) - yoffset;
but->id = 1; but->id = 1;
but->tab_stop = 1; but->tab_stop = 1;
set_string(&but->caption1, "OK"); set_string(&but->caption1, "OK");

Loading…
Cancel
Save