ui/motif/container.c

changeset 93
5223de7979e2
parent 92
d56175dd931e
child 99
ea1a2d5de765
equal deleted inserted replaced
92:d56175dd931e 93:5223de7979e2
479 479
480 int width = 0; 480 int width = 0;
481 int height = 0; 481 int height = 0;
482 XtVaGetValues(widget, XmNwidth, &width, XmNheight, &height, NULL); 482 XtVaGetValues(widget, XmNwidth, &width, XmNheight, &height, NULL);
483 int button_width = width / 4; 483 int button_width = width / 4;
484 int button_height = 0;
485 int x = 0; 484 int x = 0;
486 UCX_FOREACH(elm, v->tabs) { 485 UCX_FOREACH(elm, v->tabs) {
487 UiTab *tab = elm->data; 486 UiTab *tab = elm->data;
488 XtVaSetValues( 487 XtVaSetValues(
489 tab->tab_button, 488 tab->tab_button,
490 XmNx, x, 489 XmNx, x,
491 XmNy, 0, 490 XmNy, 0,
492 XmNwidth, 491 XmNwidth,
493 button_width, 492 button_width,
494 XmNheight, 493
495 v->height,
496 NULL); 494 NULL);
497 x += button_width; 495 x += button_width;
498 } 496 }
499 497
500 if(height <= v->height) { 498 if(height <= v->height) {
501 XtVaSetValues(widget, XmNheight, v->height + (v->height/7), NULL); 499 XtVaSetValues(widget, XmNheight, v->height + 4, NULL);
502 } 500 }
503 } 501 }
504 502
505 static void ui_tabbar_expose(Widget widget, XtPointer udata, XtPointer cdata) { 503 static void ui_tabbar_expose(Widget widget, XtPointer udata, XtPointer cdata) {
506 MotifTabbedPane *v = (MotifTabbedPane*)udata; 504 MotifTabbedPane *v = (MotifTabbedPane*)udata;
636 XmNbackground, 634 XmNbackground,
637 &v->bg2, 635 &v->bg2,
638 XmNheight, 636 XmNheight,
639 &v->height, 637 &v->height,
640 NULL); 638 NULL);
639 v->height += 2; // border
641 } 640 }
642 641
643 ui_change_tab(v, tab); 642 ui_change_tab(v, tab);
644 ui_tabbar_resize(v->tabbar, v, NULL); 643 ui_tabbar_resize(v->tabbar, v, NULL);
645 644

mercurial