summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQball Cow <qball@gmpclient.org>2015-06-09 18:10:23 +0200
committerQball Cow <qball@gmpclient.org>2015-06-09 18:10:23 +0200
commite5caaf9d1a737a64d22404fb067899918b095678 (patch)
tree7d291ba3da300b368286c0dabb9779a96481bd76
parent95beb587307243a75461cd43a2f6bedb567c14b1 (diff)
Possible fix issue #175
-rw-r--r--include/textbox.h14
-rw-r--r--source/dialogs/dmenu.c35
2 files changed, 25 insertions, 24 deletions
diff --git a/include/textbox.h b/include/textbox.h
index 37b4fbef..9d49aedb 100644
--- a/include/textbox.h
+++ b/include/textbox.h
@@ -25,13 +25,13 @@ typedef struct
typedef enum
{
- TB_AUTOHEIGHT = 1 << 0,
- TB_AUTOWIDTH = 1 << 1,
- TB_LEFT = 1 << 16,
- TB_RIGHT = 1 << 17,
- TB_CENTER = 1 << 18,
- TB_EDITABLE = 1 << 19,
- TB_MARKUP = 1 << 20,
+ TB_AUTOHEIGHT = 1 << 0,
+ TB_AUTOWIDTH = 1 << 1,
+ TB_LEFT = 1 << 16,
+ TB_RIGHT = 1 << 17,
+ TB_CENTER = 1 << 18,
+ TB_EDITABLE = 1 << 19,
+ TB_MARKUP = 1 << 20,
} TextboxFlags;
diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c
index 864c95f4..c4311d00 100644
--- a/source/dialogs/dmenu.c
+++ b/source/dialogs/dmenu.c
@@ -262,30 +262,31 @@ int dmenu_switcher_dialog ( char **input )
}
// We normally do not want to restart the loop.
restart = FALSE;
- if ( ( mretv & ( MENU_OK | MENU_CUSTOM_INPUT ) ) && list[selected_line] != NULL ) {
- if ( ( mretv & MENU_CUSTOM_INPUT ) ) {
- dmenu_output_formatted_line ( format, *input, -1, *input );
- }
- else{
- dmenu_output_formatted_line ( format, list[selected_line], selected_line, *input );
- }
+ // Normal mode
+ if ( ( mretv & MENU_OK ) && list[selected_line] != NULL ) {
+ dmenu_output_formatted_line ( format, list[selected_line], selected_line, *input );
if ( ( mretv & MENU_SHIFT ) ) {
restart = TRUE;
// Move to next line.
selected_line = MIN ( next_pos, length - 1 );
}
retv = TRUE;
- if ( ( mretv & MENU_QUICK_SWITCH ) ) {
- retv = 10 + ( mretv & MENU_LOWER_MASK );
- }
+ // Custom input
}
- else if ( ( mretv & MENU_QUICK_SWITCH ) ) {
- if ( ( mretv & MENU_CUSTOM_INPUT ) ) {
- dmenu_output_formatted_line ( format, *input, -1, *input );
- }
- else{
- dmenu_output_formatted_line ( format, list[selected_line], selected_line, *input );
- }
+ else if ( ( mretv & ( MENU_CUSTOM_INPUT ) ) ) {
+ dmenu_output_formatted_line ( format, *input, -1, *input );
+ retv = TRUE;
+ }
+ // Quick switch with entry selected.
+ else if ( ( mretv & MENU_QUICK_SWITCH ) && selected_line > 0 ) {
+ dmenu_output_formatted_line ( format, list[selected_line], selected_line, *input );
+
+ restart = FALSE;
+ retv = 10 + ( mretv & MENU_LOWER_MASK );
+ }
+ // Quick switch without entry selected.
+ else if ( ( mretv & MENU_QUICK_SWITCH ) && selected_line == -1 ) {
+ dmenu_output_formatted_line ( format, *input, -1, *input );
restart = FALSE;
retv = 10 + ( mretv & MENU_LOWER_MASK );