mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
Add `-multi-select
flag to dmenu.
* Changes default behaviour.
This commit is contained in:
parent
965d2c2ac5
commit
602eb63557
3 changed files with 11 additions and 9 deletions
|
@ -582,9 +582,9 @@ Tell **rofi** that DMenu input is pango markup encoded and should be rendered.
|
||||||
See [here](https://developer.gnome.org/pango/stable/PangoMarkupFormat.html) for details about pango markup.
|
See [here](https://developer.gnome.org/pango/stable/PangoMarkupFormat.html) for details about pango markup.
|
||||||
|
|
||||||
|
|
||||||
`-no-selection-indicator`
|
`-multi-select`
|
||||||
|
|
||||||
Hides the selection indicator. This will make multi-select be invisible.
|
Allow multiple lines to be selected. Adds a small selection indicator to the left of each entry.
|
||||||
|
|
||||||
### Window Mode
|
### Window Mode
|
||||||
|
|
||||||
|
|
|
@ -930,10 +930,10 @@ Hide the input text\. This should not be considered secure!
|
||||||
Tell \fBrofi\fR that DMenu input is pango markup encoded and should be rendered\. See here \fIhttps://developer\.gnome\.org/pango/stable/PangoMarkupFormat\.html\fR for details about pango markup\.
|
Tell \fBrofi\fR that DMenu input is pango markup encoded and should be rendered\. See here \fIhttps://developer\.gnome\.org/pango/stable/PangoMarkupFormat\.html\fR for details about pango markup\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
\fB\-no\-selection\-indicator\fR
|
\fB\-multi\-select\fR
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
Hides the selection indicator\. This will make multi\-select be invisible\.
|
Allow multiple lines to be selected\. Adds a small selection indicator to the left of each entry\.
|
||||||
.
|
.
|
||||||
.SS "Window Mode"
|
.SS "Window Mode"
|
||||||
\fB\-window\-format\fR \fIformat\fR
|
\fB\-window\-format\fR \fIformat\fR
|
||||||
|
|
|
@ -90,6 +90,7 @@ typedef struct
|
||||||
|
|
||||||
gchar **columns;
|
gchar **columns;
|
||||||
gchar *column_separator;
|
gchar *column_separator;
|
||||||
|
gboolean multi_select;
|
||||||
} DmenuModePrivateData;
|
} DmenuModePrivateData;
|
||||||
|
|
||||||
static char **get_dmenu ( DmenuModePrivateData *pd, FILE *fd, unsigned int *length )
|
static char **get_dmenu ( DmenuModePrivateData *pd, FILE *fd, unsigned int *length )
|
||||||
|
@ -469,7 +470,7 @@ static void dmenu_finalize ( RofiViewState *state )
|
||||||
restart = FALSE;
|
restart = FALSE;
|
||||||
// Normal mode
|
// Normal mode
|
||||||
if ( ( mretv & MENU_OK ) && pd->selected_line != UINT32_MAX && cmd_list[pd->selected_line] != NULL ) {
|
if ( ( mretv & MENU_OK ) && pd->selected_line != UINT32_MAX && cmd_list[pd->selected_line] != NULL ) {
|
||||||
if ( ( mretv & MENU_CUSTOM_ACTION ) ) {
|
if ( ( mretv & MENU_CUSTOM_ACTION ) && pd->multi_select ) {
|
||||||
restart = TRUE;
|
restart = TRUE;
|
||||||
if ( pd->selected_list == NULL ) {
|
if ( pd->selected_list == NULL ) {
|
||||||
pd->selected_list = g_malloc0 ( sizeof ( uint32_t ) * ( pd->cmd_list_length / 32 + 1 ) );
|
pd->selected_list = g_malloc0 ( sizeof ( uint32_t ) * ( pd->cmd_list_length / 32 + 1 ) );
|
||||||
|
@ -541,16 +542,17 @@ static void dmenu_finalize ( RofiViewState *state )
|
||||||
int dmenu_switcher_dialog ( void )
|
int dmenu_switcher_dialog ( void )
|
||||||
{
|
{
|
||||||
mode_init ( &dmenu_mode );
|
mode_init ( &dmenu_mode );
|
||||||
MenuFlags menu_flags = MENU_INDICATOR;
|
MenuFlags menu_flags = MENU_NORMAL;
|
||||||
DmenuModePrivateData *pd = (DmenuModePrivateData *) dmenu_mode.private_data;
|
DmenuModePrivateData *pd = (DmenuModePrivateData *) dmenu_mode.private_data;
|
||||||
char *input = NULL;
|
char *input = NULL;
|
||||||
unsigned int cmd_list_length = pd->cmd_list_length;
|
unsigned int cmd_list_length = pd->cmd_list_length;
|
||||||
char **cmd_list = pd->cmd_list;
|
char **cmd_list = pd->cmd_list;
|
||||||
|
|
||||||
pd->only_selected = FALSE;
|
pd->only_selected = FALSE;
|
||||||
|
pd->multi_select = FALSE;
|
||||||
if ( find_arg ( "-no-selection-indicator") >= 0 ){
|
if ( find_arg ( "-multi-select" ) >= 0 ) {
|
||||||
menu_flags = MENU_NORMAL;
|
menu_flags = MENU_INDICATOR;
|
||||||
|
pd->multi_select = TRUE;
|
||||||
}
|
}
|
||||||
if ( find_arg ( "-markup-rows" ) >= 0 ) {
|
if ( find_arg ( "-markup-rows" ) >= 0 ) {
|
||||||
pd->do_markup = TRUE;
|
pd->do_markup = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue