mirror of
https://github.com/lbonn/rofi
synced 2024-11-14 16:17:11 +00:00
Re-add column, but not for dmenu when prompt is set
This commit is contained in:
parent
da2e6a2cc4
commit
90c314f397
4 changed files with 13 additions and 3 deletions
|
@ -26,6 +26,8 @@ typedef enum
|
||||||
MENU_ERROR_DIALOG = 4,
|
MENU_ERROR_DIALOG = 4,
|
||||||
/** INDICATOR */
|
/** INDICATOR */
|
||||||
MENU_INDICATOR = 8,
|
MENU_INDICATOR = 8,
|
||||||
|
/** Show column */
|
||||||
|
MENU_PROMPT_COLON = 16,
|
||||||
} MenuFlags;
|
} MenuFlags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -457,7 +457,8 @@ Mode dmenu_mode =
|
||||||
._get_completion = NULL,
|
._get_completion = NULL,
|
||||||
._preprocess_input = NULL,
|
._preprocess_input = NULL,
|
||||||
.private_data = NULL,
|
.private_data = NULL,
|
||||||
.free = NULL
|
.free = NULL,
|
||||||
|
.display_name = "dmenu:"
|
||||||
};
|
};
|
||||||
|
|
||||||
static void dmenu_finish ( RofiViewState *state, int retv )
|
static void dmenu_finish ( RofiViewState *state, int retv )
|
||||||
|
|
|
@ -179,7 +179,7 @@ static void run_switcher ( ModeMode mode )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
curr_switcher = mode;
|
curr_switcher = mode;
|
||||||
RofiViewState * state = rofi_view_create ( modi[mode], config.filter, NULL, MENU_NORMAL, process_result );
|
RofiViewState * state = rofi_view_create ( modi[mode], config.filter, NULL, MENU_PROMPT_COLON, process_result );
|
||||||
if ( state ) {
|
if ( state ) {
|
||||||
rofi_view_set_active ( state );
|
rofi_view_set_active ( state );
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,7 +177,14 @@ static void rofi_view_update_prompt ( RofiViewState *state )
|
||||||
{
|
{
|
||||||
if ( state->prompt ) {
|
if ( state->prompt ) {
|
||||||
const char *str = mode_get_display_name ( state->sw );
|
const char *str = mode_get_display_name ( state->sw );
|
||||||
textbox_text ( state->prompt, str );
|
if ( (state->menu_flags&MENU_PROMPT_COLON) != 0){
|
||||||
|
char *pr = g_strconcat ( str, ":", NULL);
|
||||||
|
textbox_text ( state->prompt, pr );
|
||||||
|
g_free(pr);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
textbox_text ( state->prompt, str );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue