Add indicator for sorting/case sensitive.

This commit is contained in:
Dave Davenport 2015-12-14 21:02:36 +01:00
parent 04eebf964a
commit 06f9fee3f8
3 changed files with 44 additions and 14 deletions

View File

@ -822,10 +822,16 @@ Allows custom scripted Modi to be added.
Try using a mono-space font. Try using a mono-space font.
`**rofi** is completely black.` **rofi** is completely black.
Check quotes used on the commandline: e.g. used “ instead of ". Check quotes used on the commandline: e.g. used “ instead of ".
**rofi** what does the icon in the top right show?
- Case sensitivity enabled
+ Sorting enabled
± Sorting and Case sensitivity enabled"
## LICENSE ## LICENSE
MIT/X11 MIT/X11

View File

@ -1350,7 +1350,7 @@ Try using a mono\-space font\.
.IP "" 0 .IP "" 0
. .
.P .P
\fB**rofi** is completely black\.\fR \fBrofi\fR is completely black\.
. .
.IP "" 4 .IP "" 4
. .
@ -1362,6 +1362,21 @@ Check quotes used on the commandline: e\.g\. used “ instead of "\.
. .
.IP "" 0 .IP "" 0
. .
.P
\fBrofi\fR what does the icon in the top right show?
.
.IP "" 4
.
.nf
\- Case sensitivity enabled
+ Sorting enabled
± Sorting and Case sensitivity enabled"
.
.fi
.
.IP "" 0
.
.SH "LICENSE" .SH "LICENSE"
. .
.nf .nf

View File

@ -98,6 +98,24 @@ XIC xic;
GThreadPool *tpool = NULL; GThreadPool *tpool = NULL;
static char * get_matching_state ( void )
{
if ( config.case_sensitive ) {
if ( config.levenshtein_sort ) {
return "±";
}
else {
return "-";
}
}
else{
if ( config.levenshtein_sort ) {
return "+";
}
}
return " ";
}
/** /**
* @param name Name of the switcher to lookup. * @param name Name of the switcher to lookup.
* *
@ -1351,12 +1369,7 @@ MenuReturn menu ( Mode *sw, char **input, char *prompt, unsigned int *selected_l
// Move indicator to end. // Move indicator to end.
textbox_move ( state.case_indicator, state.border + textbox_get_width ( state.prompt_tb ) + entrybox_width, state.border ); textbox_move ( state.case_indicator, state.border + textbox_get_width ( state.prompt_tb ) + entrybox_width, state.border );
if ( config.case_sensitive ) { textbox_text ( state.case_indicator, get_matching_state () );
textbox_text ( state.case_indicator, "*" );
}
else{
textbox_text ( state.case_indicator, " " );
}
state.message_tb = NULL; state.message_tb = NULL;
if ( message ) { if ( message ) {
state.message_tb = textbox_create ( TB_AUTOHEIGHT | TB_MARKUP | TB_WRAP, state.message_tb = textbox_create ( TB_AUTOHEIGHT | TB_MARKUP | TB_WRAP,
@ -1567,6 +1580,7 @@ MenuReturn menu ( Mode *sw, char **input, char *prompt, unsigned int *selected_l
config.levenshtein_sort = !config.levenshtein_sort; config.levenshtein_sort = !config.levenshtein_sort;
state.refilter = TRUE; state.refilter = TRUE;
state.update = TRUE; state.update = TRUE;
textbox_text ( state.case_indicator, get_matching_state () );
break; break;
} }
else if ( abe_test_action ( MODE_PREVIOUS, ev.xkey.state, key ) ) { else if ( abe_test_action ( MODE_PREVIOUS, ev.xkey.state, key ) ) {
@ -1588,12 +1602,7 @@ MenuReturn menu ( Mode *sw, char **input, char *prompt, unsigned int *selected_l
*( state.selected_line ) = 0; *( state.selected_line ) = 0;
state.refilter = TRUE; state.refilter = TRUE;
state.update = TRUE; state.update = TRUE;
if ( config.case_sensitive ) { textbox_text ( state.case_indicator, get_matching_state () );
textbox_text ( state.case_indicator, "*" );
}
else {
textbox_text ( state.case_indicator, " " );
}
break; break;
} }
// Special delete entry command. // Special delete entry command.