diff --git a/include/widgets/box.h b/include/widgets/box.h index b698e026..46d0fdb1 100644 --- a/include/widgets/box.h +++ b/include/widgets/box.h @@ -53,9 +53,9 @@ typedef struct _box box; typedef enum { /** Pack widgets horizontal */ - BOX_HORIZONTAL, + BOX_HORIZONTAL = 0, /** Pack widgets vertical */ - BOX_VERTICAL + BOX_VERTICAL = 1 } boxType; /** diff --git a/source/widgets/box.c b/source/widgets/box.c index 409fa0b1..47452ad9 100644 --- a/source/widgets/box.c +++ b/source/widgets/box.c @@ -327,6 +327,8 @@ box * box_create ( const char *name, boxType type ) b->widget.get_desired_height = box_get_desired_height; b->widget.enabled = rofi_theme_get_boolean ( WIDGET ( b ), "enabled", TRUE ); + b->type = rofi_theme_get_boolean ( WIDGET (b), "vertical",b->type ); + b->spacing = rofi_theme_get_distance ( WIDGET ( b ), "spacing", DEFAULT_SPACING ); return b; } diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c index 150783a1..21a4222f 100644 --- a/source/widgets/textbox.c +++ b/source/widgets/textbox.c @@ -169,6 +169,16 @@ textbox* textbox_create ( const char *name, TextboxFlags flags, TextBoxFontType tb->yalign = MAX ( 0, MIN ( 1.0, tb->yalign)); // Enabled by default tb->widget.enabled = rofi_theme_get_boolean ( WIDGET ( tb ), "enabled", TRUE ); + + Distance w = rofi_theme_get_distance ( WIDGET ( tb ), "width", 0 ); + int wi = distance_get_pixel ( w, ORIENTATION_HORIZONTAL ); + if ( wi > 0 ) + { + printf("set width: %d\n", wi); + tb->widget.w = wi; + textbox_moveresize ( tb, tb->widget.x, tb->widget.y, tb->widget.w, tb->widget.h ); + } + return tb; }