Skip to content

Commit

Permalink
[Overlay] Make timeout configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveDavenport committed Feb 8, 2025
1 parent 7880055 commit 2b24da4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions doc/rofi-theme.5.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,10 @@ The following properties are currently supported:
- **require-input**: boolean Listview requires user input to be unhidden.
The list is still present and hitting accept will activate the first entry.

### Overlay widget

- **timeout**: The time the widget is visible when showing a temporary message.

## Listview widget

The listview widget is special container widget.
Expand Down
4 changes: 3 additions & 1 deletion source/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -2847,6 +2847,7 @@ static gboolean rofi_view_overlay_timeout(G_GNUC_UNUSED gpointer user_data) {
widget_disable(WIDGET(state->overlay));
}
CacheState.overlay_timeout = 0;
rofi_view_queue_redraw();
return G_SOURCE_REMOVE;
}

Expand All @@ -2859,8 +2860,9 @@ void rofi_view_set_overlay_timeout(RofiViewState *state, const char *text) {
return;
}
rofi_view_set_overlay(state, text);
int timeout = rofi_theme_get_integer(WIDGET(state->overlay), "timeout", 3);
CacheState.overlay_timeout =
g_timeout_add_seconds(3, rofi_view_overlay_timeout, state);
g_timeout_add_seconds(timeout, rofi_view_overlay_timeout, state);
}

void rofi_view_set_overlay(RofiViewState *state, const char *text) {
Expand Down

0 comments on commit 2b24da4

Please sign in to comment.