From fc0ea0b22e0ed1b8e2b76469e4582182e45109d3 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sun, 5 Jul 2020 11:41:04 +0200 Subject: Update changelog a bit. --- releasenotes/1.6.0/release-1.6.0.markdown | 39 +++++++++++++++++++++++++------ source/widgets/listview.c | 4 ++-- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/releasenotes/1.6.0/release-1.6.0.markdown b/releasenotes/1.6.0/release-1.6.0.markdown index aa2be81f..b92d9333 100644 --- a/releasenotes/1.6.0/release-1.6.0.markdown +++ b/releasenotes/1.6.0/release-1.6.0.markdown @@ -15,14 +15,24 @@ have been possible. ## Script mode +Rofi now communicates some information back to the script using environment variables. +The most important one, is `ROFI_RETV`, this is equal to the return value in dmenu mode. +It can have the following values: - * Support for invisible search text - * Support for passing extra information back on selection - * Support for custom keybindings - * Support for custom delimiter - * Support for dmenus no-custom option + * **0**: Initial call of script. + * **1**: Selected an entry. + * **2**: Selected a custom entry. + * **10-28**: Custom keybinding 1-19 +To fully read up on all features of script mode, there is now a `rofi-script(5)` manpage. + +Some of the new features are: + + * Search invisible text + * Pass extra information back on selection + * Support for a custom delimiter + * Support for dmenus no-custom option ## Theme @@ -32,12 +42,24 @@ There have been a set of tweaks to the theme format, making it more flexible and ### Listview flexibility -Instead of the listview having a hacked textbox as elements. It now re-uses existing widgets like box, icon and textbox. -This way you can re-structure how it looks. For example put the icon above the text. +This is one of the biggest change, instead of the listview having a hacked +textbox as elements. It now re-uses existing widgets like box, icon and +textbox. This way you can re-structure how it looks. For example put the icon +above the text. ![Icons](./icons.png) +With theme: + +```css +element { + orientation: vertical; +} +``` + +This will make the box `element` put `element-icon` and `element-text` in a vertical list. + ### Calculation support in theme format. @@ -50,6 +72,9 @@ window { } ``` +It supports: `-`, `+`, `/`, `*` and `%` operators and they should be surrounded by whitespace. + + ### Initial media support This is a very initial implementation of CSS like `@media` support. This allows you to modify the theme diff --git a/source/widgets/listview.c b/source/widgets/listview.c index 0650cccc..863e2b77 100644 --- a/source/widgets/listview.c +++ b/source/widgets/listview.c @@ -328,7 +328,7 @@ static void barview_draw ( widget *wid, cairo_t *draw ) if ( lv->barview.direction == LEFT_TO_RIGHT ) { for ( unsigned int i = 0; i < max && width > 0; i++ ) { update_element ( lv, i, i + offset, TRUE ); - int twidth = widget_get_desired_width ( lv->boxes[i].box );//textbox_get_desired_width ( WIDGET ( lv->boxes[i].textbox ) ); + int twidth = widget_get_desired_width ( WIDGET ( lv->boxes[i].box ) ); if ( twidth >= width ) { if ( !first ) { break; @@ -348,7 +348,7 @@ static void barview_draw ( widget *wid, cairo_t *draw ) else { for ( unsigned int i = 0; i < lv->cur_elements && width > 0 && i <= offset; i++ ) { update_element ( lv, i, offset - i, TRUE ); - int twidth = widget_get_desired_width ( lv->boxes[i].box );// int twidth = textbox_get_desired_width ( WIDGET ( lv->boxes[i].textbox ) ); + int twidth = widget_get_desired_width ( WIDGET ( lv->boxes[i].box ) ); if ( twidth >= width ) { if ( !first ) { break; -- cgit v1.2.3