Commit 7f82bec7 authored by Moritz Lipp's avatar Moritz Lipp

Replace fullscreen mode with presentation mode

parent d58fccd4
This diff is collapsed.
......@@ -1193,6 +1193,35 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t*
return false;
}
static bool fullscreen = false;
if (fullscreen == true) {
gtk_window_unfullscreen(GTK_WINDOW(session->gtk.window));
refresh_view(zathura);
girara_mode_set(session, zathura->modes.normal);
} else {
gtk_window_fullscreen(GTK_WINDOW(session->gtk.window));
refresh_view(zathura);
girara_mode_set(session, zathura->modes.fullscreen);
}
fullscreen = fullscreen ? false : true;
return false;
}
bool
sc_toggle_presentation(girara_session_t* session, girara_argument_t*
UNUSED(argument), girara_event_t* UNUSED(event), unsigned int UNUSED(t))
{
g_return_val_if_fail(session != NULL, false);
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
if (zathura->document == NULL) {
girara_notify(session, GIRARA_WARNING, _("No document opened."));
return false;
}
static bool fullscreen = false;
static int pages_per_row = 1;
static int first_page_column = 1;
......@@ -1245,7 +1274,7 @@ sc_toggle_fullscreen(girara_session_t* session, girara_argument_t*
refresh_view(zathura);
/* setm ode */
girara_mode_set(session, zathura->modes.fullscreen);
girara_mode_set(session, zathura->modes.presentation);
}
fullscreen = fullscreen ? false : true;
......
......@@ -248,6 +248,17 @@ bool sc_toggle_page_mode(girara_session_t* session, girara_argument_t* argument,
*/
bool sc_toggle_fullscreen(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t);
/**
* Toggle presentation mode
*
* @param session The used girara session
* @param argument The used argument
* @param event Girara event
* @param t Number of executions
* @return true if no error occured otherwise false
*/
bool sc_toggle_presentation(girara_session_t* session, girara_argument_t* argument, girara_event_t* event, unsigned int t);
/**
* Quit zathura
*
......
......@@ -112,6 +112,7 @@ struct zathura_s
girara_mode_t fullscreen; /**< Fullscreen mode */
girara_mode_t index; /**< Index mode */
girara_mode_t insert; /**< Insert mode */
girara_mode_t presentation; /**< Presentation mode */
} modes;
struct
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment