From: Olaf Wintermann Date: Sun, 4 Sep 2022 17:43:56 +0000 (+0200) Subject: hide sidebar in fullscreen mode X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=f84f78a3ae9a216a4416be5fcb2b219b68e483fe;p=uwplayer.git hide sidebar in fullscreen mode --- diff --git a/application/window.c b/application/window.c index 2ce5c34..4cdeadc 100644 --- a/application/window.c +++ b/application/window.c @@ -539,6 +539,8 @@ void WindowFullscreen(MainWindow *win, bool enableFullscreen) { main_window->fullscreen = FALSE; } + WindowShowSidebar(win, enableFullscreen ? false : win->sidebarvisible); + XEvent ev; memset(&ev, 0, sizeof(XEvent)); ev.type = ClientMessage; @@ -655,11 +657,8 @@ static void ViewFullscreenCB(Widget w, void *udata, void *cdata) { static void ViewSidebarCB(Widget w, void *udata, void *cdata) { MainWindow *win = udata; XmToggleButtonCallbackStruct *cb = cdata; - if(cb->set) { - WindowShowSidebar(win); - } else { - WindowHideSidebar(win); - } + win->sidebarvisible = cb->set; + WindowShowSidebar(win, cb->set); } static void ViewAdjustWindowSizeCB(Widget w, void *udata, void *cdata) { @@ -720,14 +719,14 @@ void WindowShowPlayerCursor(MainWindow *win) { win->cursorhidden = False; } -void WindowHideSidebar(MainWindow *win) { - XtUnmanageChild(win->sidebar); - XtVaSetValues(win->player_widget, XmNrightAttachment, XmATTACH_FORM, NULL); -} - -void WindowShowSidebar(MainWindow *win) { - XtManageChild(win->sidebar); - XtVaSetValues(win->player_widget, XmNrightAttachment, XmATTACH_WIDGET, XmNrightWidget, win->sidebar, NULL); +void WindowShowSidebar(MainWindow *win, bool visible) { + if(visible) { + XtManageChild(win->sidebar); + XtVaSetValues(win->player_widget, XmNrightAttachment, XmATTACH_WIDGET, XmNrightWidget, win->sidebar, NULL); + } else { + XtUnmanageChild(win->sidebar); + XtVaSetValues(win->player_widget, XmNrightAttachment, XmATTACH_FORM, NULL); + } } void WindowUpdate(MainWindow *win) { diff --git a/application/window.h b/application/window.h index 55bdd1f..dd44b88 100644 --- a/application/window.h +++ b/application/window.h @@ -111,8 +111,7 @@ void WindowShowPlayerCursor(MainWindow *win); void WindowHandlePlayerEvent(MainWindow *win, XEvent *event); -void WindowHideSidebar(MainWindow *win); -void WindowShowSidebar(MainWindow *win); +void WindowShowSidebar(MainWindow *win, bool visible); void WindowUpdate(MainWindow *win);