diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-12-08 10:48:22 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-12-08 10:48:22 +0100 |
commit | f041313efb8956a5fc4792b982b60a1de50f2870 (patch) | |
tree | f92ff10b257e878d1ce118243321072ed9398e40 | |
parent | ddfdf66d7e402d34b2af3220a75a9e0cbef3397a (diff) |
Allow theme to override width on box.
-rw-r--r-- | source/widgets/box.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/widgets/box.c b/source/widgets/box.c index 8ebd9257..27440a8b 100644 --- a/source/widgets/box.c +++ b/source/widgets/box.c @@ -55,6 +55,14 @@ static int box_get_desired_width ( widget *wid ) box *b = (box *) wid; int spacing = distance_get_pixel ( b->spacing, b->type ); int width = 0; + + // Allow user to override. + RofiDistance w = rofi_theme_get_distance ( wid, "width", 0 ); + width = distance_get_pixel ( w, ROFI_ORIENTATION_HORIZONTAL ); + if ( width > 0 ) { + return width ; + } + if ( b->type == ROFI_ORIENTATION_HORIZONTAL ) { int active_widgets = 0; for ( GList *iter = g_list_first ( b->children ); iter != NULL; iter = g_list_next ( iter ) ) { |