| 32 #include "ui/display.h" |
32 #include "ui/display.h" |
| 33 |
33 |
| 34 |
34 |
| 35 UIWIDGET ui_label_create(UiObject* obj, UiLabelArgs *args) { |
35 UIWIDGET ui_label_create(UiObject* obj, UiLabelArgs *args) { |
| 36 UiContainerPrivate *ctn = ui_obj_container(obj); |
36 UiContainerPrivate *ctn = ui_obj_container(obj); |
| 37 UI_APPLY_LAYOUT(ctn->layout, args); |
|
| 38 |
37 |
| 39 QString str = QString::fromUtf8(args->label); |
38 QString str = QString::fromUtf8(args->label); |
| 40 QLabel *widget = new QLabel(str); |
39 QLabel *widget = new QLabel(str); |
| 41 |
40 |
| 42 Qt::AlignmentFlag align = Qt::AlignCenter; |
41 Qt::AlignmentFlag align = Qt::AlignCenter; |
| 45 } else if(args->align == UI_ALIGN_RIGHT) { |
44 } else if(args->align == UI_ALIGN_RIGHT) { |
| 46 align = Qt::AlignRight; |
45 align = Qt::AlignRight; |
| 47 } |
46 } |
| 48 widget->setAlignment(align); |
47 widget->setAlignment(align); |
| 49 |
48 |
| 50 ctn->add(widget); |
49 UiLayout layout = UI_ARGS2LAYOUT(args); |
| |
50 ctn->add(widget, layout); |
| 51 |
51 |
| 52 return widget; |
52 return widget; |
| 53 } |
53 } |
| 54 |
54 |
| 55 UIWIDGET ui_llabel_create(UiObject* obj, UiLabelArgs *args) { |
55 UIWIDGET ui_llabel_create(UiObject* obj, UiLabelArgs *args) { |